diff --git a/validation_tests/paraview/build/.gitignore b/validation_tests/paraview/build/.gitignore new file mode 100644 index 00000000..34d65527 --- /dev/null +++ b/validation_tests/paraview/build/.gitignore @@ -0,0 +1 @@ +paraview-examples/ diff --git a/validation_tests/paraview/clean.sh b/validation_tests/paraview/clean.sh new file mode 100755 index 00000000..4b2476e1 --- /dev/null +++ b/validation_tests/paraview/clean.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +. ./setup.sh + +# Remove the examples resources. +rm -rf build/paraview-examples/ diff --git a/validation_tests/paraview/compile.sh b/validation_tests/paraview/compile.sh new file mode 100755 index 00000000..cb840b06 --- /dev/null +++ b/validation_tests/paraview/compile.sh @@ -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 diff --git a/validation_tests/paraview/run.sh b/validation_tests/paraview/run.sh new file mode 100755 index 00000000..1560d4e9 --- /dev/null +++ b/validation_tests/paraview/run.sh @@ -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" diff --git a/validation_tests/paraview/setup.sh b/validation_tests/paraview/setup.sh new file mode 100644 index 00000000..a7d0d8c0 --- /dev/null +++ b/validation_tests/paraview/setup.sh @@ -0,0 +1,9 @@ +#!/bin/bash +. ../../setup.sh + +# Actually testing `paraview` +spackLoadUnique paraview + +# Also need `cmake`, and `ninja` to build test tests. +spackLoadUnique cmake +spackLoadUnique ninja