Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3adf4e9e49bae3149b671626a837812df48af6c02ae24f4e5d690d825e103e6e
Ticket: 2794560fffffffffffffffffffffffffffffffff
non-empty return from [runAllTests] - indicate status
User & Date: fvogel on 2018-10-29 22:03:57
Changes

  1. closer changed to: "nobody"
  2. 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]
    
  3. icomment: "Superseded by TIP #425, isn't it?"
  4. login: "fvogel"
  5. mimetype: "text/plain"
  6. severity changed to: "Minor"