From b41ea8e08f8525b6bcb93fc6cf68482f7dd3edc0 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Thu, 6 Jun 2024 22:48:19 +0200 Subject: [PATCH 1/7] run all tests with user-specified runner --- src/fpm.f90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fpm.f90 b/src/fpm.f90 index b162ff2827..b6156e3bf3 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -551,9 +551,7 @@ subroutine cmd_run(settings,test) toomany= size(settings%name)==0 .and. size(executables)>1 if ( any(.not.found) & & .or. & - & ( (toomany .and. .not.test) .or. (toomany .and. settings%runner /= '') ) & - & .and. & - & .not.settings%list) then + & (toomany .and. .not.test) .and. .not. settings%list) then line=join(settings%name) if(line/='.')then ! do not report these special strings if(any(.not.found))then From c305d12696a897aea5ca7518a82f2971e2d8155f Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Sun, 9 Jun 2024 08:27:41 +0200 Subject: [PATCH 2/7] do not restrict dumping `available names` to `run` only --- src/fpm.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fpm.f90 b/src/fpm.f90 index b6156e3bf3..b23fee95d6 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -551,7 +551,7 @@ subroutine cmd_run(settings,test) toomany= size(settings%name)==0 .and. size(executables)>1 if ( any(.not.found) & & .or. & - & (toomany .and. .not.test) .and. .not. settings%list) then + & (toomany .and. .not. settings%list) ) then line=join(settings%name) if(line/='.')then ! do not report these special strings if(any(.not.found))then From 6cb9a74aa3afd5af51e11457722da015f65ab6e6 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Thu, 6 Jun 2024 22:48:19 +0200 Subject: [PATCH 3/7] run all tests with user-specified runner --- src/fpm.f90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fpm.f90 b/src/fpm.f90 index b162ff2827..b6156e3bf3 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -551,9 +551,7 @@ subroutine cmd_run(settings,test) toomany= size(settings%name)==0 .and. size(executables)>1 if ( any(.not.found) & & .or. & - & ( (toomany .and. .not.test) .or. (toomany .and. settings%runner /= '') ) & - & .and. & - & .not.settings%list) then + & (toomany .and. .not.test) .and. .not. settings%list) then line=join(settings%name) if(line/='.')then ! do not report these special strings if(any(.not.found))then From 0cf3a9f20eaffaf1117d10732517fd5284d34870 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Mon, 10 Jun 2024 05:46:29 -0500 Subject: [PATCH 4/7] add test --- ci/run_tests.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 0b7fc8e057..01c85891a8 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -81,14 +81,30 @@ do echo "$filename" "$fpm" ${cmdrun[$j]} $filename test -e $filename.txt + # non-i-th tests should not have run for k in ${others[@]} do test ! -e ${targets[$k]}$k.txt done done done + +# Test building all test targets +cmdrun=( "test" "test --runner time" ) +for j in {0..1} +do + rm -f *.txt + "$fpm" ${cmdrun[$j]} + # all tests should have run + for k in ${cases[@]} + do + test -e test$k.txt + done +done + popd + pushd auto_discovery_off "$fpm" build "$fpm" run --target auto_discovery_off From 7b1efc7be26fb4cbf42cfbc436da2822a9f09fa2 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Mon, 10 Jun 2024 07:10:35 -0500 Subject: [PATCH 5/7] do not use `time` in windows --- ci/run_tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 01c85891a8..888111e5e0 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -89,7 +89,8 @@ do done done -# Test building all test targets +# Test building all test targets and with runner +if [[ "$(which time)" ]]; then cmdrun=( "test" "test --runner time" ) for j in {0..1} do @@ -101,6 +102,7 @@ do test -e test$k.txt done done +fi popd From ee2a8b60e43a42c59c27f5185becea3f20cadf47 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Thu, 20 Jun 2024 08:03:31 +0200 Subject: [PATCH 6/7] run/example: run all if name not specified --- src/fpm.f90 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/fpm.f90 b/src/fpm.f90 index b6156e3bf3..561fb4e5e9 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -486,7 +486,6 @@ subroutine cmd_run(settings,test) integer :: run_scope,firsterror integer, allocatable :: stat(:),target_ID(:) character(len=:),allocatable :: line - logical :: toomany call get_package_data(package, "fpm.toml", error, apply_defaults=.true.) if (allocated(error)) then @@ -547,11 +546,8 @@ subroutine cmd_run(settings,test) end if ! Check all names are valid - ! or no name and found more than one file - toomany= size(settings%name)==0 .and. size(executables)>1 - if ( any(.not.found) & - & .or. & - & (toomany .and. .not.test) .and. .not. settings%list) then + ! or no name and found more than one file + if ( any(.not.found) ) then line=join(settings%name) if(line/='.')then ! do not report these special strings if(any(.not.found))then From c30932274e7178ce415a980fd9f9572b9c590188 Mon Sep 17 00:00:00 2001 From: Federico Perini Date: Thu, 20 Jun 2024 08:08:48 +0200 Subject: [PATCH 7/7] test default runs --- ci/run_tests.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 888111e5e0..c1abbb5e7f 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -89,21 +89,25 @@ do done done -# Test building all test targets and with runner +# Test building all targets and with runner if [[ "$(which time)" ]]; then -cmdrun=( "test" "test --runner time" ) -for j in {0..1} +targets=( "run" "run --example" "test" ) +names=( "run" "example" "test" ) +cmdrun=( " " " --runner time" ) +for j in {0..2} do - rm -f *.txt - "$fpm" ${cmdrun[$j]} - # all tests should have run - for k in ${cases[@]} + for i in {0..1} do - test -e test$k.txt + rm -f *.txt + "$fpm" ${targets[$j]}${cmdrun[$i]} + # all targets should have run + for k in ${cases[@]} + do + test -e ${names[$j]}$k.txt + done done done fi - popd