aboutsummaryrefslogtreecommitdiff
path: root/ci/run_tests.sh
diff options
context:
space:
mode:
authorLaurence Kedward <laurence.kedward@bristol.ac.uk>2020-12-01 16:10:43 +0000
committerGitHub <noreply@github.com>2020-12-01 16:10:43 +0000
commit89198af9fb7a8ab0298d6c69a18846afcbabd14a (patch)
tree04a9a956529f77c3b28af15979dcdcdc2ba476af /ci/run_tests.sh
parenteb3f7993dea77a4862701a97d06ba1aea8d23529 (diff)
parentcbd75552604ac119211534a5d4b7fd79f18e7786 (diff)
downloadfpm-89198af9fb7a8ab0298d6c69a18846afcbabd14a.tar.gz
fpm-89198af9fb7a8ab0298d6c69a18846afcbabd14a.zip
Merge pull request #260 from LKedward/fix-release-testing
Fix CI to test release build
Diffstat (limited to 'ci/run_tests.sh')
-rwxr-xr-xci/run_tests.sh35
1 files changed, 17 insertions, 18 deletions
diff --git a/ci/run_tests.sh b/ci/run_tests.sh
index 894b1f0..3588012 100755
--- a/ci/run_tests.sh
+++ b/ci/run_tests.sh
@@ -1,30 +1,26 @@
#!/bin/bash
+set -ex
-get_abs_filename() {
- # $1 : relative filename
- filename=$1
- parentdir=$(dirname "${filename}")
+cd $(dirname $0)/../fpm
- if [ -d "${filename}" ]; then
- echo "$(cd "${filename}" && pwd)"
- elif [ -d "${parentdir}" ]; then
- echo "$(cd "${parentdir}" && pwd)/$(basename "${filename}")"
- fi
-}
+fpm build $@
-set -ex
+# Run fpm executable
+fpm run $@
+fpm run $@ -- --version
+fpm run $@ -- --help
-cd fpm
-fpm build
-fpm run
+# Run tests
rm -rf fpm_scratch_*/
-fpm test
+fpm test $@
rm -rf fpm_scratch_*/
-f_fpm_path="$(get_abs_filename $(find build -regex 'build/.*/app/fpm'))"
-"${f_fpm_path}"
+# Build example packages
+f_fpm_path="$(fpm run $@ --runner echo)"
+cd ../example_packages/
+rm -rf ./*/build
-cd ../example_packages/hello_world
+cd hello_world
"${f_fpm_path}" build
./build/gfortran_debug/app/hello_world
@@ -77,3 +73,6 @@ cd ../link_external
cd ../link_executable
"${f_fpm_path}" build
./build/gfortran_debug/app/gomp_test
+
+# Cleanup
+rm -rf ./*/build \ No newline at end of file