mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 04:49:25 +08:00
daeeaa97b3
Build all the testcase executables directly using automake, rather than passing the compiler information into DejaGnu to have it build them. (This means you get build avoidance for these executables, so they only get built once, rather than every time you run the test, and makes it much easier to run them in isolatation against the installed Cygwin, which is really nice to have when trying to fix broken tests...) Rename the 'cygrun' subdirectory to 'mingw', and build all the testsuite MinGW executables there. Drop sample-miscompile.c (testing that compile failure is detected is perhaps useful, but not here...)
77 lines
1.7 KiB
Plaintext
77 lines
1.7 KiB
Plaintext
source "site.exp"
|
|
source "$srcdir/winsup.api/known_bugs.tcl"
|
|
|
|
if { ! [isnative] } {
|
|
verbose "skipping winsup.api because it's not native"
|
|
return
|
|
}
|
|
|
|
set rv ""
|
|
|
|
set orig_path "$env(PATH)"
|
|
|
|
set test_filter ""
|
|
|
|
if { [info exists env(CYGWIN_TESTSUITE_TESTS)] } {
|
|
set test_filter "$env(CYGWIN_TESTSUITE_TESTS)"
|
|
}
|
|
|
|
proc ws_spawn {cmd} {
|
|
global rv
|
|
verbose "running $cmd\n"
|
|
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
|
|
}
|
|
|
|
verbose "Filter: $test_filter"
|
|
|
|
foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/$subdir/*/*.{cc,c}]] {
|
|
if { $test_filter != "" && ! [regexp $test_filter $src] } {
|
|
verbose -log "Skipping $src"
|
|
continue
|
|
}
|
|
|
|
regsub "^$srcdir/$subdir/" $src "" testcase
|
|
regsub ".c$" $testcase "" base
|
|
regsub ".*/" $base "" basename
|
|
regsub "/" $base "-" tmpfile
|
|
|
|
set exec "./winsup.api/$base.exe"
|
|
|
|
if { [lsearch -exact $xfail_list $basename] >= 0 } {
|
|
set xfail_expected 1
|
|
setup_xfail "*-*-*"
|
|
} else {
|
|
set xfail_expected 0
|
|
clear_xfail
|
|
}
|
|
|
|
if [ file exists "$srcdir/$subdir/$basename.exp" ] then {
|
|
source "$srcdir/$subdir/$basename.exp"
|
|
} else {
|
|
if { $verbose } {
|
|
set redirect_output "./$tmpfile.log"
|
|
} else {
|
|
set redirect_output /dev/null
|
|
}
|
|
file mkdir $tmpdir/$tmpfile
|
|
set env(PATH) "$runtime_root:$env(PATH)"
|
|
ws_spawn "$cygrun $exec $testdll_tmpdir/$tmpfile > $redirect_output"
|
|
file delete -force $tmpdir/$tmpfile
|
|
set env(PATH) "$orig_path"
|
|
if { $rv } {
|
|
fail "$testcase"
|
|
} else {
|
|
pass "$testcase"
|
|
}
|
|
}
|
|
}
|