Skip to content

Commit

Permalink
add logic to skip multi-threaded and MPI smoketests if not built
Browse files Browse the repository at this point in the history
  • Loading branch information
slabasan committed Apr 9, 2024
1 parent 96144f8 commit 942ec14
Showing 1 changed file with 36 additions and 28 deletions.
64 changes: 36 additions & 28 deletions src/c/test/t0001-cbinding-basic.t.in
Original file line number Diff line number Diff line change
Expand Up @@ -183,39 +183,47 @@ test_expect_success 'PERFFLOW_OPTIONS: enable logging smoketest3' '
rm perfflow.$(hostname).[0-9]*.pfw
'

test_expect_success 'c binding: smoketest_MT runs ok in default' '
../smoketest_MT &&
rm perfflow.$(hostname).[0-9]*.pfw
'
if test -f ../smoketest_MT; then
test_expect_success 'c binding: smoketest_MT runs ok in default' '
../smoketest_MT &&
rm perfflow.$(hostname).[0-9]*.pfw
'

test_expect_success 'PERFFLOW_OPTIONS: disable logging smoketest_MT' '
PERFFLOW_OPTIONS="log-enable=False" ../smoketest_MT &&
! test -f perfflow.$(hostname).[0-9]*.pfw &&
if test -f perfflow.$(hostname).[0-9]*.pfw; then rm perfflow.$(hostname).[0-9]*.pfw; fi
'
test_expect_success 'PERFFLOW_OPTIONS: disable logging smoketest_MT' '
PERFFLOW_OPTIONS="log-enable=False" ../smoketest_MT &&
! test -f perfflow.$(hostname).[0-9]*.pfw &&
if test -f perfflow.$(hostname).[0-9]*.pfw; then rm perfflow.$(hostname).[0-9]*.pfw; fi
'

test_expect_success 'PERFFLOW_OPTIONS: enable logging smoketest_MT' '
PERFFLOW_OPTIONS="log-enable=True" ../smoketest_MT &&
test -f perfflow.$(hostname).[0-9]*.pfw &&
rm perfflow.$(hostname).[0-9]*.pfw
'
test_expect_success 'PERFFLOW_OPTIONS: enable logging smoketest_MT' '
PERFFLOW_OPTIONS="log-enable=True" ../smoketest_MT &&
test -f perfflow.$(hostname).[0-9]*.pfw &&
rm perfflow.$(hostname).[0-9]*.pfw
'
else
say "Skipping multithreaded smoketests...disabled in the build."
fi

test_expect_success 'c binding: smoketest_MPI runs ok in default' '
mpirun -n 2 ../smoketest_MPI &&
rm perfflow.$(hostname).[0-9]*.pfw
'
if test -f ../smoketest_MPI; then
test_expect_success 'c binding: smoketest_MPI runs ok in default' '
mpirun -n 2 ../smoketest_MPI &&
rm perfflow.$(hostname).[0-9]*.pfw
'

test_expect_success 'PERFFLOW_OPTIONS: disable logging smoketest_MPI' '
PERFFLOW_OPTIONS="log-enable=False" mpirun -n 2 ../smoketest_MPI &&
test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -eq 0 &&
if test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -gt 0; then rm -f perfflow.$(hostname).[0-9]*.pfw; fi
'
test_expect_success 'PERFFLOW_OPTIONS: disable logging smoketest_MPI' '
PERFFLOW_OPTIONS="log-enable=False" mpirun -n 2 ../smoketest_MPI &&
test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -eq 0 &&
if test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -gt 0; then rm -f perfflow.$(hostname).[0-9]*.pfw; fi
'

test_expect_success 'PERFFLOW_OPTIONS: enable logging smoketest_MPI' '
PERFFLOW_OPTIONS="log-enable=True" mpirun -n 2 ../smoketest_MPI &&
test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -eq 2 &&
rm perfflow.$(hostname).[0-9]*.pfw
'
test_expect_success 'PERFFLOW_OPTIONS: enable logging smoketest_MPI' '
PERFFLOW_OPTIONS="log-enable=True" mpirun -n 2 ../smoketest_MPI &&
test `ls -1 perfflow.$(hostname).[0-9]*.pfw 2>/dev/null | wc -l` -eq 2 &&
rm perfflow.$(hostname).[0-9]*.pfw
'
else
say "Skipping MPI smoketests...disabled in the build."
fi

test_expect_success 'PERFFLOW_OPTIONS: use compact format smoketest' '
PERFFLOW_OPTIONS="log-event=compact" ../smoketest &&
Expand Down

0 comments on commit 942ec14

Please sign in to comment.