Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests can not run in gtest runner #43

Open
lkxtracy opened this issue Mar 16, 2020 · 3 comments
Open

Tests can not run in gtest runner #43

lkxtracy opened this issue Mar 16, 2020 · 3 comments

Comments

@lkxtracy
Copy link

I try to run a gtest project in gtest runner.but nothing happened.No logs and errors.
Is there any demo project can help?

main.cpp:

#include "stdafx.h"
#include "gtest\gtest.h"
#include "Test.h"

int main(int argc, _TCHAR* argv[])
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Test.cpp:

#include "stdafx.h"
#include "Test.h"

TEST(Test, Success)
{
EXPECT_EQ(0, 0);
}

TEST(Test, Failure)
{
EXPECT_EQ(0, 2);
}

@lkxtracy
Copy link
Author

@nholthaus

@nholthaus
Copy link
Owner

I'm not sure what you mean by 'run a gtest project'. Just to be clear, gtest-runner runs compiled executable files (.exe), not source code. Additionally, if your test executable crashes, there isn't anything gtest-runner can do about that.

If you run the executable stand-alone (in a command window) do you get the expected results?

@lkxtracy
Copy link
Author

Thank you for reply!
I compiled an executable file with codes above and got expected results.But it cound not run with gest runner.
I found that gtest runner pass an xml file to executable but it was not generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants