A
atrelinski
Guest
atrelinski Asks: How to check if file was created by test in ctest
In my case, an executable apart from output and error code creates also file (e.g.
I would like
I am expecting that if file was not created the test will fail (The
ctest
framework is great framework for testing output and error code. E.g.:
Code:
add_test(NAME VersionTest COMMAND myapp.exe --help)
set_tests_properties(VersionTest PROPERTIES PASS_REGULAR_EXPRESSION "Version: 2.2.2")
In my case, an executable apart from output and error code creates also file (e.g.
res.json
)I would like
ctest
also validate if file was created. How I can do that?I am expecting that if file was not created the test will fail (The
ctest --test-dir build
command run all tests and the one that check file existence will fail)