projects
/
librseq.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Skip the tests if the rseq syscall is unavailable
[librseq.git]
/
tests
/
basic_percpu_ops_test.c
diff --git
a/tests/basic_percpu_ops_test.c
b/tests/basic_percpu_ops_test.c
index 7000ff505893bf987d6ac47ddfbfc7d69cf15a7b..e514ce6a6cae36280242013a6a8cbba5d18e0afb 100644
(file)
--- a/
tests/basic_percpu_ops_test.c
+++ b/
tests/basic_percpu_ops_test.c
@@
-15,7
+15,7
@@
#include "tap.h"
#include "tap.h"
-#define NR_TESTS
2
+#define NR_TESTS
4
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@
-303,23
+303,30
@@
int main(void)
{
plan_tests(NR_TESTS);
{
plan_tests(NR_TESTS);
+ if (!rseq_available()) {
+ skip(NR_TESTS, "The rseq syscall is unavailable");
+ goto end;
+ }
+
if (rseq_register_current_thread()) {
if (rseq_register_current_thread()) {
- f
printf(stderr, "Error:
rseq_register_current_thread(...) failed(%d): %s\n",
+ f
ail("
rseq_register_current_thread(...) failed(%d): %s\n",
errno, strerror(errno));
errno, strerror(errno));
- goto error;
+ goto end;
+ } else {
+ pass("Registered current thread with rseq");
}
test_percpu_spinlock();
test_percpu_list();
if (rseq_unregister_current_thread()) {
}
test_percpu_spinlock();
test_percpu_list();
if (rseq_unregister_current_thread()) {
- f
printf(stderr, "Error:
rseq_unregister_current_thread(...) failed(%d): %s\n",
+ f
ail("
rseq_unregister_current_thread(...) failed(%d): %s\n",
errno, strerror(errno));
errno, strerror(errno));
- goto error;
+ goto end;
+ } else {
+ pass("Unregistered current thread with rseq");
}
}
- exit(EXIT_SUCCESS);
-
-error:
- exit(EXIT_FAILURE);
+end:
+ exit(exit_status());
}
}
This page took
0.024064 seconds
and
4
git commands to generate.