summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/test.exp
blob: 8068a6fc3b65fa9767a3c0e6cb784f49737c401c (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
proc test_procedure {} {
    global srcdir subdir
    set wd [pwd]
    set flags ""
    if {$srcdir == ""} {
	set pattern "*.c"
    } else {
	set pattern "$srcdir/$subdir/*.c"
    }
    foreach filename [lsort [glob $pattern]] {
	set file [file tail [string range $filename 0 end-2]]
	target_compile $filename $wd/$file executable $flags
	send_log "Testing ${file}\n"
	set res [exec $srcdir/$subdir/test.tcl $file $filename]
	if {$res == "PASS"} {
	    pass "$file"
	} elseif {$res == "UNSUPP"} {
	    unsupported "$file not supported on this arch"
	} else {
	    fail "$file"
	    send_log "$res\n"
	}
    }
    
    if {$::tcl_platform(machine) == "x86_64" || 
        $::tcl_platform(machine) == "ppc64"} {
	# on x86_64 and pcp64, test 32-bit and 64-bit binaries
	set flags "additional_flags=-m32"
	foreach filename [lsort [glob $pattern]] {
	    set file [file tail [string range $filename 0 end-2]]
	    target_compile $filename $wd/$file executable $flags
	    send_log "Testing 32-bit ${file}\n"
	    set res [exec $srcdir/$subdir/test.tcl $file $filename]
	    if {$res == "PASS"} {
		pass "32-bit $file"
	    } elseif {$res == "UNSUPP"} {
		unsupported "$file not supported on this arch"
	    } else {
		fail "32-bit $file"
		send_log "$res\n"
	    }
	}
    }    
}

test_procedure