5 | | To keep things simple, each module of MacPorts ([[https://trac.macports.org/browser/trunk/base/src/macports1.0 | macports1.0]], [[https://trac.macports.org/browser/trunk/base/src/package1.0 | package1.0]], [[https://trac.macports.org/browser/trunk/base/src/port1.0 | port1.0]], [[https://trac.macports.org/browser/trunk/base/src/registry2.0 | registry2.0]]) has it's own 'tests/' directory. Each Tcl script in a module (e.g. [[https://trac.macports.org/browser/trunk/base/src/macports1.0/macports.tcl | macports.tcl]]) has its own test script located in the 'test' directory, with the same name and the '.test' extension (e.g. [[https://trac.macports.org/browser/trunk/base/src/macports1.0/tests/macports.test | macports.test]]). Every proc in a script (e.g. [[https://trac.macports.org/browser/trunk/base/src/macports1.0/macports.tcl#L334 | proc macports::findBinary]]) should have it's own test proc (e.g. [[https://trac.macports.org/browser/trunk/base/src/macports1.0/tests/macports.test#L334 | test findBinary]]) in the corresponding test file. Test procs should maintain the order in the original script and should be independent one of another. |
| 5 | To keep things simple, each module of MacPorts ([browser:trunk/base/src/macports1.0 macports1.0], [browser:trunk/base/src/package1.0 package1.0], [browser:trunk/base/src/port1.0 port1.0], [browser:trunk/base/src/registry2.0 registry2.0]) has its own 'tests/' directory. Each Tcl script in a module (e.g. [browser:trunk/base/src/macports1.0/macports.tcl macports.tcl]) has its own test script located in the 'test' directory, with the same name and the '.test' extension (e.g. [browser:trunk/base/src/macports1.0/tests/macports.test macports.test]). Every proc in a script (e.g. [browser:trunk/base/src/macports1.0/macports.tcl#L334 proc macports::findBinary]) should have its own test proc (e.g. [browser:trunk/base/src/macports1.0/tests/macports.test#L334 test findBinary]) in the corresponding test file. Test procs should maintain the order in the original script and should be independent one of another. |
16 | | Each 'tests/' directory has a [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/test.tcl | test.tcl]] file, used by the make target to run all tests and format the output, making it easy to read. The script just runs the tests individually, printing the test file name, the total number of tests, number of passed, skipped, failed as well as constraints or errors of failed tests. This is one possible output when running macports.test: |
| 16 | Each 'tests/' directory has a [browser:branches/gsoc13-tests/src/macports1.0/tests/test.tcl test.tcl] file, used by the make target to run all tests and format the output, making it easy to read. The script just runs the tests individually, printing the test file name, the total number of tests, number of passed, skipped, failed as well as constraints or errors of failed tests. This is one possible output when running macports.test: |
61 | | * the tests can be run only on an installed version of Macports ( so make sure you have run 'sudo make install' ) |
62 | | * regression tests have their own directory, found in [[https://trac.macports.org/browser/trunk/base/tests/test | trunk/base/tests/test]] |
63 | | * 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 ([[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/Portfile | Portfile]], [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/test.tcl | test.tcl]]) |
| 61 | * the tests can be run only on an installed version of MacPorts (so make sure you have run 'sudo make install') |
| 62 | * regression tests have their own directory, found in [browser:trunk/base/tests/test trunk/base/tests/test] |
| 63 | * 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 ([browser:branches/gsoc13-tests/src/macports1.0/tests/Portfile Portfile], [browser:branches/gsoc13-tests/src/macports1.0/tests/test.tcl test.tcl]) |
157 | | * In all tests we use this [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/Portfile | Portfile]]. |
158 | | * This is the [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/test.tcl | test.tcl]] file used to run and parse the output of all the tests in a module. |
159 | | * A worker_init copy, without using sub-interpreters [[https://trac.macports.org/browser/branches/gsoc13-tests/src/package1.0/tests/library.tcl | library.tcl ]]. |
160 | | * Example of [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/sources.conf | sources.conf ]]. |
161 | | * An example of a test file [[https://trac.macports.org/browser/branches/gsoc13-tests/src/macports1.0/tests/macports.test | macports.test ]]. |
162 | | * A [[https://trac.macports.org/browser/branches/gsoc13-tests/tests/test/library.tcl | library.tcl]] of useful procs in regression testing. |
| 157 | * In all tests we use this [browser:branches/gsoc13-tests/src/macports1.0/tests/Portfile Portfile]. |
| 158 | * This is the [browser:branches/gsoc13-tests/src/macports1.0/tests/test.tcl test.tcl] file used to run and parse the output of all the tests in a module. |
| 159 | * A worker_init copy, without using sub-interpreters [browser:branches/gsoc13-tests/src/package1.0/tests/library.tcl library.tcl]. |
| 160 | * Example of [browser:branches/gsoc13-tests/src/macports1.0/tests/sources.conf sources.conf]. |
| 161 | * An example of a test file [browser:branches/gsoc13-tests/src/macports1.0/tests/macports.test macports.test]. |
| 162 | * A [browser:branches/gsoc13-tests/tests/test/library.tcl library.tcl] of useful procs in regression testing. |