Changes between Version 5 and Version 6 of Tests


Ignore:
Timestamp:
Aug 30, 2013, 11:26:39 AM (11 years ago)
Author:
marius@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tests

    v5 v6  
    22
    33The MacPorts testing framework uses tcltest ![0] for its unit tests as well as regression tests.
    4 Maintainer: marius@macports.org
     4Maintainer: marius [at] macports.org
     5
     6=== Running tests ===
     7
     8The easiest way to run all the tests, is to use the target in the Makefile.
     9* make test
     10
     11Each 'tests/' directory has a 'test.tcl' file, used by the make target to run all tests and format the output, making it easy to read.
     12The file can be used also to:
     13* run all tests:                    ' tclsh test.tcl '
     14* get debug info:               ' tclsh test.tcl -debug \[0-3\] '
     15* list individual test files:   ' tclsh test.tcl -l '
     16* run specific test files:      ' tclsh test.tcl -t macports.test '
     17* print help message:        ' tclsh test.tcl -h '
     18
     19Specific test cases can be run using the '-match' argument for the file that contains the test, from its parent directory.
     20* tclsh macports.test -match mportclose
     21
     22Regression tests can be found in ' trunk/base/tests/ ' and can be  run just as unit tests.
    523
    624
    725=== Must know ===
    826
     27* regression tests have their own directory, found in ' trunk/base/tests/ '
    928* each module of MacPorts (port1.0, macports1.0, package1.0) has its own ‘tests/’ directory where the test files are located and also additional files needed (Portfile, test.tcl)
    1029* each file in a module has a corresponding test file (.test extension) in the ‘tests/’ directory
     
    1231* each test case must be independent from each other, so they can be run individually if needed
    1332* each test must clan all auxiliary files or directories it creates and revert all port it installs
     33* use a single test proceduce for each tested proc; sub-test cases should be included in the same body
     34* when adding new regression tests, make sure to specify its name in the test_suite list of ' trunk/base/tests/test.tcl '
    1435
    1536
     
    4970test mportclose {
    5071    Mport close unit test.
     72# this branch is optional and you can use other constraints too
     73} -constraints {
     74    root
    5175# the setup branch is optional
    5276} -setup {
     
    6993}}}
    7094
    71 
    72 === Resources ===
    73 
    74 ![0] - [[http://wiki.tcl.tk/1502 | Tcltest official wiki page]]\\
    75 ![1] - [[http://web.archive.org/web/20080617153002/www.tclscripting.com/articles/apr06/article1.html | Getting started with tcltest]]\\
    76 ![2] - [[http://www.tcl.tk/man/tcl8.5/TclCmd/tcltest.htm | Official tcltest documentation]]