Skip to content

Commit 5a70062

Browse files
committed
implement compiler test suite
1 parent c29c016 commit 5a70062

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

test/fpm_test/main.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ program fpm_testing
33
use, intrinsic :: iso_fortran_env, only : error_unit
44
use testsuite, only : run_testsuite, new_testsuite, testsuite_t, select_suite, run_selected
55
use test_toml, only : collect_toml
6+
use test_compiler, only : collect_compiler
67
use test_manifest, only : collect_manifest
78
use test_filesystem, only : collect_filesystem
89
use test_source_parsing, only : collect_source_parsing
@@ -24,6 +25,7 @@ program fpm_testing
2425

2526
suite = [ &
2627
& new_testsuite("fpm_toml", collect_toml), &
28+
& new_testsuite("fpm_compiler", collect_compiler), &
2729
& new_testsuite("fpm_manifest", collect_manifest), &
2830
& new_testsuite("fpm_filesystem", collect_filesystem), &
2931
& new_testsuite("fpm_source_parsing", collect_source_parsing), &

test/fpm_test/test_compiler.f90

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
!> Define tests for the `fpm_compiler` module
2+
module test_compiler
3+
use testsuite, only : new_unittest, unittest_t, error_t, test_failed, &
4+
& check_string
5+
use fpm_environment, only : OS_WINDOWS, OS_LINUX
6+
use fpm_compiler , only : compiler_t
7+
implicit none
8+
private
9+
10+
public :: collect_compiler
11+
12+
13+
contains
14+
15+
!> Collect all exported unit tests
16+
subroutine collect_compiler(testsuite)
17+
!> Collection of tests
18+
type(unittest_t), allocatable, intent(out) :: testsuite(:)
19+
20+
testsuite = [ &
21+
& new_unittest("check-fortran-source-runs", test_check_fortran_source_runs)]
22+
23+
end subroutine collect_compiler
24+
25+
subroutine test_check_fortran_source_runs(error)
26+
!> Error handling
27+
type(error_t), allocatable, intent(out) :: error
28+
29+
30+
end subroutine test_check_fortran_source_runs
31+
32+
33+
end module test_compiler

0 commit comments

Comments
 (0)