2000-02-17 20:38:33 +01:00
|
|
|
source "site.exp"
|
2000-09-03 05:58:18 +02:00
|
|
|
source "$srcdir/winsup.api/known_bugs.tcl"
|
2000-02-17 20:38:33 +01:00
|
|
|
|
|
|
|
if { ! [isnative] } {
|
|
|
|
verbose "skipping winsup.api because it's not native"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
set rv ""
|
2000-09-03 05:58:18 +02:00
|
|
|
|
|
|
|
set ltp_includes "-I$ltp_includes"
|
|
|
|
set ltp_libs "$rootme/libltp.a"
|
2000-02-17 20:38:33 +01:00
|
|
|
|
2001-10-08 14:18:38 +02:00
|
|
|
set add_includes $ltp_includes
|
|
|
|
set add_libs $ltp_libs
|
|
|
|
|
2001-09-13 21:00:48 +02:00
|
|
|
set test_filter ""
|
|
|
|
|
|
|
|
if { [info exists env(CYGWIN_TESTSUITE_TESTS)] } {
|
|
|
|
set test_filter "$env(CYGWIN_TESTSUITE_TESTS)"
|
|
|
|
}
|
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
proc ws_spawn {cmd args} {
|
|
|
|
global rv
|
|
|
|
verbose "running $cmd\n"
|
2003-02-08 17:46:32 +01:00
|
|
|
catch "exec $cmd" rv
|
2000-02-17 20:38:33 +01:00
|
|
|
verbose send "catchCode = $rv\n"
|
|
|
|
}
|
|
|
|
|
2001-09-13 21:00:48 +02:00
|
|
|
verbose "Filter: $test_filter"
|
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
foreach src [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.c] {
|
2001-09-13 21:00:48 +02:00
|
|
|
if { $test_filter != "" && ! [regexp $test_filter $src] } {
|
|
|
|
verbose -log "Skipping $src"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2000-02-17 20:38:33 +01:00
|
|
|
regsub "^$srcdir/$subdir/" $src "" testcase
|
|
|
|
regsub ".c$" $testcase "" base
|
|
|
|
regsub ".*/" $base "" basename
|
|
|
|
regsub "/" $base "-" base
|
|
|
|
|
2000-09-03 05:58:18 +02:00
|
|
|
if { [lsearch -exact $xfail_list $basename] >= 0 } {
|
|
|
|
set xfail_expected 1
|
2000-02-17 20:38:33 +01:00
|
|
|
setup_xfail "*-*-*"
|
|
|
|
} else {
|
2000-09-03 05:58:18 +02:00
|
|
|
set xfail_expected 0
|
2000-02-17 20:38:33 +01:00
|
|
|
clear_xfail
|
|
|
|
}
|
|
|
|
|
2005-06-10 21:32:29 +02:00
|
|
|
ws_spawn "$CC -nodefaultlibs -mwin32 $CFLAGS $src $add_includes $add_libs $runtime_root/binmode.o -lgcc $runtime_root/libcygwin0.a -lkernel32 -luser32 -o $base.exe"
|
2000-02-17 20:38:33 +01:00
|
|
|
if { $rv != "" } {
|
|
|
|
verbose -log "$rv"
|
|
|
|
fail "$testcase (compile)"
|
|
|
|
} else {
|
2000-09-03 05:58:18 +02:00
|
|
|
if { $verbose } {
|
|
|
|
set redirect_output "./$base.log"
|
|
|
|
} else {
|
|
|
|
set redirect_output /dev/null
|
|
|
|
}
|
2003-01-22 16:18:58 +01:00
|
|
|
ws_spawn "$rootme/cygrun ./$base.exe > $redirect_output"
|
2000-02-17 20:38:33 +01:00
|
|
|
if { $rv != "" } {
|
|
|
|
verbose -log "$testcase: $rv"
|
|
|
|
fail "$testcase (execute)"
|
2000-09-03 05:58:18 +02:00
|
|
|
if { $xfail_expected } {
|
|
|
|
catch { file delete "$base.exe" } err
|
|
|
|
if { $err != "" } {
|
|
|
|
note "error deleting $base.exe: $err"
|
|
|
|
}
|
|
|
|
}
|
2000-02-17 20:38:33 +01:00
|
|
|
} else {
|
|
|
|
pass "$testcase"
|
2001-09-09 15:38:17 +02:00
|
|
|
if { ! $xfail_expected } {
|
|
|
|
catch { file delete "$base.exe" } err
|
|
|
|
if { $err != "" } {
|
|
|
|
note "error deleting $base.exe: $err"
|
|
|
|
}
|
|
|
|
}
|
2000-02-17 20:38:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|