The final attempt to solicit feedback for my suggestion to use existing testing framework.
Want to bring to your attention testing framework Test::Simple. I think you'll like this one the most because it implements exactly the ideas you suggested earlier, plus some more.
You can play with the examples unpacking file winetest.tar.gz to the existing winetest application directory.
1) look at file test1.pl. It implements exactly the functionality of existing test.pl module with using Test::Simple framework. The only change I made are descriptive error messages for the first few tests.
Output of test1.pl: ok 1 - Valid atom handle ok 2 - No error code defined ok 3 ok 4 - Succeed code ok 5 - Atom name ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 ok 13 ok 14 ok 15 1..15
The basic usage is not more difficult than one you suggested, right?
2) test2.pl - very simple test script. Demonstrates TODO tests functionality. These are tests which are known to fail - you are notified if any of these succeeds by miracle. You'll see following output if you run the test:
1..4 ok 1 - Success not ok 2 # Failed test (test2.pl at line 8) not ok 3 # TODO Example of using TODO tests # Failed (TODO) test (test2.pl at line 12) ok 4 - Example of successfull TODO test # TODO Example of using TODO tests # Looks like you failed 1 tests of 4.
3) Things become even more interesting when Test::Simple is used with module Test::Harness. Test::Harness allows to run many tests at once and consolidate results of these tests. test_all.pl uses the module to run all the tests (currently test2.pl only). The output of the script:
test2.p.............# Failed test (test2.pl at line 8) # Looks like you failed 1 tests of 4. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED tests 2-3 Failed 2/4 tests, 50.00% okay Failed Test Status Wstat Total Fail Failed List of failed ------------------------------------------------------------------------------- test2.pl 1 256 4 2 50.00% 2-3 Failed 1/1 test scripts, 0.00% okay. 2/4 subtests failed, 50.00% okay.
4) the framework has other nice features, like skipping tests. Useful in choosing platform-specific tests, gui vs cli, etc.
Is this functionality sufficient for winetest?
However I found a few issues with winetest: 1) For some reason running test_all.pl with winetest gives compilation error. I saw the same compilation error when I tried to use other Perl testing framework Test::Unit. 2) Compilation failure when I try to run test1.pl directly with Perl, like "perl test1.pl"
Look forward for your answer. Let me know if you need more information.
Andriy Palamarchuk
__________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com