New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: limit test-run jobs number to CPU count #7494
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,29 +48,42 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/small | |
add_custom_target(symlink_libsmall_test_binaries ALL | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small) | ||
|
||
# Get the test-run jobs count from the env variable. If the variable is not | ||
# defined, use the CPU count instead. If the ProcessorCount fails to determine | ||
# the number of cores, it yields 0, which means for test-run 2 x CPU count. | ||
set(TEST_RUN_JOBS $ENV{TEST_RUN_JOBS}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe it is better to have a single variable with number of jobs for everything: compilers, test-run.py, prove etc. |
||
if(NOT TEST_RUN_JOBS) | ||
include(ProcessorCount) | ||
ProcessorCount(TEST_RUN_JOBS) | ||
endif() | ||
|
||
Comment on lines
50
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
add_custom_target(test-unit | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use symbol |
||
small/ | ||
unit/) | ||
|
||
add_custom_target(test-unit-force | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} | ||
--force | ||
small/ | ||
unit/) | ||
|
||
add_custom_target(test-func | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} | ||
--exclude small/ | ||
--exclude unit/) | ||
|
||
add_custom_target(test-func-force | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} | ||
--exclude small/ | ||
--exclude unit/ | ||
|
@@ -80,12 +93,14 @@ add_custom_target(test | |
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small | ||
LuaJIT-test | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR}) | ||
|
||
add_custom_target(test-force | ||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/small | ||
LuaJIT-test | ||
COMMAND ${PROJECT_SOURCE_DIR}/test/test-run.py | ||
--jobs ${TEST_RUN_JOBS} | ||
--builddir=${PROJECT_BINARY_DIR} | ||
--force) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How it is supposed to work? It is not clear what is a
${NPROC}
and where it is set.