1 1.1.1.3 mrg # Copyright (C) 2019-2022 Free Software Foundation, Inc. 2 1.1 mrg # 3 1.1 mrg # This program is free software; you can redistribute it and/or modify 4 1.1 mrg # it under the terms of the GNU General Public License as published by 5 1.1 mrg # the Free Software Foundation; either version 3 of the License, or 6 1.1 mrg # (at your option) any later version. 7 1.1 mrg # 8 1.1 mrg # This program is distributed in the hope that it will be useful, 9 1.1 mrg # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 1.1 mrg # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 1.1 mrg # GNU General Public License for more details. 12 1.1 mrg # 13 1.1 mrg # You should have received a copy of the GNU General Public License 14 1.1 mrg # along with GCC; see the file COPYING3. If not see 15 1.1 mrg # <http://www.gnu.org/licenses/>. 16 1.1 mrg 17 1.1 mrg # Immediately exit if we can't run target executables. 18 1.1.1.3 mrg if { ![isnative] } { 19 1.1 mrg return 20 1.1 mrg } 21 1.1 mrg 22 1.1.1.2 mrg # Skip running test if phobos was not built on the target. 23 1.1.1.2 mrg if { ![is-effective-target d_runtime_has_std_library] } { 24 1.1.1.2 mrg return 25 1.1.1.2 mrg } 26 1.1.1.2 mrg 27 1.1 mrg # Gather a list of all tests. 28 1.1 mrg set tests [lsort [filter_libphobos_unittests [find $srcdir/../src "*.d"]]] 29 1.1 mrg 30 1.1.1.3 mrg set version_flags "-fversion=StdUnittest" 31 1.1.1.3 mrg 32 1.1.1.3 mrg if { [is-effective-target linux_pre_2639] } { 33 1.1.1.3 mrg lappend version_flags "-fversion=Linux_Pre_2639" 34 1.1.1.3 mrg } 35 1.1.1.3 mrg 36 1.1 mrg set libphobos_skip_tests { 37 1.1 mrg # Skip curl tests if library is not available 38 1.1 mrg { libphobos.phobos/etc/c/curl.d { ! libcurl_available } } 39 1.1 mrg { libphobos.phobos/std/net/curl.d { ! libcurl_available } } 40 1.1 mrg } 41 1.1 mrg 42 1.1 mrg # Initialize dg. 43 1.1 mrg dg-init 44 1.1 mrg 45 1.1 mrg # Main loop. 46 1.1 mrg foreach test $tests { 47 1.1 mrg set libphobos_test_name "$subdir/[dg-trim-dirname $srcdir/../src $test]" 48 1.1.1.3 mrg dg-runtest $test "-static-libphobos" \ 49 1.1.1.3 mrg "-fmain -fbuilding-libphobos-tests $version_flags" 50 1.1 mrg set libphobos_test_name "" 51 1.1 mrg } 52 1.1 mrg 53 1.1 mrg # All done. 54 1.1 mrg dg-finish 55