Skip to content

Commit e3482cc

Browse files
jeffhostetlergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a1bd45 commit e3482cc

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,7 @@ TEST_PROGRAMS_NEED_X += test-line-buffer
619619
TEST_PROGRAMS_NEED_X += test-match-trees
620620
TEST_PROGRAMS_NEED_X += test-mergesort
621621
TEST_PROGRAMS_NEED_X += test-mktemp
622+
TEST_PROGRAMS_NEED_X += test-online-cpus
622623
TEST_PROGRAMS_NEED_X += test-parse-options
623624
TEST_PROGRAMS_NEED_X += test-path-utils
624625
TEST_PROGRAMS_NEED_X += test-prio-queue

t/helper/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/test-match-trees
1717
/test-mergesort
1818
/test-mktemp
19+
/test-online-cpus
1920
/test-parse-options
2021
/test-path-utils
2122
/test-prio-queue

t/helper/test-online-cpus.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

0 commit comments

Comments
 (0)