|
Last change
on this file since 2275 was 2275, checked in by Bruno Cornec, 9 years ago |
|
Fix tests so that they really work when Test::More isn't found
|
|
File size:
641 bytes
|
| Line | |
|---|
| 1 | #!/usr/bin/perl -w
|
|---|
| 2 | #
|
|---|
| 3 | # Tests ProjectBuilder::Base functions
|
|---|
| 4 |
|
|---|
| 5 | use strict;
|
|---|
| 6 | use ProjectBuilder::Filter;
|
|---|
| 7 |
|
|---|
| 8 | my $res;
|
|---|
| 9 | eval
|
|---|
| 10 | {
|
|---|
| 11 | require Test::More;
|
|---|
| 12 | Test::More->import();
|
|---|
| 13 | $res = $@;
|
|---|
| 14 | my ($tmv,$tmsv) = split(/\./,$Test::More::VERSION);
|
|---|
| 15 | if ($tmsv lt 87) {
|
|---|
| 16 | die "Test::More is not available in an appropriate version ($tmsv)";
|
|---|
| 17 | }
|
|---|
| 18 | };
|
|---|
| 19 |
|
|---|
| 20 | # Test::More appropriate version not found so no test will be performed here
|
|---|
| 21 | if ($res) {
|
|---|
| 22 | require Test;
|
|---|
| 23 | Test->import();
|
|---|
| 24 | plan(tests => 1);
|
|---|
| 25 | print "# Faking tests as Test::More is not available in an appropriate version\n";
|
|---|
| 26 | ok(1,1);
|
|---|
| 27 | exit(0);
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | my $nt = 0;
|
|---|
| 31 | is("1", "1", "pb Fake Test");
|
|---|
| 32 | $nt++;
|
|---|
| 33 |
|
|---|
| 34 | done_testing($nt);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.