MXS-3417 Indicate a skipped test with a special return value

This commit is contained in:
Esa Korhonen
2021-03-08 16:53:49 +02:00
parent d23f22a577
commit 19d999f8ee
2 changed files with 8 additions and 4 deletions

View File

@ -44,6 +44,7 @@ const StringSet recognized_mdbci_labels =
const int MDBCI_FAIL = 200; // Exit code when failure caused by MDBCI non-zero exit
const int BROKEN_VM_FAIL = 201; // Exit code when failure caused by broken VMs
const int TEST_SKIPPED = 202; // Exit code when skipping test. Should match value expected by cmake.
}
namespace maxscale
@ -210,7 +211,7 @@ TestConnections::TestConnections(int argc, char* argv[])
printf("-%c, --%s\n", o->val, o->name);
++o;
}
exit(0);
exit(TEST_SKIPPED);
}
break;
@ -353,7 +354,7 @@ TestConnections::TestConnections(int argc, char* argv[])
if (maxscale::require_columnstore)
{
cout << "ColumnStore testing is not yet implemented, skipping test" << endl;
exit(0);
exit(TEST_SKIPPED);
}
std::future<bool> repl_future;
@ -482,7 +483,7 @@ TestConnections::TestConnections(int argc, char* argv[])
tprintf("Test requires a higher version of backend servers, skipping test.");
tprintf("Required version: %s", maxscale::required_repl_version.c_str());
tprintf("Master-slave version: %s", ver_repl.c_str());
exit(0);
exit(TEST_SKIPPED);
}
}
@ -497,7 +498,7 @@ TestConnections::TestConnections(int argc, char* argv[])
tprintf("Test requires a higher version of backend servers, skipping test.");
tprintf("Required version: %s", maxscale::required_galera_version.c_str());
tprintf("Galera version: %s", ver_galera.c_str());
exit(0);
exit(TEST_SKIPPED);
}
}

View File

@ -1,5 +1,7 @@
# Default test timeout
set(TEST_TIMEOUT 3600)
# Return code for skipped tests
set(TEST_SKIP_RC 202)
# Adds linebreaks to curly brackets in a variable.
function(add_linebreaks source_var dest_var)
@ -36,6 +38,7 @@ function(add_test_properties name labels)
# Remove the LABELS-string from the list if it's there.
list(REMOVE_ITEM labels "LABELS")
set_property(TEST ${name} PROPERTY TIMEOUT ${TEST_TIMEOUT})
set_property(TEST ${name} PROPERTY SKIP_RETURN_CODE ${TEST_SKIP_RC})
set_property(TEST ${name} APPEND PROPERTY LABELS ${labels})
endfunction()