Skip to content

Commit c6e45a4

Browse files
robertodrstigrj
authored andcommitted
Simplify CI of examples
1 parent dc12716 commit c6e45a4

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.ci/example.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu -o pipefail
4+
5+
example=$1
6+
lang="${example/_*/}"
7+
var=${lang}_COMPILER
8+
compiler=${var}
9+
echo "-- Running example $example"
10+
(
11+
cd examples/"$example"
12+
cmake -H. -Bbuild -DXCFun_DIR="$HOME"/Software/xcfun/share/cmake/XCFun -DCMAKE_"${lang}"_COMPILER="${!compiler}"
13+
cmake --build build
14+
cd build
15+
ctest
16+
)
17+
echo "-- Done with example $example"

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ script:
126126
- ctest --output-on-failure --verbose --parallel 2
127127
# Check that Python bindings are usable from install prefix
128128
- env PYTHONPATH=$HOME/Software/xcfun/lib/python:$PYTHONPATH python -c 'import xcfun; print(xcfun.xcfun_splash())'
129+
- cd -
130+
# Build C++ example
131+
- bash .ci/example.sh CXX_host
129132

130133
after_success:
131134
- |

0 commit comments

Comments
 (0)