[llvm-commits] [llvm] r48767 - /llvm/branches/ggreif/parallelized-test/lib/llvm.exp
Gabor Greif
ggreif at gmail.com
Tue Mar 25 03:24:31 PDT 2008
Author: ggreif
Date: Tue Mar 25 05:24:26 2008
New Revision: 48767
URL: http://llvm.org/viewvc/llvm-project?rev=48767&view=rev
Log:
detabify
Modified:
llvm/branches/ggreif/parallelized-test/lib/llvm.exp
Modified: llvm/branches/ggreif/parallelized-test/lib/llvm.exp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/parallelized-test/lib/llvm.exp?rev=48767&r1=48766&r2=48767&view=diff
==============================================================================
--- llvm/branches/ggreif/parallelized-test/lib/llvm.exp (original)
+++ llvm/branches/ggreif/parallelized-test/lib/llvm.exp Tue Mar 25 05:24:26 2008
@@ -83,10 +83,10 @@
proc RunLLVMTests { test_source_files } {
global srcroot objroot srcdir objdir subdir
- if 0==[llength $test_source_files] {
- verbose "NOTE: test suite without tests: $subdir" 1
- exit 2
- }
+ if 0==[llength $test_source_files] {
+ verbose "NOTE: test suite without tests: $subdir" 1
+ exit 2
+ }
set timeout 60
@@ -103,48 +103,48 @@
file mkdir Output
cd Output
- # Create the makefile that can be invoked in a parallel manner.
- set makeFilePath [file join $path Output Test.makefile]
- set makeFileId [open $makeFilePath w]
- puts $makeFileId "\# THIS FILE IS GENERATED. DO NOT EDIT"
- puts $makeFileId ""
- puts $makeFileId ""
- puts $makeFileId "include [file join $srcroot Makefile.config]"
- puts $makeFileId "include [file join $srcroot Makefile.rules]"
- puts $makeFileId ""
- puts $makeFileId "SUBDIR = $subdir"
- puts $makeFileId ""
- puts $makeFileId "%.testresults: [file join $path %]"
- puts $makeFileId "\t@ printf '.'"
- puts $makeFileId "\t@ (echo source \$(LLVM_OBJ_ROOT)/test/site.exp; \\"
- puts $makeFileId "\t echo source \$(LLVM_SRC_ROOT)/test/lib/llvm.exp; \\"
- puts $makeFileId "\t echo proc fail { msg } { puts '\"FAIL: \$\$msg\"' }; \\"
- puts $makeFileId "\t echo proc xfail { msg } { puts '\"XFAIL: \$\$msg\"' }; \\"
- puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\"
- puts $makeFileId "\t echo proc xpass { msg } { puts '\"XPASS: \$\$msg\"' }; \\"
- puts $makeFileId "\t echo proc verbose { msg level } { puts '\"\$\$msg\"' }; \\"
- puts $makeFileId "\t echo set subdir \$(SUBDIR); \\"
-
- puts $makeFileId "\t echo run_one_test \$<) | \\"
- puts $makeFileId "\t (ulimit -t 600; \\"
- puts $makeFileId "\t ulimit -d 512000; \\"
- puts $makeFileId "\t PATH=\"\$(LLVMToolDir):\$(LLVM_SRC_ROOT)/test/Scripts:\$(PATH)\" \$(TCLSH)) > \$@"
- puts $makeFileId ""
- puts $makeFileId ""
- puts $makeFileId "TESTS = \\"
+ # Create the makefile that can be invoked in a parallel manner.
+ set makeFilePath [file join $path Output Test.makefile]
+ set makeFileId [open $makeFilePath w]
+ puts $makeFileId "\# THIS FILE IS GENERATED. DO NOT EDIT"
+ puts $makeFileId ""
+ puts $makeFileId ""
+ puts $makeFileId "include [file join $srcroot Makefile.config]"
+ puts $makeFileId "include [file join $srcroot Makefile.rules]"
+ puts $makeFileId ""
+ puts $makeFileId "SUBDIR = $subdir"
+ puts $makeFileId ""
+ puts $makeFileId "%.testresults: [file join $path %]"
+ puts $makeFileId "\t@ printf '.'"
+ puts $makeFileId "\t@ (echo source \$(LLVM_OBJ_ROOT)/test/site.exp; \\"
+ puts $makeFileId "\t echo source \$(LLVM_SRC_ROOT)/test/lib/llvm.exp; \\"
+ puts $makeFileId "\t echo proc fail { msg } { puts '\"FAIL: \$\$msg\"' }; \\"
+ puts $makeFileId "\t echo proc xfail { msg } { puts '\"XFAIL: \$\$msg\"' }; \\"
+ puts $makeFileId "\t echo proc pass { msg } { puts '\"PASS: \$\$msg\"' }; \\"
+ puts $makeFileId "\t echo proc xpass { msg } { puts '\"XPASS: \$\$msg\"' }; \\"
+ puts $makeFileId "\t echo proc verbose { msg level } { puts '\"\$\$msg\"' }; \\"
+ puts $makeFileId "\t echo set subdir \$(SUBDIR); \\"
+
+ puts $makeFileId "\t echo run_one_test \$<) | \\"
+ puts $makeFileId "\t (ulimit -t 600; \\"
+ puts $makeFileId "\t ulimit -d 512000; \\"
+ puts $makeFileId "\t PATH=\"\$(LLVMToolDir):\$(LLVM_SRC_ROOT)/test/Scripts:\$(PATH)\" \$(TCLSH)) > \$@"
+ puts $makeFileId ""
+ puts $makeFileId ""
+ puts $makeFileId "TESTS = \\"
foreach test $test_source_files {
- output_one_test "$test" $makeFileId
+ output_one_test "$test" $makeFileId
}
- puts $makeFileId ""
- puts $makeFileId "Test.makefile.out: \$(TESTS)"
- puts $makeFileId "\t@ printf '\\n---- testing $subdir ---\\n'"
- puts $makeFileId "\t@ cat \$(TESTS) > \$@"
- puts $makeFileId "\t@ touch \$@"
- puts $makeFileId ""
+ puts $makeFileId ""
+ puts $makeFileId "Test.makefile.out: \$(TESTS)"
+ puts $makeFileId "\t@ printf '\\n---- testing $subdir ---\\n'"
+ puts $makeFileId "\t@ cat \$(TESTS) > \$@"
+ puts $makeFileId "\t@ touch \$@"
+ puts $makeFileId ""
- close $makeFileId
+ close $makeFileId
}
# This procedure adds just one test to the makefile.
@@ -156,127 +156,127 @@
# This procedure runs just one test from the test_source_files array.
proc run_one_test { test } {
global target_triplet llvmgcc_version
- #Should figure out best way to set the timeout
- #set timeout 40
-
- set filename [file tail $test]
- verbose "ABOUT TO RUN: $filename" 2
- set outcome PASS
- set tmpFile "$filename.tmp"
-
- # Mark that it should not be XFAIL for this target.
- set targetPASS 0
-
- #set hasRunline bool to check if testcase has a runline
- set numLines 0
-
- # Open the test file and start reading lines
- set testFileId [ open $test r]
- set runline ""
- set PRNUMS ""
- foreach line [split [read $testFileId] \n] {
-
- # if its the END. line then stop parsing (optimization for big files)
- if {[regexp {END.[[:space:]]*$} $line match endofscript]} {
- break
+ #Should figure out best way to set the timeout
+ #set timeout 40
+
+ set filename [file tail $test]
+ verbose "ABOUT TO RUN: $filename" 2
+ set outcome PASS
+ set tmpFile "$filename.tmp"
+
+ # Mark that it should not be XFAIL for this target.
+ set targetPASS 0
+
+ # set hasRunline bool to check if testcase has a runline
+ set numLines 0
+
+ # Open the test file and start reading lines
+ set testFileId [ open $test r]
+ set runline ""
+ set PRNUMS ""
+ foreach line [split [read $testFileId] \n] {
+
+ # if its the END. line then stop parsing (optimization for big files)
+ if {[regexp {END.[[:space:]]*$} $line match endofscript]} {
+ break
# if the line is continued, concatenate and continue the loop
- } elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} {
- set runline "$runline$oneline "
+ } elseif {[regexp {RUN: *(.+)(\\)$} $line match oneline suffix]} {
+ set runline "$runline$oneline "
# if its a terminating RUN: line then do substitution on the whole line
# and then save the line.
- } elseif {[regexp {RUN: *(.+)$} $line match oneline suffix]} {
- set runline "$runline$oneline"
- set runline [ substitute $runline $test $tmpFile ]
- set lines($numLines) $runline
- set numLines [expr $numLines + 1]
- set runline ""
+ } elseif {[regexp {RUN: *(.+)$} $line match oneline suffix]} {
+ set runline "$runline$oneline"
+ set runline [ substitute $runline $test $tmpFile ]
+ set lines($numLines) $runline
+ set numLines [expr $numLines + 1]
+ set runline ""
# if its an PR line, save the problem report number
- } elseif {[regexp {PR([0-9]+)} $line match prnum]} {
- if {$PRNUMS == ""} {
- set PRNUMS "PR$prnum"
- } else {
- set PRNUMS "$PRNUMS,$prnum"
- }
+ } elseif {[regexp {PR([0-9]+)} $line match prnum]} {
+ if {$PRNUMS == ""} {
+ set PRNUMS "PR$prnum"
+ } else {
+ set PRNUMS "$PRNUMS,$prnum"
+ }
# if its an XFAIL line, see if we should be XFAILing or not.
- } elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
- set targets
+ } elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
+ set targets
- #split up target if more then 1 specified
- foreach target [split $targets ,] {
- if { [regexp {\*} $target match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- } elseif { [regexp $target $target_triplet match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
- if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
- if {$targetPASS != 1} {
- set outcome XFAIL
- }
- }
- }
- }
- } elseif {[regexp {XTARGET:[ *](.+)} $line match targets]} {
- set targets
-
- #split up target if more then 1 specified
- foreach target [split $targets ,] {
- if { [regexp {\*} $target match] } {
- set targetPASS 1
- set outcome PASS
- } elseif { [regexp $target $target_triplet match] } {
- set targetPASS 1
- set outcome PASS
- } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
- if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
- set targetPASS 1
- set outcome PASS
- }
- }
- }
- }
- }
-
- # Done reading the script
- close $testFileId
-
-
- if { $numLines == 0 } {
- fail "$test: \nDoes not have a RUN line\n"
- } else {
- set failed 0
- for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
- regsub ^.*RUN:(.*) $lines($i) \1 theLine
- set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ]
- if { $resultmsg != "" } {
- if { $outcome == "XFAIL" } {
- xfail "$resultmsg"
- } else {
- fail "$resultmsg"
- }
- set failed 1
- break
- }
- }
- if { $failed } {
- return
- } else {
- if { $PRNUMS != "" } {
- set PRNUMS " for $PRNUMS"
- }
- if { $outcome == "XFAIL" } {
- xpass "$test$PRNUMS"
- } else {
- pass "$test$PRNUMS"
- }
- }
- }
+ #split up target if more then 1 specified
+ foreach target [split $targets ,] {
+ if { [regexp {\*} $target match] } {
+ if {$targetPASS != 1} {
+ set outcome XFAIL
+ }
+ } elseif { [regexp $target $target_triplet match] } {
+ if {$targetPASS != 1} {
+ set outcome XFAIL
+ }
+ } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
+ if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
+ if {$targetPASS != 1} {
+ set outcome XFAIL
+ }
+ }
+ }
+ }
+ } elseif {[regexp {XTARGET:[ *](.+)} $line match targets]} {
+ set targets
+
+ #split up target if more then 1 specified
+ foreach target [split $targets ,] {
+ if { [regexp {\*} $target match] } {
+ set targetPASS 1
+ set outcome PASS
+ } elseif { [regexp $target $target_triplet match] } {
+ set targetPASS 1
+ set outcome PASS
+ } elseif { [regexp {llvmgcc(([0-9]+)|([0-9]+[.][0-9]+))} $target match submatch submatch2] } {
+ if { [regexp ^($submatch)$|^(($submatch)(\.)) $llvmgcc_version match] } {
+ set targetPASS 1
+ set outcome PASS
+ }
+ }
+ }
+ }
+ }
+
+ # Done reading the script
+ close $testFileId
+
+
+ if { $numLines == 0 } {
+ fail "$test: \nDoes not have a RUN line\n"
+ } else {
+ set failed 0
+ for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
+ regsub ^.*RUN:(.*) $lines($i) \1 theLine
+ set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ]
+ if { $resultmsg != "" } {
+ if { $outcome == "XFAIL" } {
+ xfail "$resultmsg"
+ } else {
+ fail "$resultmsg"
+ }
+ set failed 1
+ break
+ }
+ }
+ if { $failed } {
+ return
+ } else {
+ if { $PRNUMS != "" } {
+ set PRNUMS " for $PRNUMS"
+ }
+ if { $outcome == "XFAIL" } {
+ xpass "$test$PRNUMS"
+ } else {
+ pass "$test$PRNUMS"
+ }
+ }
+ }
}
# This procedure provides an interface to check the LLVMGCC_LANGS makefile
More information about the llvm-commits
mailing list