aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci/run_tests.bat24
-rwxr-xr-xci/run_tests.sh36
2 files changed, 38 insertions, 22 deletions
diff --git a/ci/run_tests.bat b/ci/run_tests.bat
index de45f24..0c0339c 100755
--- a/ci/run_tests.bat
+++ b/ci/run_tests.bat
@@ -14,13 +14,15 @@ fpm test
if errorlevel 1 exit 1
rmdir fpm_scratch_* /s /q
-build\gfortran_debug\app\fpm
+for /f %%i in ('where /r build fpm.exe') do set fpm_path=%%i
+
+%fpm_path%
if errorlevel 1 exit 1
cd ..\example_packages\hello_world
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\hello_world
@@ -30,7 +32,7 @@ if errorlevel 1 exit 1
cd ..\hello_fpm
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\hello_fpm
@@ -40,21 +42,21 @@ if errorlevel 1 exit 1
cd ..\circular_test
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
cd ..\circular_example
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
cd ..\hello_complex
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\say_Hello
@@ -73,7 +75,7 @@ if errorlevel 1 exit 1
cd ..\hello_complex_2
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\say_hello_world
@@ -91,7 +93,7 @@ if errorlevel 1 exit 1
cd ..\auto_discovery_off
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\auto_discovery_off
@@ -108,7 +110,7 @@ if exist .\build\gfortran_debug\test\unused_test exit /B 1
cd ..\with_c
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\with_c
@@ -118,14 +120,14 @@ if errorlevel 1 exit 1
cd ..\submodules
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
cd ..\program_with_module
if errorlevel 1 exit 1
-..\..\fpm\build\gfortran_debug\app\fpm build
+%fpm_path% build
if errorlevel 1 exit 1
.\build\gfortran_debug\app\Program_with_module
diff --git a/ci/run_tests.sh b/ci/run_tests.sh
index 4f293e2..625f37b 100755
--- a/ci/run_tests.sh
+++ b/ci/run_tests.sh
@@ -1,5 +1,17 @@
#!/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
@@ -8,50 +20,52 @@ fpm run
rm -rf fpm_scratch_*/
fpm test
rm -rf fpm_scratch_*/
-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