Skip to content

Commit ad15859

Browse files
committed
paraview: add simple validation test
This uses ParaView's `Examples` directory to test an installed ParaView. Note that these are only really effective as of 5.11.0-RC2 due to `Examples` having been untested from the top-level prior to this (ParaView runs its example directories individually itself).
1 parent cc2e1e6 commit ad15859

File tree

5 files changed

+94
-0
lines changed

5 files changed

+94
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
paraview-examples/

validation_tests/paraview/clean.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
. ./setup.sh
4+
5+
# Remove the examples resources.
6+
rm -rf build/paraview-examples/
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
#----------------------------------------
6+
# Variables for use later
7+
#----------------------------------------
8+
readonly workdir="build"
9+
paraview_version="$( spack find --format '{version}' "/${PARAVIEW_HASH}" )"
10+
readonly paraview_version
11+
paraview_variants="$( spack find --format '{variants}' "/${PARAVIEW_HASH}" )"
12+
readonly paraview_variants
13+
14+
paraview_has_variant () {
15+
local query="$1"
16+
readonly query
17+
18+
shift
19+
20+
echo "$paraview_variants" | \
21+
grep -q -e "+${query}\>"
22+
}
23+
24+
if paraview_has_variant "shared"; then
25+
paraview_is_shared=true
26+
else
27+
paraview_is_shared=false
28+
fi
29+
readonly paraview_is_shared
30+
31+
#----------------------------------------
32+
# ParaView upstream examples
33+
#----------------------------------------
34+
35+
# First clone ParaView and run its examples.
36+
mkdir -p "$workdir/paraview-examples" # Must be removed in `clean.sh`
37+
pushd "$workdir/paraview-examples"
38+
# We do not need submodules. Also check out the version of ParaView the package
39+
# has to ensure that the examples agree.
40+
git clone --depth 1 -b "v${paraview_version}" https://gitlab.kitware.com/paraview/paraview.git src
41+
42+
paraview_examples_src="$( pwd )/src"
43+
readonly paraview_examples_src
44+
45+
readonly paraview_examples_args=(
46+
"-DCMAKE_PREFIX_PATH=$paraview_ROOT"
47+
"-DBUILD_SHARED_LIBS=$paraview_is_shared"
48+
"$paraview_examples_src/Examples"
49+
)
50+
51+
# Build with Ninja
52+
mkdir build-ninja
53+
pushd build-ninja
54+
cmake -G Ninja "${paraview_examples_args[@]}"
55+
cmake --build .
56+
popd
57+
58+
# Build with Makefiles
59+
mkdir build-make
60+
pushd build-make
61+
cmake -G "Unix Makefiles" "${paraview_examples_args[@]}"
62+
cmake --build .
63+
popd
64+
popd

validation_tests/paraview/run.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
#----------------------------------------
6+
# Variables for use later
7+
#----------------------------------------
8+
readonly workdir="build"
9+
10+
#----------------------------------------
11+
# ParaView upstream examples
12+
#----------------------------------------
13+
ctest --output-on-failure --test-dir "$workdir/paraview-examples/build-ninja"
14+
ctest --output-on-failure --test-dir "$workdir/paraview-examples/build-make"

validation_tests/paraview/setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
. ../../setup.sh
3+
4+
# Actually testing `paraview`
5+
spackLoadUnique [email protected]:
6+
7+
# Also need `cmake`, and `ninja` to build test tests.
8+
spackLoadUnique cmake
9+
spackLoadUnique ninja

0 commit comments

Comments
 (0)