|
@@ -29,6 +29,7 @@
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
#include <sys/types.h>
|
|
#include <sys/types.h>
|
|
|
|
+#include <sys/stat.h>
|
|
#include <sys/wait.h>
|
|
#include <sys/wait.h>
|
|
|
|
|
|
#include "synctest.h"
|
|
#include "synctest.h"
|
|
@@ -52,10 +53,22 @@ static int run_test(int (*test)(void), char *name)
|
|
exit(test());
|
|
exit(test());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int sync_api_supported(void)
|
|
|
|
+{
|
|
|
|
+ struct stat sbuf;
|
|
|
|
+
|
|
|
|
+ return 0 == stat("/sys/kernel/debug/sync/sw_sync", &sbuf);
|
|
|
|
+}
|
|
|
|
+
|
|
int main(void)
|
|
int main(void)
|
|
{
|
|
{
|
|
int err = 0;
|
|
int err = 0;
|
|
|
|
|
|
|
|
+ if (!sync_api_supported()) {
|
|
|
|
+ printf("SKIP: Sync framework not supported by kernel\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
printf("[RUN]\tTesting sync framework\n");
|
|
printf("[RUN]\tTesting sync framework\n");
|
|
|
|
|
|
err += RUN_TEST(test_alloc_timeline);
|
|
err += RUN_TEST(test_alloc_timeline);
|