-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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).
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
paraview-examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
. ./setup.sh | ||
|
||
# Remove the examples resources. | ||
rm -rf build/paraview-examples/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
#---------------------------------------- | ||
# Variables for use later | ||
#---------------------------------------- | ||
readonly workdir="build" | ||
paraview_version="$( spack find --format '{version}' "/${PARAVIEW_HASH}" )" | ||
readonly paraview_version | ||
paraview_variants="$( spack find --format '{variants}' "/${PARAVIEW_HASH}" )" | ||
readonly paraview_variants | ||
|
||
paraview_has_variant () { | ||
local query="$1" | ||
readonly query | ||
|
||
shift | ||
|
||
echo "$paraview_variants" | \ | ||
grep -q -e "+${query}\>" | ||
} | ||
|
||
if paraview_has_variant "shared"; then | ||
paraview_is_shared=true | ||
else | ||
paraview_is_shared=false | ||
fi | ||
readonly paraview_is_shared | ||
|
||
#---------------------------------------- | ||
# ParaView upstream examples | ||
#---------------------------------------- | ||
|
||
# First clone ParaView and run its examples. | ||
mkdir -p "$workdir/paraview-examples" # Must be removed in `clean.sh` | ||
pushd "$workdir/paraview-examples" | ||
# We do not need submodules. Also check out the version of ParaView the package | ||
# has to ensure that the examples agree. | ||
git clone --depth 1 -b "v${paraview_version}" https://gitlab.kitware.com/paraview/paraview.git src | ||
|
||
paraview_examples_src="$( pwd )/src" | ||
readonly paraview_examples_src | ||
|
||
readonly paraview_examples_args=( | ||
"-DCMAKE_PREFIX_PATH=$paraview_ROOT" | ||
"-DBUILD_SHARED_LIBS=$paraview_is_shared" | ||
"$paraview_examples_src/Examples" | ||
) | ||
|
||
# Build with Ninja | ||
mkdir build-ninja | ||
pushd build-ninja | ||
cmake -G Ninja "${paraview_examples_args[@]}" | ||
cmake --build . | ||
popd | ||
|
||
# Build with Makefiles | ||
mkdir build-make | ||
pushd build-make | ||
cmake -G "Unix Makefiles" "${paraview_examples_args[@]}" | ||
cmake --build . | ||
popd | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
#---------------------------------------- | ||
# Variables for use later | ||
#---------------------------------------- | ||
readonly workdir="build" | ||
|
||
#---------------------------------------- | ||
# ParaView upstream examples | ||
#---------------------------------------- | ||
ctest --output-on-failure --test-dir "$workdir/paraview-examples/build-ninja" | ||
ctest --output-on-failure --test-dir "$workdir/paraview-examples/build-make" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
. ../../setup.sh | ||
|
||
# Actually testing `paraview` | ||
spackLoadUnique [email protected]: | ||
|
||
# Also need `cmake`, and `ninja` to build test tests. | ||
spackLoadUnique cmake | ||
spackLoadUnique ninja |