newlib-cygwin/winsup/cygwin/testsuite/winsup.api/winsup.exp

44 lines
935 B
Plaintext

source "site.exp"
if { ! [isnative] } {
verbose "skipping winsup.api because it's not native"
return
}
set rv ""
proc ws_spawn {cmd args} {
global rv
verbose "running $cmd\n"
catch [eval "exec $cmd"] rv
verbose send "catchCode = $rv\n"
}
foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
regsub "^$srcdir/$subdir/" $src "" testcase
regsub ".c$" $testcase "" base
regsub ".*/" $base "" basename
regsub "/" $base "-" base
if { [regexp "^xf-" $basename] } {
setup_xfail "*-*-*"
} else {
clear_xfail
}
ws_spawn "$CC $src $rootme/new-libcygwin.a -o $base.exe"
if { $rv != "" } {
verbose -log "$rv"
fail "$testcase (compile)"
} else {
ws_spawn "../cygrun ./$base.exe"
if { $rv != "" } {
verbose -log "$testcase: $rv"
fail "$testcase (execute)"
} else {
pass "$testcase"
file delete "$base.exe"
}
}
}