Skip to content

[SEC-180] Add ability to run tests for specific OS based on tags #1929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions regression/test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ ($$$$$$$$$)
# not given (implying run all tests) or it matches at least one include-tag.

my $include_tags_length = @$include_tags;
# If any include tags are passed then only include tests including those tags
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the change is great.

my $passes_tag_tests = ($include_tags_length == 0);
foreach my $include_tag (@$include_tags) {
if(exists($tags_set{$include_tag})) {
Expand All @@ -104,6 +105,19 @@ ($$$$$$$$$)
}
}

# Exclude tests that have an OS- tag that doesn't match the current
# architecture
my $os;
if($^O eq "linux") { $os = "LINUX" }
if($^O eq "cygwin") { $os = "WINDOWS" }
if($^O eq "msys") { $os = "WINDOWS" }
if($^O eq "MSWin32") { $os = "WINDOWS" }
if($^O eq "darwin") { $os = "MACOS" }

if(not exists($tags_set{"OS-" . $os}) and grep { "OS-" eq substr($_, 0, length("OS-")) } @tags) {
$passes_tag_tests = 0;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not confident about this one. The surrounding environment has already solved this problem: CMake surely comes up with some identifier of the operating system (here, the crucial one will be WIN32), and we've got a solution for Make in src/common.

# If the 4th line is activate-multi-line-match we enable multi-line checks
if($grep_options ne "activate-multi-line-match") {
# No such flag, so we add it back in
Expand Down