From 6f7ae5b6f1b45a4d8c12dfca2d188f316efe993b Mon Sep 17 00:00:00 2001 From: Brad Richardson Date: Wed, 28 Oct 2020 10:17:03 -0500 Subject: Fix Linux/MacOS CI script --- ci/run_tests.sh | 37 +++++++++++++++++-------- example_packages/auto_discovery_off/.gitignore | 1 + example_packages/program_with_module/.gitignore | 1 + example_packages/with_c/.gitignore | 1 + 4 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 example_packages/auto_discovery_off/.gitignore create mode 100644 example_packages/program_with_module/.gitignore create mode 100644 example_packages/with_c/.gitignore diff --git a/ci/run_tests.sh b/ci/run_tests.sh index a42653b..df7fb24 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -1,55 +1,70 @@ #!/bin/bash +get_abs_filename() { + # $1 : relative filename + filename=$1 + parentdir=$(dirname "${filename}") + + if [ -d "${filename}" ]; then + echo "$(cd "${filename}" && pwd)" + elif [ -d "${parentdir}" ]; then + echo "$(cd "${parentdir}" && pwd)/$(basename "${filename}")" + fi +} + set -ex cd fpm fpm build fpm run fpm test -build/gfortran_debug/app/fpm + +f_fpm_path="$(get_abs_filename $(find build -regex 'build/.*/app/fpm'))" + +"${f_fpm_path}" cd ../example_packages/hello_world -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/hello_world cd ../hello_fpm -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/hello_fpm cd ../circular_test -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build cd ../circular_example -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build cd ../hello_complex -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/say_Hello ./build/gfortran_debug/app/say_goodbye ./build/gfortran_debug/test/greet_test ./build/gfortran_debug/test/farewell_test cd ../hello_complex_2 -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/say_hello_world ./build/gfortran_debug/app/say_goodbye ./build/gfortran_debug/test/greet_test ./build/gfortran_debug/test/farewell_test cd ../auto_discovery_off -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/auto_discovery_off ./build/gfortran_debug/test/my_test test ! -x ./build/gfortran_debug/app/unused test ! -x ./build/gfortran_debug/test/unused_test cd ../with_c -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/with_c cd ../submodules -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build cd ../program_with_module -../../fpm/build/gfortran_debug/app/fpm build +"${f_fpm_path}" build ./build/gfortran_debug/app/Program_with_module diff --git a/example_packages/auto_discovery_off/.gitignore b/example_packages/auto_discovery_off/.gitignore new file mode 100644 index 0000000..a007fea --- /dev/null +++ b/example_packages/auto_discovery_off/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/example_packages/program_with_module/.gitignore b/example_packages/program_with_module/.gitignore new file mode 100644 index 0000000..a007fea --- /dev/null +++ b/example_packages/program_with_module/.gitignore @@ -0,0 +1 @@ +build/* diff --git a/example_packages/with_c/.gitignore b/example_packages/with_c/.gitignore new file mode 100644 index 0000000..a007fea --- /dev/null +++ b/example_packages/with_c/.gitignore @@ -0,0 +1 @@ +build/* -- cgit v1.2.3