aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-03-31 11:45:33 +0200
committerGitHub <noreply@github.com>2021-03-31 11:45:33 +0200
commita4e8d225184f3bb721528e13a6995de0f920e65b (patch)
treef74239f9af67b866ef0921ad26df5b7cd6ef36f6 /ci
parent799fcacee02e60a1679116765c4c3669d31e7201 (diff)
downloadfpm-a4e8d225184f3bb721528e13a6995de0f920e65b.tar.gz
fpm-a4e8d225184f3bb721528e13a6995de0f920e65b.zip
Split workflow for Haskell and Fortran fpm (#419)
Diffstat (limited to 'ci')
-rwxr-xr-xci/run_tests.bat214
-rwxr-xr-xci/run_tests.sh174
2 files changed, 85 insertions, 303 deletions
diff --git a/ci/run_tests.bat b/ci/run_tests.bat
deleted file mode 100755
index e010e9f..0000000
--- a/ci/run_tests.bat
+++ /dev/null
@@ -1,214 +0,0 @@
-@echo on
-
-cd fpm
-if errorlevel 1 exit 1
-
-fpm build %*
-if errorlevel 1 exit 1
-
-fpm run %*
-if errorlevel 1 exit 1
-
-fpm run %* -- --help
-if errorlevel 1 exit 1
-
-fpm run %* -- --version
-if errorlevel 1 exit 1
-
-rmdir fpm_scratch_* /s /q
-fpm test %*
-if errorlevel 1 exit 1
-rmdir fpm_scratch_* /s /q
-
-for /f %%i in ('fpm run %* --runner echo') do set fpm_path=%%i
-echo %fpm_path%
-
-%fpm_path%
-if errorlevel 1 exit 1
-
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% install --prefix "%CD%\_dist" --no-rebuild
-if errorlevel 1 exit 1
-
-cd ..\example_packages\hello_world
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target hello_world
-if errorlevel 1 exit 1
-
-%fpm_path% run
-if errorlevel 1 exit 1
-
-
-cd ..\hello_fpm
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target hello_fpm
-if errorlevel 1 exit 1
-
-
-cd ..\circular_test
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-
-cd ..\circular_example
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-
-cd ..\hello_complex
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% test
-if errorlevel 1 exit 1
-
-%fpm_path% run --target say_Hello
-if errorlevel 1 exit 1
-
-%fpm_path% run --target say_goodbye
-if errorlevel 1 exit 1
-
-%fpm_path% test --target greet_test
-if errorlevel 1 exit 1
-
-%fpm_path% test --target farewell_test
-if errorlevel 1 exit 1
-
-
-cd ..\hello_complex_2
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target say_hello_world
-if errorlevel 1 exit 1
-
-%fpm_path% run --target say_goodbye
-if errorlevel 1 exit 1
-
-%fpm_path% test --target greet_test
-if errorlevel 1 exit 1
-
-%fpm_path% test --target farewell_test
-
-
-cd ..\with_examples
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --example --target demo-prog
-if errorlevel 1 exit 1
-
-%fpm_path% run --target demo-prog
-if errorlevel 1 exit 1
-
-
-cd ..\auto_discovery_off
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target auto_discovery_off
-if errorlevel 1 exit 1
-
-%fpm_path% test --target my_test
-if errorlevel 1 exit 1
-
-if exist .\build\gfortran_*\app\unused exit /B 1
-
-if exist .\build\gfortran_*\test\unused_test exit /B 1
-
-
-cd ..\with_c
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target with_c
-if errorlevel 1 exit 1
-
-
-cd ..\submodules
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-
-cd ..\program_with_module
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target Program_with_module
-if errorlevel 1 exit 1
-
-
-cd ..\link_executable
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-%fpm_path% run --target gomp_test
-if errorlevel 1 exit 1
-
-
-cd ..\fortran_includes
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-
-cd ..\c_includes
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-
-cd ..\c_header_only
-if errorlevel 1 exit 1
-
-del /q /f build
-%fpm_path% build
-if errorlevel 1 exit 1
-
-cd ..\..
diff --git a/ci/run_tests.sh b/ci/run_tests.sh
index 647c57a..ffcd9c2 100755
--- a/ci/run_tests.sh
+++ b/ci/run_tests.sh
@@ -1,102 +1,98 @@
#!/bin/bash
set -ex
-cd $(dirname $0)/../fpm
+cd "$(dirname $0)/.."
-fpm build $@
-
-# Run fpm executable
-fpm run $@
-fpm run $@ -- --version
-fpm run $@ -- --help
-
-# Run tests
-rm -rf fpm_scratch_*/
-fpm test $@
-rm -rf fpm_scratch_*/
-
-f_fpm_path="$(fpm run $@ --runner echo)"
-
-# Let fpm build itself
-"${f_fpm_path}" build
-
-# Install fpm into local directory
-"${f_fpm_path}" install --prefix "$PWD/_dist" --no-rebuild
+if [ "$1" ]; then
+ fpm="$1"
+else
+ fpm=fpm
+fi
# Build example packages
-cd ../example_packages/
+pushd example_packages/
rm -rf ./*/build
-cd hello_world
-
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target hello_world
-"${f_fpm_path}" run
-
-cd ../hello_fpm
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target hello_fpm
-
-cd ../circular_test
-"${f_fpm_path}" build
-
-cd ../circular_example
-"${f_fpm_path}" build
-
-cd ../hello_complex
-"${f_fpm_path}" build
-"${f_fpm_path}" test
-"${f_fpm_path}" run --target say_Hello
-"${f_fpm_path}" run --target say_goodbye
-"${f_fpm_path}" test --target greet_test
-"${f_fpm_path}" test --target farewell_test
-
-cd ../hello_complex_2
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target say_hello_world
-"${f_fpm_path}" run --target say_goodbye
-"${f_fpm_path}" test --target greet_test
-"${f_fpm_path}" test --target farewell_test
-
-cd ../with_examples
-"${f_fpm_path}" build
-"${f_fpm_path}" run --example --target demo-prog
-"${f_fpm_path}" run --target demo-prog
-
-cd ../auto_discovery_off
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target auto_discovery_off
-"${f_fpm_path}" test --target my_test
+pushd hello_world
+"$fpm" build
+"$fpm" run --target hello_world
+"$fpm" run
+popd
+
+pushd hello_fpm
+"$fpm" build
+"$fpm" run --target hello_fpm
+popd
+
+pushd circular_test
+"$fpm" build
+popd
+
+pushd circular_example
+"$fpm" build
+popd
+
+pushd hello_complex
+"$fpm" build
+"$fpm" test
+"$fpm" run --target say_Hello
+"$fpm" run --target say_goodbye
+"$fpm" test --target greet_test
+"$fpm" test --target farewell_test
+popd
+
+pushd hello_complex_2
+"$fpm" build
+"$fpm" run --target say_hello_world
+"$fpm" run --target say_goodbye
+"$fpm" test --target greet_test
+"$fpm" test --target farewell_test
+popd
+
+pushd with_examples
+"$fpm" build
+"$fpm" run --example --target demo-prog
+"$fpm" run --target demo-prog
+popd
+
+pushd auto_discovery_off
+"$fpm" build
+"$fpm" run --target auto_discovery_off
+"$fpm" test --target my_test
test ! -x ./build/gfortran_*/app/unused
test ! -x ./build/gfortran_*/test/unused_test
-
-cd ../with_c
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target with_c
-
-cd ../submodules
-"${f_fpm_path}" build
-
-cd ../program_with_module
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target Program_with_module
-
-cd ../link_external
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target link_external
-
-cd ../link_executable
-"${f_fpm_path}" build
-"${f_fpm_path}" run --target gomp_test
-
-cd ../fortran_includes
-"${f_fpm_path}" build
-
-cd ../c_includes
-"${f_fpm_path}" build
-
-cd ../c_header_only
-"${f_fpm_path}" build
+popd
+
+pushd with_c
+"$fpm" build
+"$fpm" run --target with_c
+popd
+
+pushd submodules
+"$fpm" build
+popd
+
+pushd program_with_module
+"$fpm" build
+"$fpm" run --target Program_with_module
+popd
+
+pushd link_executable
+"$fpm" build
+"$fpm" run --target gomp_test
+popd
+
+pushd fortran_includes
+"$fpm" build
+popd
+
+pushd c_includes
+"$fpm" build
+popd
+
+pushd c_header_only
+"$fpm" build
+popd
# Cleanup
rm -rf ./*/build