Last change
on this file since 2466 was 2275, checked in by Bruno Cornec, 7 years ago |
Fix tests so that they really work when Test::More isn't found
|
File size:
641 bytes
|
Rev | Line | |
---|
[2199] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # Tests ProjectBuilder::Base functions
|
---|
| 4 |
|
---|
| 5 | use strict;
|
---|
| 6 | use ProjectBuilder::Filter;
|
---|
| 7 |
|
---|
[2275] | 8 | my $res;
|
---|
[2199] | 9 | eval
|
---|
| 10 | {
|
---|
| 11 | require Test::More;
|
---|
| 12 | Test::More->import();
|
---|
[2275] | 13 | $res = $@;
|
---|
[2199] | 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
|
---|
[2275] | 21 | if ($res) {
|
---|
[2199] | 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.