Skip to content

Commit ad02416

Browse files
committed
Add: test package with auto-discovery disabled
Contains an app and a test that should be ignored by auto-discovery - this is checked in the CI scripts.
1 parent 1d0c99e commit ad02416

File tree

9 files changed

+62
-2
lines changed

9 files changed

+62
-2
lines changed

ci/run_tests.bat

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ if errorlevel 1 exit 1
6262
.\build\gfortran_debug\test\farewell_test
6363

6464

65+
cd ..\auto_discovery_off
66+
if errorlevel 1 exit 1
67+
68+
..\..\..\fpm\build\gfortran_debug\app\fpm build
69+
if errorlevel 1 exit 1
70+
71+
.\build\gfortran_debug\app\auto_discovery_off
72+
if errorlevel 1 exit 1
73+
74+
.\build\gfortran_debug\test\my_test
75+
if errorlevel 1 exit 1
76+
77+
if exist .\build\gfortran_debug\app\unused exit /B 1
78+
79+
if exist .\build\gfortran_debug\test\unused_test exit /B 1
80+
81+
6582
cd ..\with_c
6683
if errorlevel 1 exit 1
6784

ci/run_tests.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ cd ../hello_complex_2
2626
./build/gfortran_debug/test/greet_test
2727
./build/gfortran_debug/test/farewell_test
2828

29+
cd ../auto_discovery_off
30+
../../../fpm/build/gfortran_debug/app/fpm build
31+
./build/gfortran_debug/app/auto_discovery_off
32+
./build/gfortran_debug/test/my_test
33+
test ! -x ./build/gfortran_debug/app/unused
34+
test ! -x ./build/gfortran_debug/test/unused_test
35+
2936
cd ../with_c
3037
../../../fpm/build/gfortran_debug/app/fpm build
3138
./build/gfortran_debug/app/with_c

fpm/src/fpm.f90

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ subroutine cmd_build(settings)
121121
error stop 1
122122
end if
123123

124-
call package%info(stdout,10)
125-
126124
! Populate default build configuration if not included
127125
if (.not.allocated(package%build_config)) then
128126
allocate(package%build_config)

test/example_packages/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ the features demonstrated in each package and which versions of fpm are supporte
66

77
| Name | Features | Bootstrap (Haskell) fpm | fpm |
88
|---------------------|---------------------------------------------------------------|:-----------------------:|:---:|
9+
| auto_discovery_off | Default layout with auto-discovery disabled | N | Y |
910
| circular_example | Local path dependency; circular dependency | Y | N |
1011
| circular_test | Local path dependency; circular dependency | Y | N |
1112
| hello_complex | Non-standard directory layout; multiple tests and executables | Y | Y |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
program main
2+
implicit none
3+
4+
print *, "This program should run."
5+
6+
end program main
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
program unused
2+
implicit none
3+
4+
print *, "This program should NOT run."
5+
6+
end program unused
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = "auto_discovery_off"
2+
3+
[build]
4+
auto-executables = false
5+
auto-tests = false
6+
7+
8+
[[test]]
9+
name = "my_test"
10+
source-dir="test"
11+
main="my_test.f90"
12+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
program my_test
2+
implicit none
3+
4+
print *, "Test passed! That was easy!"
5+
6+
end program my_test
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
program unused_test
2+
implicit none
3+
4+
print *, "This program should NOT run."
5+
6+
end program unused_test
7+

0 commit comments

Comments
 (0)