Skip to content
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

Parallel CTest in CI #243

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Shorten pyctest examples tests + Windows testing fix
- Decrease runtime of examples from pyctest
- Fix for DISCOVER_TESTS + environment vars on Windows for component_bundle_tests
  • Loading branch information
jrmadsen committed Jan 14, 2022
commit 4f48a997f81ec52dd57ea721a34314ed60ea918a
8 changes: 4 additions & 4 deletions examples/ex-cxx-tuple/ex_cxx_tuple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
using namespace tim::stl;
using namespace tim::component;

using papi_tuple_t = papi_tuple<PAPI_TOT_CYC, PAPI_TOT_INS, PAPI_LST_INS>;
using papi_tuple_t = papi_tuple<PAPI_TOT_CYC, PAPI_TOT_INS>;

using auto_tuple_t =
tim::auto_tuple_t<wall_clock, system_clock, thread_cpu_clock, thread_cpu_util,
Expand Down Expand Up @@ -242,11 +242,11 @@ test_2_timing()
std::vector<std::thread> threads;
runtime.start();
{
for(int i = 0; i < 7; ++i)
for(int i = 0; i < 3; ++i)
threads.push_back(std::thread(run_fib, 35));
threads.push_back(std::thread(run_fib, 43));
threads.push_back(std::thread(run_fib, 40));

run_fib(40);
run_fib(38);

for(auto& itr : threads)
itr.join();
Expand Down
10 changes: 5 additions & 5 deletions pyctest-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ def add_timem_test(name, cmd):

pyct.test(
construct_name("ex-derived"),
construct_command(["./ex_derived"], args),
construct_command(["./ex_derived", "30", "5"], args),
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
Expand Down Expand Up @@ -1331,7 +1331,7 @@ def add_timem_test(name, cmd):

pyct.test(
construct_name("ex-c-timing"),
construct_command(["./ex_c_timing"], args),
construct_command(["./ex_c_timing", "30"], args),
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def add_timem_test(name, cmd):
if args.gotcha:
pyct.test(
construct_name("ex-gotcha"),
construct_command(["./ex_gotcha"], args),
construct_command(["./ex_gotcha", "5"], args),
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
Expand All @@ -1424,7 +1424,7 @@ def add_timem_test(name, cmd):
)

if args.mpi and dmprun is not None:
ex_gotcha_cmd = [dmprun] + dmpargs + ["./ex_gotcha_mpi"]
ex_gotcha_cmd = [dmprun] + dmpargs + ["./ex_gotcha_mpi", "5"]
pyct.test(
construct_name("ex-gotcha-mpi"),
construct_command(ex_gotcha_cmd, args),
Expand Down Expand Up @@ -1586,7 +1586,7 @@ def add_timem_test(name, cmd):

pyct.test(
construct_name("ex-statistics"),
construct_command(["./ex_cxx_statistics"], args),
construct_command(["./ex_cxx_statistics", "30", "5"], args),
{
"WORKING_DIRECTORY": pyct.BINARY_DIRECTORY,
"LABELS": pyct.PROJECT_NAME,
Expand Down
8 changes: 7 additions & 1 deletion source/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ mark_as_advanced(TIMEMORY_SOCKET_TESTS)
# include the current directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

# for use when environment settings + discover tests causes some issues on Windows
set(_DISCOVER_TESTS_WITH_ENVIRON DISCOVER_TESTS)
if(WIN32)
set(_DISCOVER_TESTS_WITH_ENVIRON)
endif()

set(CMAKE_UNITY_BUILD OFF)
if(NOT DEFINED CTEST_TEST_TIMEOUT OR "${CTEST_TEST_TIMEOUT}" STREQUAL "")
set(CTEST_TEST_TIMEOUT 180)
Expand Down Expand Up @@ -288,7 +294,7 @@ add_timemory_google_test(
LINK_LIBRARIES common-test-libs ${_LIBRARY})

add_timemory_google_test(
component_bundle_tests DISCOVER_TESTS MPI
component_bundle_tests ${_DISCOVER_TESTS_WITH_ENVIRON} MPI
NPROCS 2
SOURCES component_bundle_tests.cpp
LINK_LIBRARIES common-test-libs ${_LIBRARY}
Expand Down