blob: 288261a6eea420b7e4175802586ffc644107b791 [file] [log] [blame]
diff --git a/tests/seccomp_bpf_tests.c b/tests/seccomp_bpf_tests.c
index deb78d1..98b0231 100644
--- a/tests/seccomp_bpf_tests.c
+++ b/tests/seccomp_bpf_tests.c
@@ -1457,7 +1457,7 @@ FIXTURE_TEARDOWN(TSYNC) {
if (!s->tid)
continue;
if (pthread_kill(s->tid, 0)) {
- pthread_cancel(s->tid);
+ //pthread_cancel(s->tid); // ANDROID
pthread_join(s->tid, &status);
}
}
@@ -1940,4 +1940,10 @@ TEST(syscall_restart) {
* - ...
*/
+// ANDROID:begin
+struct __test_metadata* get_seccomp_test_list() {
+ return __test_list;
+}
+// ANDROID:end
+
TEST_HARNESS_MAIN
diff --git a/tests/test_harness.h b/tests/test_harness.h
index 47ee027..597e40c 100644
--- a/tests/test_harness.h
+++ b/tests/test_harness.h
@@ -49,6 +49,8 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <android/log.h> // ANDROID
+
/* All exported functionality should be declared through this macro. */
#define TEST_API(x) _##x
@@ -206,9 +208,11 @@
} while (0)
/* Unconditional logger for internal use. */
+// ANDROID:begin
#define __TH_LOG(fmt, ...) \
- fprintf(TH_LOG_STREAM, "%s:%d:%s:" fmt "\n", \
+ __android_log_print(ANDROID_LOG_ERROR, "SeccompBpfTest-KernelUnit", "%s:%d:%s:" fmt "\n", \
__FILE__, __LINE__, _metadata->name, ##__VA_ARGS__)
+// ANDROID:end
/* Defines the test function and creates the registration stub. */
#define _TEST(test_name) __TEST_IMPL(test_name, -1)
@@ -292,7 +296,7 @@
if (!__constructor_order) \
__constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; \
} \
- int main(int argc, char **argv) { return test_harness_run(argc, argv); }
+ int seccomp_test_main(int argc, char **argv) { return test_harness_run(argc, argv); } // ANDROID
#define _ASSERT_EQ(_expected, _seen) \
__EXPECT(_expected, _seen, ==, 1)