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

passfail.exp « lib « testsuite « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8a44d274d175a48424a2056217fc068f9ead3b09 (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
# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
#
# Permission to use, copy, modify, and distribute this software
# is freely granted, provided that this notice is preserved.
#

# newlib_pass_fail compiles and runs all the source files in the test
# directory that are not included in the check_output_tests list.
# check_output_tests lists the sources' basenames.

proc newlib_pass_fail { check_output_tests } {
    global srcdir objdir subdir runtests

    foreach testcase [glob -nocomplain $srcdir/$subdir/*.c] {
	# If we're only testing specific files and this isn't one of them, skip it.
	if ![runtest_file_p $runtests $testcase] then {
	    continue
	}

	# Exclude tests which require their output to be checked
	if {[lsearch $check_output_tests "[file tail $testcase]"] != -1} then {
	    continue
	}

	set test_driver "$objdir/testsuite/[file tail [file rootname $testcase].x]"

	set comp_output [newlib_target_compile "$testcase" "$test_driver" "executable" ""]
	
	if { $comp_output != "" } {
	    fail "Failed to compile $testcase.\n"
	    fail "$testcase"
	} else {
	    pass "Compiled $testcase.\n"
	    set result [newlib_load $test_driver ""]
	    set status [lindex $result 0]
	    $status "$testcase"
	}
    }
}