COMMAND bsdcat_test -vv
-p $<TARGET_FILE:bsdcat>
-r ${CMAKE_CURRENT_SOURCE_DIR}
+ -s
${_testname})
+ SET_TESTS_PROPERTIES(bsdcat_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
COMMAND bsdcpio_test -vv
-p $<TARGET_FILE:bsdcpio>
-r ${CMAKE_CURRENT_SOURCE_DIR}
+ -s
${_testname})
+ SET_TESTS_PROPERTIES(bsdcpio_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
NAME libarchive_${_testname}
COMMAND libarchive_test -vv
-r ${CMAKE_CURRENT_SOURCE_DIR}
+ -s
${_testname})
+ SET_TESTS_PROPERTIES(libarchive_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
COMMAND bsdtar_test -vv
-p $<TARGET_FILE:bsdtar>
-r ${CMAKE_CURRENT_SOURCE_DIR}
+ -s
${_testname})
+ SET_TESTS_PROPERTIES(bsdtar_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
static int dump_on_failure = 0;
/* Default is to remove temp dirs and log data for successful tests. */
static int keep_temp_files = 0;
+/* Default is to only return a failure code (1) if there were test failures. If enabled, exit with code 2 if there were no failures, but some tests were skipped. */
+static int fail_if_tests_skipped = 0;
/* Default is to run the specified tests once and report errors. */
static int until_failure = 0;
/* Default is to just report pass/fail for each test. */
printf(" -q Quiet.\n");
printf(" -r <dir> Path to dir containing reference files.\n");
printf(" Default: Current directory.\n");
- printf(" -u Keep running specifies tests until one fails.\n");
+ printf(" -s Exit with code 2 if any tests were skipped.\n");
+ printf(" -u Keep running specified tests until one fails.\n");
printf(" -v Verbose.\n");
printf("Available tests:\n");
for (i = 0; i < limit; i++)
case 'r':
refdir = option_arg;
break;
+ case 's':
+ fail_if_tests_skipped = 1;
+ break;
case 'u':
until_failure++;
break;
assertChdir("..");
rmdir(tmpdir);
- return (tests_failed ? 1 : 0);
+ if (tests_failed) return 1;
+
+ if (fail_if_tests_skipped == 1 && skips > 0) return 2;
+
+ return 0;
}
COMMAND bsdunzip_test -vv
-p $<TARGET_FILE:bsdunzip>
-r ${CMAKE_CURRENT_SOURCE_DIR}
+ -s
${_testname})
+ SET_TESTS_PROPERTIES(bsdunzip_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
ENDMACRO (DEFINE_TEST _testname)
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)