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>
This commit is contained in:
parent
2a1bd45b2e
commit
e3482ccf27
1
Makefile
1
Makefile
@ -619,6 +619,7 @@ TEST_PROGRAMS_NEED_X += test-line-buffer
|
|||||||
TEST_PROGRAMS_NEED_X += test-match-trees
|
TEST_PROGRAMS_NEED_X += test-match-trees
|
||||||
TEST_PROGRAMS_NEED_X += test-mergesort
|
TEST_PROGRAMS_NEED_X += test-mergesort
|
||||||
TEST_PROGRAMS_NEED_X += test-mktemp
|
TEST_PROGRAMS_NEED_X += test-mktemp
|
||||||
|
TEST_PROGRAMS_NEED_X += test-online-cpus
|
||||||
TEST_PROGRAMS_NEED_X += test-parse-options
|
TEST_PROGRAMS_NEED_X += test-parse-options
|
||||||
TEST_PROGRAMS_NEED_X += test-path-utils
|
TEST_PROGRAMS_NEED_X += test-path-utils
|
||||||
TEST_PROGRAMS_NEED_X += test-prio-queue
|
TEST_PROGRAMS_NEED_X += test-prio-queue
|
||||||
|
1
t/helper/.gitignore
vendored
1
t/helper/.gitignore
vendored
@ -16,6 +16,7 @@
|
|||||||
/test-match-trees
|
/test-match-trees
|
||||||
/test-mergesort
|
/test-mergesort
|
||||||
/test-mktemp
|
/test-mktemp
|
||||||
|
/test-online-cpus
|
||||||
/test-parse-options
|
/test-parse-options
|
||||||
/test-path-utils
|
/test-path-utils
|
||||||
/test-prio-queue
|
/test-prio-queue
|
||||||
|
8
t/helper/test-online-cpus.c
Normal file
8
t/helper/test-online-cpus.c
Normal file
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user