Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite/winsup.api/winsup.exp')
-rw-r--r--winsup/testsuite/winsup.api/winsup.exp43
1 files changed, 43 insertions, 0 deletions
diff --git a/winsup/testsuite/winsup.api/winsup.exp b/winsup/testsuite/winsup.api/winsup.exp
new file mode 100644
index 000000000..5c85cc00b
--- /dev/null
+++ b/winsup/testsuite/winsup.api/winsup.exp
@@ -0,0 +1,43 @@
+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"
+ }
+ }
+}