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
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2017-08-29 19:01:30 +0200
commit884e4da6730a31fc7a5ef892fb9cb061baaf5f6c (patch)
treea35256792803bfa408faf3d46f1ca2f9cb491b80 /travis/run-tests.pl
parentca9bee8b885e810fd849abcb9b544b487636854c (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;