1 # Copyright
(C
) 2002 by Red Hat
, Incorporated. All rights
reserved.
3 # Permission to use
, copy
, modify
, and distribute this software
4 # is freely granted
, provided that this notice is preserved.
7 # newlib_pass_fail_all compiles and runs all the source files in the
8 # test directory.
If flag is
-x
, then the sources whose basenames are
9 # listed in exclude_list are not compiled and run.
11 proc newlib_pass_fail_all
{ flag exclude_list
} {
12 global srcdir objdir subdir runtests
14 foreach fullsrcfile
[glob
-nocomplain $srcdir
/$subdir
/*.c
] {
15 set srcfile
"[file tail $fullsrcfile]"
16 #
If we
're only testing specific files and this isn't one of them
, skip it.
17 if ![runtest_file_p $runtests $srcfile
] then {
21 # Exclude tests listed in exclude_list.
22 if { $flag
== "-x" } then {
23 if {[lsearch $exclude_list
"$srcfile"] != -1} then {
27 newlib_pass_fail
"$srcfile"
31 # newlib_pass_fail takes the basename of a test source file
, which it
34 proc newlib_pass_fail
{ srcfile
} {
35 global srcdir objdir subdir
37 set fullsrcfile
"$srcdir/$subdir/$srcfile"
39 set test_driver
"$objdir/testsuite/[file rootname $srcfile].x"
41 set comp_output
[newlib_target_compile
"$fullsrcfile" "$test_driver" "executable" ""]
43 if { $comp_output
!= "" } {
44 fail
"Failed to compile $fullsrcfile.\n"
46 set result
[newlib_load $test_driver
""]
47 set status [lindex $result
0]
48 $
status "$fullsrcfile"