From 884e4da6730a31fc7a5ef892fb9cb061baaf5f6c Mon Sep 17 00:00:00 2001 From: Emeric Planet Date: Tue, 29 Aug 2017 19:01:30 +0200 Subject: Fix CPU unit tests (#239) Support any amount of available cores on testing machine. --- travis/run-tests.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'travis/run-tests.pl') 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; -- cgit v1.2.3