Skip to content

Commit

Permalink
Changed in Travis compiler for OS X to gcc
Browse files Browse the repository at this point in the history
Fixed one test in catalog2 for OSX in Travis - thanks Diego Dupin
  • Loading branch information
lawrinn committed Jan 22, 2019
1 parent 8ce8fd5 commit 45e4669
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -52,7 +52,7 @@ matrix:
compiler: clang
env: DB=mariadb:10.3
- os: osx
compiler: clang
compiler: gcc
env: DB=mariadb:10.3
- os: linux
env: DB=mariadb:10.2 PACKET=8M MAXSCALE_VERSION=2.1.8
Expand Down
15 changes: 15 additions & 0 deletions ma_debug.c
Expand Up @@ -140,4 +140,19 @@ void ma_print_value(SQLSMALLINT OdbcType, SQLPOINTER Value, SQLLEN octets)
break;
}
}

/* #ifdef __APPLE__
void TravisTrace(char *format, va_list args)
{
BOOL Travis= FALSE;
Travis= getenv("TRAVIS") != NULL;
if (Travis != FALSE)
{
printf("#");
vprintf(format, args);
}
}
#endif */
#endif
6 changes: 3 additions & 3 deletions test/catalog2.c
Expand Up @@ -286,7 +286,7 @@ ODBC_TEST(t_bug50195)
OK_SIMPLE_STMT(Stmt, "DROP TABLE IF EXISTS bug50195");
OK_SIMPLE_STMT(Stmt, "CREATE TABLE bug50195 (i INT NOT NULL)");

if (Travis != 0)
if (Travis != 0 && TravisOnOsx == 0)
{
diag("Test is run in Travis");
SQLExecDirect(Stmt, (SQLCHAR *)"DROP USER bug50195@'%'", SQL_NTS);
Expand Down Expand Up @@ -320,7 +320,7 @@ ODBC_TEST(t_bug50195)
{
diag("Couldn't connect with new user of allocate the stmt");

if (Travis)
if (Travis != 0 && TravisOnOsx == 0)
{
OK_SIMPLE_STMT(Stmt, "DROP USER bug50195@'%'");
}
Expand Down Expand Up @@ -352,7 +352,7 @@ ODBC_TEST(t_bug50195)
CHECK_DBC_RC(hdbc1, SQLDisconnect(hdbc1));
CHECK_DBC_RC(hdbc1, SQLFreeConnect(hdbc1));

if (Travis)
if (Travis != 0 && TravisOnOsx == 0)
{
OK_SIMPLE_STMT(Stmt, "DROP USER bug50195@'%'");
}
Expand Down
7 changes: 6 additions & 1 deletion test/tap.h
Expand Up @@ -135,7 +135,7 @@ static SQLINTEGER OdbcVer= SQL_OV_ODBC3;
static unsigned int my_port= 3306;
char ma_strport[12]= ";PORT=3306";

static int Travis= 0;
static int Travis= 0, TravisOnOsx= 0;

/* To use in tests for conversion of strings to (sql)wchar strings */
SQLWCHAR sqlwchar_buff[8192], sqlwchar_empty[]= {0};
Expand Down Expand Up @@ -944,7 +944,12 @@ int run_tests_ex(MA_ODBC_TESTS *tests, BOOL ProvideWConnection)
if (getenv("TRAVIS") != NULL)
{
Travis= 1;
if (_stricmp(getenv("TRAVIS_OS_NAME"), "osx") == 0)
{
TravisOnOsx= 1;
}
}

if (ODBC_Connect(&Env,&Connection,&Stmt) == FAIL)
{
odbc_print_error(SQL_HANDLE_DBC, Connection);
Expand Down

0 comments on commit 45e4669

Please sign in to comment.