Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndris Zeila <andris.zeila@zabbix.com>2019-04-08 09:46:03 +0300
committerAndris Zeila <andris.zeila@zabbix.com>2019-04-08 09:46:03 +0300
commitdc312e8753a5ed4226976b6e55af44e38ee30eae (patch)
treeaa32e773a294560121cf1f8768ec73d3f8425b5d /tests/tests_run.pl
parent890573b1a9aa4c0d8c98ab269d5e5bfd9f908d6e (diff)
.......... [DEV-1053] added include support to yaml test cases
Diffstat (limited to 'tests/tests_run.pl')
-rwxr-xr-xtests/tests_run.pl17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/tests_run.pl b/tests/tests_run.pl
index ac8ee8138c4..7d773653f2b 100755
--- a/tests/tests_run.pl
+++ b/tests/tests_run.pl
@@ -9,6 +9,8 @@ use IPC::Run3 qw(run3);
use Time::HiRes qw(time);
use File::Basename qw(dirname);
use Getopt::Long qw(GetOptions);
+use Cwd qw(getcwd);
+
use constant TEST_SUITE_ATTRIBUTES => ('name', 'tests', 'skipped', 'errors', 'failures', 'time');
use constant TEST_CASE_ATTRIBUTES => ('name', 'assertions', 'time');
@@ -63,7 +65,19 @@ sub launch($$$)
my $out;
my $err;
- eval {run3($test_exec, \$in, \$out, \$err)};
+ my($path, $filename) = $test_exec =~ m{(.+)/([^/]+)$};
+
+ if ($path ne '.')
+ {
+ my $current_dir = getcwd();
+ chdir $path;
+ eval {run3('./' . $filename, \$in, \$out, \$err)};
+ chdir $current_dir;
+ }
+ else
+ {
+ eval {run3($test_exec, \$in, \$out, \$err)};
+ }
if ($@) # something went wrong with run3()
{
@@ -112,6 +126,7 @@ while (my $path = $iter->())
next unless ($path->is_file());
next unless ($path->basename =~ qr/^(.+)\.yaml$/);
next unless (not defined $target_suite or $1 eq $target_suite);
+ next if ($path->basename =~ qr/^(.+)\.inc\.yaml$/);
my $test_suite = {
'name' => $1,