mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
presets: Diagnose invalid test filter index types
This commit is contained in:
@@ -252,6 +252,14 @@ void WORKFLOW_STEP_CONFIGURE_PRESET_MISMATCH(
|
||||
"\", but workflow configure preset is \"", workflowConfigurePreset, '"'));
|
||||
}
|
||||
|
||||
void INVALID_TEST_FILTER_INCLUDE_INDEX(Json::Value const* value,
|
||||
cmJSONState* state)
|
||||
{
|
||||
state->AddErrorAtValue(
|
||||
"Invalid \"filter.include.index\" field: expected a string or object",
|
||||
value);
|
||||
}
|
||||
|
||||
void NO_WORKFLOW_STEPS(std::string const& presetName, cmJSONState* state)
|
||||
{
|
||||
state->AddError(
|
||||
|
||||
@@ -98,6 +98,9 @@ void WORKFLOW_STEP_CONFIGURE_PRESET_MISMATCH(
|
||||
std::string const& stepConfigurePreset,
|
||||
std::string const& workflowConfigurePreset, cmJSONState* state);
|
||||
|
||||
void INVALID_TEST_FILTER_INCLUDE_INDEX(Json::Value const* value,
|
||||
cmJSONState* state);
|
||||
|
||||
void NO_WORKFLOW_STEPS(std::string const& presetName, cmJSONState* state);
|
||||
|
||||
void FIRST_WORKFLOW_STEP_NOT_CONFIGURE(std::string const& stepName,
|
||||
|
||||
@@ -162,6 +162,7 @@ bool TestPresetOptionalFilterIncludeIndexHelper(
|
||||
return TestPresetOptionalFilterIncludeIndexObjectHelper(out, value, state);
|
||||
}
|
||||
|
||||
cmCMakePresetsErrors::INVALID_TEST_FILTER_INCLUDE_INDEX(value, state);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
^CMake Error: Could not read presets from [^
|
||||
]*/Tests/RunCMake/CMakePresetsTest/InvalidFilterIncludeIndex:
|
||||
CMakePresets\.json:16: Invalid "filter.include.index" field: expected a string or object
|
||||
"index": 42
|
||||
\^$
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"version": 2,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "default",
|
||||
"generator": "@RunCMake_GENERATOR@",
|
||||
"binaryDir": "${sourceDir}/build"
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
{
|
||||
"name": "invalidIndex",
|
||||
"configurePreset": "default",
|
||||
"filter": {
|
||||
"include": {
|
||||
"index": 42
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -122,6 +122,7 @@ run_cmake_test_presets(ConditionFuture "" "" "x")
|
||||
run_cmake_test_presets(TestOutputTruncationUnsupported "" "" "x")
|
||||
run_cmake_test_presets(OutputJUnitUnsupported "" "" "x")
|
||||
run_cmake_test_presets(InvalidJobs "" "" "x")
|
||||
run_cmake_test_presets(InvalidFilterIncludeIndex "" "" "invalidIndex")
|
||||
run_cmake_test_presets(JobsProcUnsupported "" "" "x")
|
||||
run_cmake_test_presets(PassthroughUnsupported "" "" "x")
|
||||
set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
|
||||
|
||||
Reference in New Issue
Block a user