| # Copyright (C) 2019-2026 Free Software Foundation, Inc. | |
| # | |
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # | |
| # You should have received a copy of the GNU General Public License | |
| # along with GCC; see the file COPYING3. If not see | |
| # <http://www.gnu.org/licenses/>. | |
| # Immediately exit if we can't run target executables. | |
| if { ![isnative] } { | |
| return | |
| } | |
| # Skip running test if phobos was not built on the target. | |
| if { ![is-effective-target d_runtime_has_std_library] } { | |
| return | |
| } | |
| # Gather a list of all tests. | |
| set tests [lsort [find $srcdir/$subdir *.d]] | |
| set version_flags "-fversion=StdUnittest" | |
| if { [is-effective-target linux_pre_2639] } { | |
| lappend version_flags "-fversion=Linux_Pre_2639" | |
| } | |
| set libphobos_skip_tests { | |
| # Skip concurrency.d test: SEGVs or hangs on macOS 13+ (PR d/111628). | |
| { libphobos.phobos/std_concurrency.d { x86_64-apple-darwin2[2-9]* } } | |
| # Skip math/hardware.d if missing necessary support (PR d/123202). | |
| { libphobos.phobos/std_math_hardware.d { ! phobos_ieee_flags_support } } | |
| } | |
| # Initialize dg. | |
| dg-init | |
| # Main loop. | |
| foreach test $tests { | |
| dg-runtest $test "" "-Wno-deprecated -fmain $version_flags" | |
| } | |
| # All done. | |
| dg-finish |