Browse Source
A more sophisticated (and modern) test harness would probably be useful, but switching to Automake's built-in test harness gets us parallel test execution, colourization of failures, simplifies matters, seems adequate for the current testuite, and means we don't need to write any icky Tcl. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>users/vapier/wip
10 changed files with 47 additions and 149 deletions
@ -1,13 +0,0 @@ |
|||
proc winsup_version {} { |
|||
global env |
|||
global runtime_root |
|||
clone_output "\n[exec grep -a ^%%% $runtime_root/cygwin1.dll]\n" |
|||
if { [info exists env(CYGWIN)] } { |
|||
clone_output "CYGWIN=$env(CYGWIN)\n" |
|||
} else { |
|||
clone_output "CYGWIN=\n" |
|||
} |
|||
} |
|||
|
|||
proc winsup_exit {} { |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
#!/bin/dash |
|||
# |
|||
# test driver to run $1 in the appropriate environment |
|||
# |
|||
|
|||
# $1 = test executable to run |
|||
exe=$1 |
|||
|
|||
export PATH="$runtime_root:${PATH}" |
|||
|
|||
if [ "$1" = "./mingw/cygload" ] |
|||
then |
|||
windows_runtime_root=$(cygpath -m $runtime_root) |
|||
$exe -v -cygwin $windows_runtime_root/cygwin1.dll |
|||
else |
|||
cygdrop $cygrun $exe |
|||
fi |
|||
@ -1,30 +0,0 @@ |
|||
source "site.exp" |
|||
|
|||
if { ! [isnative] } { |
|||
verbose "skipping cygload because it's not native \"$target_triplet\" != \"$build_triplet\"" |
|||
return |
|||
} |
|||
|
|||
proc ws_spawn {cmd args} { |
|||
global rv |
|||
verbose "running $cmd\n" |
|||
set rv {} |
|||
# First item in rv is the return code, second item is the message |
|||
lappend rv [catch "exec $cmd" message] $message |
|||
verbose send "catchCode = $rv\n" |
|||
} |
|||
|
|||
if { $verbose } { |
|||
set redirect_output "./mingw-cygwin.log" |
|||
} else { |
|||
set redirect_output /dev/null |
|||
} |
|||
|
|||
set windows_runtime_root [exec cygpath -m $runtime_root] |
|||
ws_spawn "./mingw/cygload.exe -cygwin $windows_runtime_root/cygwin1.dll > $redirect_output" |
|||
if { $rv != {0 {}} } { |
|||
verbose -log "cygload: $rv" |
|||
fail "cygload" |
|||
} else { |
|||
pass "cygload" |
|||
} |
|||
@ -1,4 +0,0 @@ |
|||
set xfail_list [list \ |
|||
setgroups01 setuid02 \ |
|||
ulimit01 unlink08 \ |
|||
sample-fail sample-miscompile] |
|||
@ -1,74 +0,0 @@ |
|||
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 |
|||
} |
|||
set env(PATH) "$runtime_root:$env(PATH)" |
|||
ws_spawn "cygdrop $cygrun $exec > $redirect_output" |
|||
set env(PATH) "$orig_path" |
|||
if { $rv } { |
|||
fail "$testcase" |
|||
} else { |
|||
pass "$testcase" |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue