summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-11-18 18:30:20 +0000
committerEdward Thomson <ethomson@github.com>2016-11-18 19:00:14 +0000
commit6367c58cd482288e5cd476bd48d0d4406e3bac7b (patch)
treeeac23f7bcb47e66d2829625f17db4f64fcbc353f
parent6a05c7a0efd60dce3e99673c3256bf60516693ed (diff)
downloadlibgit2-ethomson/clar_threads.tar.gz
tests: handle life without threadsethomson/clar_threads
-rw-r--r--tests/clar_libgit2.h6
-rw-r--r--tests/threads/basic.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index 1d8d4a50b..663d1362a 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -59,7 +59,11 @@ typedef struct {
char error_msg[4096];
} cl_git_thread_err;
-#define cl_git_thread_pass(threaderr, expr) cl_git_thread_pass_(threaderr, (expr), __FILE__, __LINE__)
+#ifdef GIT_THREADS
+# define cl_git_thread_pass(threaderr, expr) cl_git_thread_pass_(threaderr, (expr), __FILE__, __LINE__)
+#else
+# define cl_git_thread_pass(threaderr, expr) cl_git_pass(expr)
+#endif
#define cl_git_thread_pass_(__threaderr, __expr, __file, __line) do { \
giterr_clear(); \
diff --git a/tests/threads/basic.c b/tests/threads/basic.c
index 685452d44..a9310bbd4 100644
--- a/tests/threads/basic.c
+++ b/tests/threads/basic.c
@@ -49,6 +49,7 @@ void test_threads_basic__set_error(void)
run_in_parallel(1, 4, set_error, NULL, NULL);
}
+#ifdef GIT_THREADS
static void *return_normally(void *param)
{
return param;
@@ -59,9 +60,13 @@ static void *exit_abruptly(void *param)
git_thread_exit(param);
return NULL;
}
+#endif
void test_threads_basic__exit(void)
{
+#ifndef GIT_THREADS
+ clar__skip();
+#else
git_thread thread;
void *result;
@@ -74,4 +79,5 @@ void test_threads_basic__exit(void)
cl_git_pass(git_thread_create(&thread, return_normally, (void *)232323));
cl_git_pass(git_thread_join(&thread, &result));
cl_assert_equal_sz(232323, (size_t)result);
-} \ No newline at end of file
+#endif
+}