Skip to content

Commit 6f7ae5b

Browse files
Fix Linux/MacOS CI script
1 parent 55f9d05 commit 6f7ae5b

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

ci/run_tests.sh

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,70 @@
11
#!/bin/bash
22

3+
get_abs_filename() {
4+
# $1 : relative filename
5+
filename=$1
6+
parentdir=$(dirname "${filename}")
7+
8+
if [ -d "${filename}" ]; then
9+
echo "$(cd "${filename}" && pwd)"
10+
elif [ -d "${parentdir}" ]; then
11+
echo "$(cd "${parentdir}" && pwd)/$(basename "${filename}")"
12+
fi
13+
}
14+
315
set -ex
416

517
cd fpm
618
fpm build
719
fpm run
820
fpm test
9-
build/gfortran_debug/app/fpm
21+
22+
f_fpm_path="$(get_abs_filename $(find build -regex 'build/.*/app/fpm'))"
23+
24+
"${f_fpm_path}"
1025

1126
cd ../example_packages/hello_world
12-
../../fpm/build/gfortran_debug/app/fpm build
27+
"${f_fpm_path}" build
1328
./build/gfortran_debug/app/hello_world
1429

1530
cd ../hello_fpm
16-
../../fpm/build/gfortran_debug/app/fpm build
31+
"${f_fpm_path}" build
1732
./build/gfortran_debug/app/hello_fpm
1833

1934
cd ../circular_test
20-
../../fpm/build/gfortran_debug/app/fpm build
35+
"${f_fpm_path}" build
2136

2237
cd ../circular_example
23-
../../fpm/build/gfortran_debug/app/fpm build
38+
"${f_fpm_path}" build
2439

2540
cd ../hello_complex
26-
../../fpm/build/gfortran_debug/app/fpm build
41+
"${f_fpm_path}" build
2742
./build/gfortran_debug/app/say_Hello
2843
./build/gfortran_debug/app/say_goodbye
2944
./build/gfortran_debug/test/greet_test
3045
./build/gfortran_debug/test/farewell_test
3146

3247
cd ../hello_complex_2
33-
../../fpm/build/gfortran_debug/app/fpm build
48+
"${f_fpm_path}" build
3449
./build/gfortran_debug/app/say_hello_world
3550
./build/gfortran_debug/app/say_goodbye
3651
./build/gfortran_debug/test/greet_test
3752
./build/gfortran_debug/test/farewell_test
3853

3954
cd ../auto_discovery_off
40-
../../fpm/build/gfortran_debug/app/fpm build
55+
"${f_fpm_path}" build
4156
./build/gfortran_debug/app/auto_discovery_off
4257
./build/gfortran_debug/test/my_test
4358
test ! -x ./build/gfortran_debug/app/unused
4459
test ! -x ./build/gfortran_debug/test/unused_test
4560

4661
cd ../with_c
47-
../../fpm/build/gfortran_debug/app/fpm build
62+
"${f_fpm_path}" build
4863
./build/gfortran_debug/app/with_c
4964

5065
cd ../submodules
51-
../../fpm/build/gfortran_debug/app/fpm build
66+
"${f_fpm_path}" build
5267

5368
cd ../program_with_module
54-
../../fpm/build/gfortran_debug/app/fpm build
69+
"${f_fpm_path}" build
5570
./build/gfortran_debug/app/Program_with_module
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*

example_packages/with_c/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build/*

0 commit comments

Comments
 (0)