test-online-cpus: helper to return cpu count

Created helper executable to print the value of online_cpus() allowing multi-threaded tests to be skipped when appropriate. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Apr 3, 2017 at 15:16 UTC e3482ccf27b8278289f899cbb294696389a9e1c8
3 files changed +10
Makefile
+1
@@ -619,6 +619,7 @@ TEST_PROGRAMS_NEED_X += test-line-buffer
619 TEST_PROGRAMS_NEED_X += test-match-trees
620 TEST_PROGRAMS_NEED_X += test-mergesort
621 TEST_PROGRAMS_NEED_X += test-mktemp
622 +TEST_PROGRAMS_NEED_X += test-online-cpus
623 TEST_PROGRAMS_NEED_X += test-parse-options
624 TEST_PROGRAMS_NEED_X += test-path-utils
625 TEST_PROGRAMS_NEED_X += test-prio-queue
t/helper/.gitignore
+1
@@ -16,6 +16,7 @@
16 /test-match-trees
17 /test-mergesort
18 /test-mktemp
19 +/test-online-cpus
20 /test-parse-options
21 /test-path-utils
22 /test-prio-queue
t/helper/test-online-cpus.c new
+8
@@ -0,0 +1,8 @@
1 +#include "git-compat-util.h"
2 +#include "thread-utils.h"
3 +
4 +int cmd_main(int argc, const char **argv)
5 +{
6 + printf("%d\n", online_cpus());
7 + return 0;
8 +}