-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest-dolfinx.sh
50 lines (40 loc) · 1.4 KB
/
test-dolfinx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
set -ex
pip check
TEST_DIR=$PWD
# disable clang availability check
if [[ "$target_platform" =~ "osx" ]]; then
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi
export PYTHONUNBUFFERED=1
# test packaging
pytest -vs test_dolfinx.py
# exercise a demo
cd $TEST_DIR/python/demo
pytest -vs -k demo_poisson test.py
# run some tests
cd $TEST_DIR/python/test
# subset of tests should exercise dependencies, solvers, partitioners
if [[ "$target_platform" == "linux-aarch64" || "$target_platform" == "linux-ppc64le" ]]; then
# emulated platforms time out running tests
TESTS="unit/fem/test_fem_pipeline.py::test_P_simplex unit/mesh/test_mesh_partitioners.py"
else
TESTS="unit/fem/test_fem_pipeline.py unit/mesh/test_mesh_partitioners.py"
fi
if [[ "$target_platform" =~ "osx" ]]; then
SELECTOR=''
MPI_SELECTOR=''
else
SELECTOR=''
MPI_SELECTOR="${SELECTOR}"
fi
pytest -vs -k "$SELECTOR" $TESTS
if [[ "${target_platform}-${mpi}" == "linux-aarch64-openmpi" ]]; then
# mpiexec seems to fail on emulated arm with
# ORTE_ERROR_LOG: Out of resource in file util/show_help.c at line 507
# --------------------------------------------------------------------------
# WARNING: Open MPI failed to look up the peer IP address information of
# a TCP connection that it just accepted. This should not happen.
echo "skipping emulated openmpi tests"
else
mpiexec -n 2 pytest -vs -k "$MPI_SELECTOR" $TESTS
fi