Update LOCAL_PATCHES after libsanitizer merge.
[official-gcc.git] / libphobos / testsuite / libphobos.unittests / unittests.exp
blobe68e630873374be05f38f558b47b373496ce2555
1 # Copyright (C) 2017-2018 Free Software Foundation, Inc.
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.
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.
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/>.
17 # Immediately exit if we can't run target executables.
18 if { ![isnative] } {
19 return
22 proc unittest_list_modules { prog } {
23 # Running the test runner without arguments prints a list of all
24 # modules that have unittests compiled in.
25 set result [libphobos_load "$prog" "" ""]
26 return [lindex $result 1]
29 # Runs all unittests for each module compiled into the test program.
30 proc unittest_run_tests { name prog } {
31 foreach module [unittest_list_modules $prog] {
32 set result [libphobos_load "$prog" "$module" ""]
33 set status [lindex $result 0]
34 $status "libphobos.unittests/$name/$module"
38 proc unittester { name prog } {
39 if [file exists $prog] {
40 unittest_run_tests $name $prog
44 # List of test runners.
45 if [is-effective-target static] {
46 unittester "druntime/static" "$objdir/../libdruntime/unittest_static$exeext"
47 unittester "phobos/static" "$objdir/../src/unittest_static$exeext"
50 if [is-effective-target shared] {
51 unittester "druntime/shared" "$objdir/../libdruntime/unittest$exeext"
52 unittester "phobos/shared" "$objdir/../src/unittest$exeext"