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

winsup.exp « winsup.api « testsuite « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 111509511b8b5e6e5e52a2136fd26b28b8e8891a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 "cygdrop $cygrun $exec $testdll_tmpdir/$tmpfile > $redirect_output"
	    file delete -force $tmpdir/$tmpfile
	    set env(PATH) "$orig_path"
	    if { $rv } {
		fail "$testcase"
	    } else {
		pass "$testcase"
	    }
    }
}