gtest-runner icon indicating copy to clipboard operation
gtest-runner copied to clipboard

Tests can not run in gtest runner

Open lkxtracy opened this issue 5 years ago • 3 comments

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 avatar Mar 16 '20 09:03 lkxtracy

@nholthaus

lkxtracy avatar Mar 16 '20 09:03 lkxtracy

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?

nholthaus avatar Mar 16 '20 14:03 nholthaus

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.

lkxtracy avatar Mar 16 '20 15:03 lkxtracy