Skip mm_cid tests when unavailable
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Apr 2023 23:12:52 +0000 (19:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 25 Apr 2023 23:12:52 +0000 (19:12 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I53e9d8f3c654b4fe8d5fc5275984f6340f8bc872

tests/param_test.c
tests/run_param_test.tap

index f93ddd5c39b87af4993a88bc8555926ee71fafd8..e609cfa0bab4b6742b4dee40b5246e71bdb5aa43 100644 (file)
@@ -1646,8 +1646,8 @@ int main(int argc, char **argv)
        if (!opt_disable_rseq && rseq_register_current_thread())
                goto error;
        if (!opt_disable_rseq && !rseq_validate_cpu_id()) {
-               fprintf(stderr, "Error: cpu id getter unavailable\n");
-               goto error;
+               printf_verbose("The rseq cpu id getter is unavailable\n");
+               goto no_rseq;
        }
        switch (opt_test) {
        case 's':
index a8c5716e67a524d4ef5378e30d1e39ec3c276a88..ad6fbff518fd539d90d7c2f67a17bb183517252f 100755 (executable)
@@ -34,10 +34,16 @@ function do_test()
        ok $? "Running compare-twice test ${test_name}"
 
        "$RSEQ_TESTS_BUILDDIR"/param_test_mm_cid "${args[@]}" -r ${REPS} -t ${NR_THREADS} "${EXTRA_ARGS[@]}"
-       ok $? "Running mm_cid test ${test_name}"
+       res=$?
+       skip $(($res != 2 )) "Running mm_cid test ${test_name}" 1 || {
+               ok $res "Running mm_cid test ${test_name}"
+       }
 
        "$RSEQ_TESTS_BUILDDIR"/param_test_mm_cid_compare_twice "${args[@]}" -r ${REPS} -t ${NR_THREADS} "${EXTRA_ARGS[@]}"
-       ok $? "Running compare-twice mm_cid test ${test_name}"
+       res=$?
+       skip $(($res != 2)) "Running compare-twice mm_cid test ${test_name}" 1 || {
+               ok $res "Running compare-twice mm_cid test ${test_name}"
+       }
 }
 
 function do_tests()
This page took 0.029688 seconds and 4 git commands to generate.