summaryrefslogtreecommitdiff
path: root/travis/run-tests.pl
diff options
context:
space:
mode:
authorEmeric Planet <emeric.planet@datadoghq.com>2017-08-29 19:01:30 +0200
committerkousu <nick@kousu.ca>2017-10-05 13:18:23 -0400
commitcb9b55217d40a50f89f0445294a0b2650fc3dc26 (patch)
tree289f0acdf736709ff0b2725dd668d091f5aff54e /travis/run-tests.pl
parentaefa784882debe98f88799f0e8fdb544cb8ec3a9 (diff)
Fix CPU unit tests (#239)
Support any amount of available cores on testing machine.
Diffstat (limited to 'travis/run-tests.pl')
-rwxr-xr-xtravis/run-tests.pl15
1 files changed, 12 insertions, 3 deletions
diff --git a/travis/run-tests.pl b/travis/run-tests.pl
index 453a633..5936b7e 100755
--- a/travis/run-tests.pl
+++ b/travis/run-tests.pl
@@ -3,19 +3,29 @@
use v5.10;
use strict;
use warnings;
+use English;
use Term::ANSIColor qw(:constants);
use File::Basename;
sub TestCase {
my ($dir) = @_;
+
+ if ( -f "@_/setup.pl") {
+ system($EXECUTABLE_NAME, "@_/setup.pl", ($dir));
+ }
+
my $conf = "$dir/i3status.conf";
my $testres = `./i3status --run-once -c $conf`;
my $refres = "";
if ( -f "@_/expected_output.txt") {
$refres = `cat "@_/expected_output.txt"`;
- } elsif ( -f "@_/expected_output.sh") {
- $refres = `bash @_/expected_output.sh`;
+ } elsif ( -f "@_/expected_output.pl") {
+ $refres = `$EXECUTABLE_NAME @_/expected_output.pl`;
+ }
+
+ if ( -f "@_/cleanup.pl") {
+ system($EXECUTABLE_NAME, "@_/cleanup.pl", ($dir));
}
if ( "$testres" eq "$refres" ) {
@@ -27,7 +37,6 @@ sub TestCase {
}
}
-
my $testcases = 'testcases';
my $testresults = 1;