Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e3ad46ab2dadd7fc7222e8b58e95194b0a06f17e6514f7a270c41dae854bd948
Ticket: 9d579f145034b21ab250dcd808c78764fd40ac1b
Incorrect handling of test constraints
User & Date: erikleunissen on 2017-12-09 22:26:26
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Some test constraints are handled incorrectly, letting tests being run when they should not and conversely. This behaviour appears to depend on certain characters being present in the name of the constraint. The attached Tcl script "testconstraints.tcl" exercises the incorrect behaviour for two cases.
    
    Expected behaviour: test foo is skipped and test bar is run.
    Observed behaviour: test foo is run and test bar is skipped.
    
    > cat testconstraints.tcl
    #! /bin/sh
    # If executed as a shell script, the next line replaces the shell with wish \
    exec tclsh "$0" ${1+"$@"}
    
    puts "tcltest version: [package require tcltest]"
    namespace import tcltest::*
    tcltest::configure -verbose {pass error}
    
    testConstraint tcl>=11.1 [expr {$tcl_version >= 11.1}]
    testConstraint abc-def-ghi 1
    
    # This test ought be skipped
    test foo {foo} -constraints {tcl>=11.1} -body {
            # no need to do anything here
    } -result ""
    
    # This test ought be run
    test bar {bar} -constraints {abc-def-ghi} -body {
            # no need to do anything here
    } -result ""
    
    tcltest::cleanupTests
    > tclsh8.5 testconstraints.tcl
    tcltest version: 2.4.1
    ++++ foo PASSED
    testconstraints.tcl:    Total   2       Passed  1       Skipped 1       Failed  0
    Number of tests skipped for each constraint:
            1       abc-def-ghi
    > 
    
    
    The attached patch corrects the behaviour:
    
    > tclsh8.5 testconstraints.tcl
    tcltest version: 2.4.1
    ++++ bar PASSED
    testconstraints.tcl:    Total   2       Passed  1       Skipped 1       Failed  0
    Number of tests skipped for each constraint:
            1       tcl>=11.1
    > 
    
    
    Sincerely,
    Erik Leunissen
    --
    
  5. foundin changed to: "tcltest 2.4.1"
  6. is_private changed to: "0"
  7. login: "erikleunissen"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "609f4c7ecf7dbb7a46acdc7eb164753d196088a6"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "erikleunissen"
  14. subsystem changed to: "34. tcltest Package"
  15. title changed to: "Incorrect handling of test constraints"
  16. type changed to: "Bug"