Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Nov 13, 2024
1 parent 11e0e35 commit 6e501d8
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
11 changes: 4 additions & 7 deletions recipes/fortuno/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ cmake_options=(
"-DFORTUNO_WITH_MPI=${MPI}"
)

mkdir -p _build
pushd _build

FFLAGS="-fno-backtrace" cmake "${cmake_options[@]}" -GNinja ..
ninja all install

popd
BUILD_DIR="_build"
FFLAGS="-fno-backtrace" cmake "${cmake_options[@]}" -GNinja -B ${BUILD_DIR}
cmake --build ${BUILD_DIR}
cmake --install ${BUILD_DIR}
4 changes: 4 additions & 0 deletions recipes/fortuno/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ requirements:

test:
requires:
- {{ compiler('fortran') }}
- {{ stdlib('c') }}
- cmake
- ninja
- pkg-config
commands:
- pkg-config fortuno --exact-version={{ version }}
Expand Down
19 changes: 19 additions & 0 deletions recipes/fortuno/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -ex

INTERFACES=( "serial" )
if [ "${mpi}" != "nompi" ]; then
INTERFACES+=( "mpi" )
fi

cmake_options=( ${CMAKE_ARGS} )
for interface in ${INTERFACES[@]}; do
RUNNER=""
if [[ "${interface}" == "mpi" ]]; then
RUNNER="mpirun -np 2"
fi
BUILD_DIR="_build_${interface}"
cmake "${cmake_options[@]}" -GNinja -B ${BUILD_DIR}
cmake --build ${BUILD_DIR}
${RUNNER} ${BUILD_DIR}/app/testapp
done

0 comments on commit 6e501d8

Please sign in to comment.