Changeset 2142 for trunk


Ignore:
Timestamp:
Mar 18, 2011, 9:42:44 AM (14 years ago)
Author:
mmc
Message:

Fixed the regression tester to handle unknown objects more gracefully.
It now reports a warning for objects that are not yet supported by
the new Rappture object system.

Fixed the Makefile to install legend.tcl and runview.tcl properly.

Location:
trunk/tester/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/scripts/Makefile.in

    r2136 r2142  
    1919FILES           = \
    2020                $(srcdir)/main.tcl \
     21                $(srcdir)/legend.tcl \
    2122                $(srcdir)/objview.tcl \
    2223                $(srcdir)/resultspage.tcl \
     24                $(srcdir)/runview.tcl \
    2325                $(srcdir)/statuslist.tcl \
    2426                $(srcdir)/stringdiffs.tcl \
  • trunk/tester/scripts/main.tcl

    r2139 r2142  
    269269    -title1 "Expected this:" -title2 "Got this:"
    270270pack $win.diffs -expand yes -fill both -padx 4 -pady 4
     271
     272# viewer for showing string info if all else fails (e.g. unkobj errors)
     273Rappture::Scroller .testdiffs.body.info \
     274    -xscrollmode auto -yscrollmode auto
     275pack .testdiffs.body.info -expand yes -fill both -padx 10 -pady {0 10}
     276text .testdiffs.body.info.text -width 10 -height 1 -wrap char
     277.testdiffs.body.info contents .testdiffs.body.info.text
    271278
    272279# plug the proper diff colors into the legend area
     
    428435                    }
    429436                  }
     437                  unkobj {
     438                    set icon [Rappture::icon warn16]
     439                    set title "Unsupported object type"
     440                    set desc "Test contains an object type that is not yet supported"
     441                    set help "The Rappture Regression Tester is still in beta.  Some object types supported by the Rappture runtime environment are not yet supported by the tester.  These warnings will go away as the Rappture Regression Tester improves and support for all object types is put into place."
     442                  }
    430443                  default {
    431                     error "don't know how to handle difference \"$what\""
     444                    error "don't know how to handle difference \"$difftype\""
    432445                  }
    433446                }
     
    701714            set legsettings {2 disabled 3 disabled 4 disabled}
    702715        }
     716        "unkobj" {
     717            set win .testdiffs.body.info
     718            $win.text configure -state normal
     719            $win.text delete 1.0 end
     720            $win.text insert end "The following object type is not yet supported within the Rappture Regression Tester:\n\n[$diff(-testobj) getTestInfo xml $diff(-path)]"
     721            $win.text configure -state disabled
     722            set legsettings {2 disabled 3 disabled 4 disabled}
     723        }
    703724    }
    704725    if {[pack slaves .testdiffs.body] ne $win} {
  • trunk/tester/scripts/test.tcl

    r2139 r2142  
    164164            if {[$_testobj get output.status] ne "ok"} {
    165165                # expected test to fail, but it didn't
    166                 set idiffs [_computeDiffs [$_toolobj xml] $_runobj -in input]
     166                set idiffs [_computeDiffs [$_toolobj xml object] $_runobj -in input]
    167167                set odiffs [_computeDiffs $_testobj $_runobj -what run]
    168168                set _diffs [concat $idiffs $odiffs]
    169169                _setResult "Fail"
    170170            } else {
    171                 set idiffs [_computeDiffs [$_toolobj xml] $_testobj -in input]
     171                set idiffs [_computeDiffs [$_toolobj xml object] $_testobj -in input]
    172172                set odiffs [_computeDiffs $_testobj $_runobj -in output]
    173173                set _diffs [concat $idiffs $odiffs]
     
    187187                _setResult "Pass"
    188188            } else {
    189                 set idiffs [_computeDiffs [$_toolobj xml] $_runobj -in input]
     189                set idiffs [_computeDiffs [$_toolobj xml object] $_runobj -in input]
    190190                set odiffs [_computeDiffs $_testobj $_runobj -what run]
    191191                set _diffs [concat $idiffs $odiffs]
     
    200200            _setResult "Pass"
    201201        } else {
    202             set idiffs [_computeDiffs [$_toolobj xml] $_runobj -in input]
     202            set idiffs [_computeDiffs [$_toolobj xml object] $_runobj -in input]
    203203            set odiffs [_computeDiffs $_testobj $_runobj -what run]
    204204            set _diffs [concat $idiffs $odiffs]
     
    271271    if {[string match input.* $path]} {
    272272        # if we're matching input, compare the original XML vs. the test
    273         return [_computeDiffs [$_toolobj xml] $_testobj -in $path -detail max]
     273        return [_computeDiffs [$_toolobj xml object] $_testobj -in $path -detail max]
    274274    }
    275275
     
    426426                        if {$type1 eq $type2} {
    427427                          set same yes
    428                           set alist [Rappture::objects::get $type1 -attributes]
     428                          if {[catch {Rappture::objects::get $type1 -attributes} alist]} {
     429                              # oops! unknown object type
     430                              lappend rlist [linsert $details 0 -what unkobj]
     431                              set alist ""
     432                          }
    429433                          foreach rec $alist {
    430434                              array set attr [lrange $rec 1 end]
Note: See TracChangeset for help on using the changeset viewer.