2000-02-18 03:38:33 +08:00
|
|
|
source "site.exp"
|
2000-09-03 11:58:18 +08:00
|
|
|
source "$srcdir/winsup.api/known_bugs.tcl"
|
2000-02-18 03:38:33 +08:00
|
|
|
|
|
|
|
if { ! [isnative] } {
|
|
|
|
verbose "skipping winsup.api because it's not native"
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
set rv ""
|
2000-09-03 11:58:18 +08:00
|
|
|
|
|
|
|
set ltp_includes "-I$ltp_includes"
|
2020-10-06 23:11:54 +08:00
|
|
|
set ltp_libs "$ltp_libs"
|
2000-02-18 03:38:33 +08:00
|
|
|
|
2001-10-08 20:18:38 +08:00
|
|
|
set add_includes $ltp_includes
|
|
|
|
set add_libs $ltp_libs
|
|
|
|
|
2001-09-14 03:00:48 +08:00
|
|
|
set test_filter ""
|
|
|
|
|
2020-10-06 23:11:54 +08:00
|
|
|
set env(PATH) "$runtime_root:$env(PATH)"
|
|
|
|
|
2001-09-14 03:00:48 +08:00
|
|
|
if { [info exists env(CYGWIN_TESTSUITE_TESTS)] } {
|
|
|
|
set test_filter "$env(CYGWIN_TESTSUITE_TESTS)"
|
|
|
|
}
|
|
|
|
|
2020-10-17 07:36:26 +08:00
|
|
|
proc ws_spawn {cmd} {
|
2000-02-18 03:38:33 +08:00
|
|
|
global rv
|
|
|
|
verbose "running $cmd\n"
|
2020-10-17 07:36:26 +08:00
|
|
|
try {
|
|
|
|
set msg [exec -ignorestderr {*}$cmd "2>@1"]
|
|
|
|
set rv 0
|
|
|
|
} trap CHILDSTATUS {results options} {
|
|
|
|
verbose "returned $::errorCode\n"
|
|
|
|
set msg $results
|
|
|
|
set rv 1
|
|
|
|
}
|
|
|
|
verbose -log "$msg"
|
|
|
|
return $rv
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
|
2001-09-14 03:00:48 +08:00
|
|
|
verbose "Filter: $test_filter"
|
|
|
|
|
2006-01-02 14:15:58 +08:00
|
|
|
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.{cc,c}]] {
|
2001-09-14 03:00:48 +08:00
|
|
|
if { $test_filter != "" && ! [regexp $test_filter $src] } {
|
|
|
|
verbose -log "Skipping $src"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
2000-02-18 03:38:33 +08:00
|
|
|
regsub "^$srcdir/$subdir/" $src "" testcase
|
|
|
|
regsub ".c$" $testcase "" base
|
|
|
|
regsub ".*/" $base "" basename
|
|
|
|
regsub "/" $base "-" base
|
|
|
|
|
2000-09-03 11:58:18 +08:00
|
|
|
if { [lsearch -exact $xfail_list $basename] >= 0 } {
|
|
|
|
set xfail_expected 1
|
2000-02-18 03:38:33 +08:00
|
|
|
setup_xfail "*-*-*"
|
|
|
|
} else {
|
2000-09-03 11:58:18 +08:00
|
|
|
set xfail_expected 0
|
2000-02-18 03:38:33 +08:00
|
|
|
clear_xfail
|
|
|
|
}
|
|
|
|
|
2006-01-02 14:15:58 +08:00
|
|
|
if [ file exists "$srcdir/$subdir/$basename.exp" ] then {
|
|
|
|
source "$srcdir/$subdir/$basename.exp"
|
2000-02-18 03:38:33 +08:00
|
|
|
} else {
|
2006-01-02 14:15:58 +08: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"
|
2020-10-17 07:36:26 +08:00
|
|
|
if { $rv } {
|
2006-01-02 14:15:58 +08:00
|
|
|
fail "$testcase (compile)"
|
2000-02-18 03:38:33 +08:00
|
|
|
} else {
|
2006-01-02 14:15:58 +08:00
|
|
|
if { $verbose } {
|
|
|
|
set redirect_output "./$base.log"
|
|
|
|
} else {
|
|
|
|
set redirect_output /dev/null
|
|
|
|
}
|
2020-10-29 22:43:32 +08:00
|
|
|
file mkdir $tmpdir/$base
|
2020-10-06 23:11:54 +08:00
|
|
|
ws_spawn "$cygrun ./$base.exe $testdll_tmpdir/$base > $redirect_output"
|
2020-10-29 22:43:32 +08:00
|
|
|
file delete -force $tmpdir/$base
|
2020-10-17 07:36:26 +08:00
|
|
|
if { $rv } {
|
2006-01-02 14:15:58 +08:00
|
|
|
fail "$testcase (execute)"
|
|
|
|
if { $xfail_expected } {
|
|
|
|
catch { file delete "$base.exe" } err
|
|
|
|
if { $err != "" } {
|
|
|
|
note "error deleting $base.exe: $err"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
pass "$testcase"
|
|
|
|
if { ! $xfail_expected } {
|
|
|
|
catch { file delete "$base.exe" } err
|
|
|
|
if { $err != "" } {
|
|
|
|
note "error deleting $base.exe: $err"
|
|
|
|
}
|
2001-09-09 21:38:17 +08:00
|
|
|
}
|
|
|
|
}
|
2000-02-18 03:38:33 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|