Skip to content

Commit

Permalink
MTR flag to mark tests as incompatible with macOS
Browse files Browse the repository at this point in the history
Introduces a new MTR include, not_mac.inc, which when included
at the top of a test, prevents that test from running on macOS.
  • Loading branch information
DaveGosselin-MariaDB committed May 15, 2024
1 parent b86a2f0 commit f97383b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mysql-test/include/not_mac.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# suite.pm will make sure that all tests including this file
# will be skipped if run under macOS
#
10 changes: 9 additions & 1 deletion mysql-test/lib/My/Platform.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use File::Path;
use Carp;

use base qw(Exporter);
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX
our @EXPORT= qw(IS_CYGWIN IS_MSYS IS_WINDOWS IS_WIN32PERL IS_AIX IS_MAC
native_path posix_path mixed_path
check_socket_path_length process_alive open_for_append);

Expand Down Expand Up @@ -70,6 +70,14 @@ BEGIN {
}
}

BEGIN {
if ($^O eq "darwin") {
eval 'sub IS_MAC { 1 }';
}
else {
eval 'sub IS_MAC { 0 }';
}
}

#
# native_path
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/main/json_normalize.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Test doesn't work on macOS.
--source include/not_mac.inc

set names utf8;

create table t1 (json json);
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ sub skip_combinations {

$skip{'include/not_windows.inc'} = 'Requires not Windows' if IS_WINDOWS;
$skip{'include/not_aix.inc'} = 'Requires not AIX' if IS_AIX;

$skip{'include/not_mac.inc'} = 'Requires not macOS' if IS_MAC;
$skip{'main/plugin_loaderr.test'} = 'needs compiled-in innodb'
unless $::mysqld_variables{'innodb'} eq "ON";

Expand Down

0 comments on commit f97383b

Please sign in to comment.