Skip to content

Commit a80b54a

Browse files
Add ability to run tests for specific OS based on tags
1 parent 08ad919 commit a80b54a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

regression/test.pl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ ($$$$$$$$$)
9191
# not given (implying run all tests) or it matches at least one include-tag.
9292

9393
my $include_tags_length = @$include_tags;
94+
# If any include tags are passed then only include tests including those tags
9495
my $passes_tag_tests = ($include_tags_length == 0);
9596
foreach my $include_tag (@$include_tags) {
9697
if(exists($tags_set{$include_tag})) {
@@ -104,6 +105,19 @@ ($$$$$$$$$)
104105
}
105106
}
106107

108+
# Exclude tests that have an OS- tag that doesn't match the current
109+
# architecture
110+
my $os;
111+
if($^O eq "linux") { $os = "LINUX" }
112+
if($^O eq "cygwin") { $os = "WINDOWS" }
113+
if($^O eq "msys") { $os = "WINDOWS" }
114+
if($^O eq "MSWin32") { $os = "WINDOWS" }
115+
if($^O eq "darwin") { $os = "MACOS" }
116+
117+
if(not exists($tags_set{"OS-" . $os}) and grep { "OS-" eq substr($_, 0, length("OS-")) } @tags) {
118+
$passes_tag_tests = 0;
119+
}
120+
107121
# If the 4th line is activate-multi-line-match we enable multi-line checks
108122
if($grep_options ne "activate-multi-line-match") {
109123
# No such flag, so we add it back in

0 commit comments

Comments
 (0)