Debian Codegraph @

gcc/testsuite/cobol.dg/dg.exp

raw
1 # Copyright (C) 2004-2025 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with GCC; see the file COPYING3. If not see
15 # <http://www.gnu.org/licenses/>.
16
17 # GCC testsuite that uses the `dg.exp' driver.
18
19 # Load support procs.
20 load_lib cobol-dg.exp
21
22 # If a testcase doesn't have special options, use these.
23 global DEFAULT_COBFLAGS
24 if ![info exists DEFAULT_COBFLAGS] then {
25 set DEFAULT_COBFLAGS " "
26 }
27
28 # Initialize `dg'.
29 dg-init
30
31 global cobol_test_path
32 set cobol_test_path $srcdir/$subdir
33
34 set all_flags $DEFAULT_COBFLAGS
35
36 # Recursively find files in $dir and subdirs, do not walk into subdirs
37 # that contain their own .exp file.
38 proc find-cob-tests { dir suffix } {
39 set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]]
40 foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] {
41 if { [glob -nocomplain -directory $subdir *.exp] eq "" } {
42 eval lappend tests [find-cob-tests $subdir $suffix]
43 }
44 }
45 return $tests
46 }
47
48 set tests [find-cob-tests $srcdir/$subdir {cob}]
49
50 # Main loop.
51 if [check_effective_target_cobol] {
52 cobol-dg-runtest $tests "" $all_flags
53 }
54
55 # All done.
56 dg-finish