Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a9365473260fdd8b7b06e91595815a54d2b37378
Ticket: 2794560fffffffffffffffffffffffffffffffff
non-empty return from [runAllTests] - indicate status
User & Date: dgp on 2009-05-20 20:11:39
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    Request from Larry McVoy posted to TCLCORE:
    
    In our tree we would like to include a subset of the tcl tests in our
    normal builds and have it fail the build if the tests do not pass.
    This patch accomplishes that for a subset or for all tests.
    
    
    ===== library/tcltest/tcltest.tcl 1.105 vs edited =====
    --- 1.105/library/tcltest/tcltest.tcl        2008-02-11 09:34:32 -08:00
    +++ edited/library/tcltest/tcltest.tcl        2009-05-12 14:13:10 -07:00
    @@ -2735,6 +2735,7 @@ proc tcltest::runAllTests { {shell ""} }
     
         set timeCmd {clock format [clock seconds]}
         puts [outputChannel] "Tests began at [eval $timeCmd]"
    +    set exit_status 0
     
         # Run each of the specified tests
         foreach file [lsort [GetMatchingFiles]] {
    @@ -2772,6 +2773,7 @@ proc tcltest::runAllTests { {shell ""} }
                             }
                             if {$Failed > 0} {
                                 lappend failFiles $testFile
    +                            set exit_status 1
                             }
                         } elseif {[regexp [join {
                                 {^Number of tests skipped }
    @@ -2799,6 +2801,7 @@ proc tcltest::runAllTests { {shell ""} }
         puts [outputChannel] "\nTests ended at [eval $timeCmd]"
         cleanupTests 1
         if {[info exists testFileFailures]} {
    +        set exit_status 1
             puts [outputChannel] "\nTest files exiting with errors:  \n"
             foreach file $testFileFailures {
                 puts [outputChannel] "  [file tail $file]\n"
    @@ -2818,7 +2821,7 @@ proc tcltest::runAllTests { {shell ""} }
             puts [outputChannel] ""
             puts [outputChannel] [string repeat ~ 44]
         }
    -    return
    +    return $exit_status
     }
     
     #####################################################################
    ===== tests/all.tcl 1.18 vs edited =====
    --- 1.18/tests/all.tcl        2006-11-02 16:34:52 -08:00
    +++ edited/tests/all.tcl        2009-05-12 14:05:08 -07:00
    @@ -16,4 +16,4 @@ package require Tcl 8.5
     package require tcltest 2.2
     namespace import tcltest::*
     configure {*}$argv -testdir [file dir [info script]]
    -runAllTests
    +exit [runAllTests]
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "34. tcltest Package"
  11. title changed to:
    non-empty return from [runAllTests] - indicate status
    
  12. type changed to: "RFE"