Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / testsuite / lib / passfail.exp
blob2c9abf609eb7480bab302b9346d710e2b2519f3f
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 load_lib newlib.exp
9 # newlib_pass_fail_all compiles and runs all the source files in the
10 # test directory. If flag is -x, then the sources whose basenames are
11 # listed in exclude_list are not compiled and run.
13 proc newlib_pass_fail_all { flag exclude_list } {
14 global srcdir objdir subdir runtests
16 foreach fullsrcfile [glob -nocomplain $srcdir/$subdir/*.c] {
17 set srcfile "[file tail $fullsrcfile]"
18 # If we're only testing specific files and this isn't one of them, skip it.
19 if ![runtest_file_p $runtests $srcfile] then {
20 continue
23 # Exclude tests listed in exclude_list.
24 if { $flag == "-x" } then {
25 if {[lsearch $exclude_list "$srcfile"] != -1} then {
26 continue
29 newlib_pass_fail "$srcfile"
33 # newlib_pass_fail takes the basename of a test source file, which it
34 # compiles and runs.
36 proc newlib_pass_fail { srcfile } {
37 global srcdir tmpdir subdir
39 set fullsrcfile "$srcdir/$subdir/$srcfile"
41 set test_driver "$tmpdir/[file rootname $srcfile].x"
43 set comp_output [newlib_target_compile "$fullsrcfile" "$test_driver" "executable" ""]
45 if { $comp_output != "" } {
46 fail "$subdir/$srcfile compilation"
47 unresolved "$subdir/$srcfile execution"
48 } else {
49 pass "$subdir/$srcfile compilation"
50 set result [newlib_load $test_driver ""]
51 set status [lindex $result 0]
52 $status "$subdir/$srcfile execution"