 |
Changeset 3986
- Timestamp:
- 10/07/08 22:28:25
(1 month ago)
- Author:
- Jim Panic
- Message:
stuff.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3984 |
r3986 |
|
| 1 | | Tango.test is an add-on library for Tango, including a domain specific language |
|---|
| 2 | | to represent test collections (dtc - D Test Collection). |
|---|
| | 1 | Overview: |
|---|
| | 2 | --------- |
|---|
| | 3 | Tango.test is an add-on library for Tango, including a domain specific |
|---|
| | 4 | language to represent test collections (dtc - D Test Collection). |
|---|
| 3 | 5 | |
|---|
| 4 | | A typical dtc file looks as follows: |
|---|
| | 6 | A typical dtc file looks as follows: |
|---|
| 5 | 7 | |
|---|
| 6 | | # TestCollection/TestSomething.dtc: |
|---|
| 7 | | # --------------------------------- |
|---|
| 8 | | # collection TestSomething; |
|---|
| 9 | | # |
|---|
| 10 | | # import tango.net.Socket; |
|---|
| 11 | | # |
|---|
| 12 | | # Test throws(AddressException) TestAddressException: |
|---|
| 13 | | # "Test whether AddressException is thrown as expected." |
|---|
| 14 | | # { |
|---|
| 15 | | # Address.exception("test"); |
|---|
| 16 | | # } |
|---|
| 17 | | # |
|---|
| 18 | | # Test TestAssert: "1 == 1, yay" |
|---|
| 19 | | # { |
|---|
| 20 | | # assert(1 == 1); |
|---|
| 21 | | # } |
|---|
| 22 | | |
|---|
| 23 | | Usage: |
|---|
| 24 | | ------ |
|---|
| 25 | | Once you've installed TestSuite, create a base directory for your test |
|---|
| 26 | | collections (preferably "TestCollections") and put some .dtc files in there. |
|---|
| 27 | | |
|---|
| 28 | | Note: You can also write the D TestCase modules yourself in case you don't |
|---|
| 29 | | trust/like the DSL. |
|---|
| 30 | | |
|---|
| 31 | | $ TestSuite --base-dir=TestCollections |
|---|
| 32 | | |
|---|
| 33 | | That's it. That's how you use tango.test. You're now officially a full |
|---|
| 34 | | blown professional software tester, woohoo! \o/ |
|---|
| | 8 | # TestCollection/TestSomething.dtc: |
|---|
| | 9 | # --------------------------------- |
|---|
| | 10 | # collection TestSomething; |
|---|
| | 11 | # |
|---|
| | 12 | # import tango.net.Socket; |
|---|
| | 13 | # |
|---|
| | 14 | # Test throws(AddressException) TestAddressException: |
|---|
| | 15 | # "Test whether AddressException is thrown as expected." |
|---|
| | 16 | # { |
|---|
| | 17 | # Address.exception("test"); |
|---|
| | 18 | # } |
|---|
| | 19 | # |
|---|
| | 20 | # Test TestAssert: "1 == 1, yay" |
|---|
| | 21 | # { |
|---|
| | 22 | # assert(1 == 1); |
|---|
| | 23 | # } |
|---|
| 35 | 24 | |
|---|
| 36 | 25 | Installation: |
|---|
| … | … | |
| 40 | 29 | http://dsource.org/projects/dsss . |
|---|
| 41 | 30 | |
|---|
| 42 | | $ dsss build |
|---|
| | 31 | The easiest way to use tango.test is to check out a specific release into |
|---|
| | 32 | your project's working directory: |
|---|
| 43 | 33 | |
|---|
| 44 | | That's it, you have the binary now. Use it. |
|---|
| | 34 | $ svn co http://svn.dsource.org/projects/tango/branches/tango.test/releases/0.1/ |
|---|
| | 35 | |
|---|
| | 36 | This will fetch all necessary files and place them accordingly. |
|---|
| | 37 | |
|---|
| | 38 | After that, you just build it with: |
|---|
| | 39 | |
|---|
| | 40 | $ dsss build --config=dsss.tango.test.conf |
|---|
| | 41 | |
|---|
| | 42 | Usage: |
|---|
| | 43 | ------ |
|---|
| | 44 | Once you've installed TestSuite, create a base directory for your test |
|---|
| | 45 | collections (preferably "TestCollections") and put some .dtc files in there. |
|---|
| | 46 | |
|---|
| | 47 | |
|---|
| | 48 | $ TestSuite --base-dir=TestCollections |
|---|
| 45 | 49 | |
|---|
| 46 | 50 | Configuration: |
|---|
| … | … | |
| 48 | 52 | As of now there's no implementation for a configuration file, but this will |
|---|
| 49 | 53 | be added as soon as possible. |
|---|
| 50 | | |
|---|
| r3985 |
r3986 |
|
| 234 | 234 | char[] _version = "0.1"; |
|---|
| 235 | 235 | char[] usage = "tango.test TestSuite version {1} |
|---|
| 236 | | Usage: {0} [--help]"; |
|---|
| | 236 | Usage: {0} [--help|--version]"; |
|---|
| 237 | 237 | |
|---|
| 238 | 238 | void main (char[][] args) { |
|---|
| … | … | |
| 249 | 249 | }); |
|---|
| 250 | 250 | |
|---|
| | 251 | parser.bindPosix("version", (char[] value) { |
|---|
| | 252 | Stdout.formatln("tango.test TestSuite version {}", _version); |
|---|
| | 253 | build = false; |
|---|
| | 254 | }); |
|---|
| | 255 | |
|---|
| 251 | 256 | parser.bindPosix("base-dir", (char[] value) { cfg.baseDir = value; }); |
|---|
| 252 | 257 | parser.bindPosix("build-tool", (char[] value) { cfg.buildTool = value; }); |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic