aboutsummaryrefslogtreecommitdiff
path: root/contrib/bluegnu2.0.3/testsuite/bluegnu.all/libs.exp
blob: 77f96b528a30d4ec3ca165ca4271baa8e8216913 (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
load_lib libsup.exp

proc process_test { test } {
    global srcdir
    global subdir
    global objdir
    global EXPECT

    verbose "Executing test case $test"
    set text "\[- A-Za-z0-9\,\.\;\"\_\:\'\`\(\)\!\#\=\+\?\&\*]*"

    set timeout 150

    if [file exists $test] {
	verbose "Processing test $test" 2
	spawn -open  [open "|$EXPECT $test $srcdir $subdir [pwd]" r]
	expect {
	    "No such file or directory" {
		perror "$test wouldn't run" 0
	    }
	    -re "\[\r\n\]*NOTSUPPORTED: $text\[\r\n\]*" {
		unsupported "[lrange $expect_out(0,string) 1 end]"
		exp_continue
	    }
	    -re "\[\r\n\]*NOTTESTED: $text\[\r\n\]*" {
		untested "[lrange $expect_out(0,string) 1 end]"
		exp_continue
	    }
	    -re "\[\r\n\]*PASSED: $text\[\r\n\]*" {
		pass "[lrange $expect_out(0,string) 1 end]"
		exp_continue
	    }
	    -re "\[\r\n\]*FAILED: $text\[\r\n\]*" {
		fail "[lrange $expect_out(0,string) 1 end]"
		exp_continue
	    }
	    -re "\[\r\n\]*WARNED: $text\[\r\n\]*" {
		verbose "$expect_out(0,string)" 2
		exp_continue
	    }
	    -re "\[\r\n\]*ERRORED: $text\[\r\n\]*" {
		verbose "$expect_out(0,string)" 2
		exp_continue
	    }
	    timeout {
		perror "$test timed out" 0
		exp_continue
	    }
	    eof {
		verbose "All Done" 3
	    }
	}
    } else {
	perror "$test doesn't exist" 0
    }
}

if ![info exists EXPECT] {
    set EXPECT [findfile $base_dir/../../expect/expect "$base_dir/../../expect/expect" expect]
    verbose "EXPECT defaulting to $EXPECT" 2
}

make_defaults_file [pwd]/setval.tmp

foreach i [glob $srcdir/$subdir/*.test] {
    process_test $i
}