summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2017-04-03 17:16:41 +0200
committerJunio C Hamano <gitster@pobox.com>2017-04-13 08:17:19 +0200
commite3482ccf27b8278289f899cbb294696389a9e1c8 (patch)
tree0874a33fc9b58abf661f580d59bc4f8c8fd4d83a /t
parentname-hash: fix buffer overrun (diff)
downloadgit-e3482ccf27b8278289f899cbb294696389a9e1c8.tar.xz
git-e3482ccf27b8278289f899cbb294696389a9e1c8.zip
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>
Diffstat (limited to 't')
-rw-r--r--t/helper/.gitignore1
-rw-r--r--t/helper/test-online-cpus.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/t/helper/.gitignore b/t/helper/.gitignore
index 758ed2e8fa..b05d67c237 100644
--- a/t/helper/.gitignore
+++ b/t/helper/.gitignore
@@ -16,6 +16,7 @@
/test-match-trees
/test-mergesort
/test-mktemp
+/test-online-cpus
/test-parse-options
/test-path-utils
/test-prio-queue
diff --git a/t/helper/test-online-cpus.c b/t/helper/test-online-cpus.c
new file mode 100644
index 0000000000..06c09c6b88
--- /dev/null
+++ b/t/helper/test-online-cpus.c
@@ -0,0 +1,8 @@
+#include "git-compat-util.h"
+#include "thread-utils.h"
+
+int cmd_main(int argc, const char **argv)
+{
+ printf("%d\n", online_cpus());
+ return 0;
+}