]> git.ipfire.org Git - thirdparty/gcc.git/blob - libphobos/testsuite/libphobos.cycles/cycles.exp
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / libphobos / testsuite / libphobos.cycles / cycles.exp
1 # Copyright (C) 2017-2018 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 load_lib libphobos-dg.exp
18
19 set dg-output-text [list]
20
21 # Arguments to pass to the test program, expected output, and return code.
22 set cycle_test_list [list \
23 { ignore "" 0 } \
24 { abort "object.Error@.*: Cyclic dependency between module mod. and mod." 1 } \
25 { print "Cyclic dependency between module mod. and mod." 0 } \
26 { deprecate "Deprecation 16211 warning:" 0 } \
27 ]
28
29 # Initialize dg.
30 dg-init
31
32 # Gather a list of all tests.
33 set tests [lsort [find $srcdir/$subdir *.d]]
34
35 # Main loop.
36 foreach cycle_test $cycle_test_list {
37 # The set the argument to pass to the program.
38 set libphobos_run_args "--DRT-oncycle=[lindex $cycle_test 0]"
39
40 # Whether the program is expected to fail.
41 set expected_fail [lindex $cycle_test 2]
42
43 foreach test $tests {
44 set shouldfail $expected_fail
45 dg-test $test "" $DEFAULT_DFLAGS
46 }
47
48 set shouldfail 0
49 set libphobos_run_args ""
50 }
51
52 # All done.
53 dg-finish