Conversation
|
Does the test framework provide a mechanism to skip unit tests? Perhaps that would be more appropriate. |
I am not sure what you mean. You definitely can skip running the tests. You can also skip a specific unit test If you mean skipping this one test when the files are not under git... it is essentially what my PR does, it tries to recover the files, but if it can't, it just does not fail the test. |
|
Some unit test frameworks have a SKIP result for unit tests in addition to the usual PASS/FAIL ones. SKIP means “test was not run and we cannot say if it would pass or not.” This is more meaningful than just having the unit test pass, as it makes clear that nothing was actually tested. CMake-based tests support this through the SKIP_RETURN_CODE variable. Maybe that is applicable here? |
| if not files: | ||
| print("No .cpp or .h files found in the Git repository" + (" in src/ or include/" if args.limit else "") + ".") | ||
| sys.exit(1) # Exit with error code if no files are found | ||
| sys.exit(0) # Exit with success code if no files are found, see https://github.com/simdutf/simdutf/issues/921 |
There was a problem hiding this comment.
| sys.exit(0) # Exit with success code if no files are found, see https://github.com/simdutf/simdutf/issues/921 | |
| sys.exit(2) # Exit with success code if no files are found, see https://github.com/simdutf/simdutf/issues/921 |
And then in tests/CMakeLists.txt, set the SKIP_RETURN_CODE property of this test to 2.
|
@clausecker Yes, well ahead of you. Check my last commit. I used 142 instead of 2 because 142 is 2 * 71 which is obviously good. |
|
I like it! LGTM. |
|
@clausecker I will let the tests go green. |
When git fails to return the files (i.e., when we are not under git control), we should just have the
check_feature_macrostest succeed (with a warning message).Fixes: #921