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

Question/Bug: runing state and order dependent tests with ctest #1758

Open
stefaneicher opened this issue Aug 11, 2023 · 1 comment
Open

Comments

@stefaneicher
Copy link

Hi,

If I understand it correctly, you test in OrderedTestTest.cpp

TEST_ORDERED(TestOrderedTestMacros, Test10, 10)

as sequence. The tests share a state and depend on this shared state and its order.

image
Now you run them with ctest. The problem is the ctest runs each test in a new process. Meaning the test fail.
image

We (@balazs-dot and @stefaneicher ) tested in version 4.0 with setting (TESTS_DETAILED on V4.0, CPPUTEST_TESTS_DETAILED in latest)

option(CPPUTEST_JUNIT_REPORT "Output JUnit test reports")

if (TESTS_BUILD_DISCOVER)

Solution:
replacing
cpputest_buildtime_discover_tests(CppUTestExtTests)
with
add_test(NAME CppUTestExtTests COMMAND CppUTestExtTests)
caused the desired behavior of running all test in one process

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