From a3c8f240b6013f8197f0a9663f52893e04f7359d Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 7 Nov 2024 13:14:56 +0100 Subject: [PATCH] Add CLI tests with the broken OSWs, expect them to fail (they don't with current C++ CLI) --- src/cli/CMakeLists.txt | 57 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index 179c35f7a0..a264c4711f 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -270,6 +270,63 @@ if(BUILD_TESTING) PASS_REGULAR_EXPRESSION "HI FROM ERB PYTHON PLUGIN[\r\n\t ]*HI FROM JINJA PYTHON PLUGIN" ) + # ======================== Workflows should fail ======================== + add_test(NAME OpenStudioCLI.Run_Validate.MissingAMeasure + COMMAND $ run --show-stdout -w missing_a_measure.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Run_Validate.MissingAMeasure PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + + add_test(NAME OpenStudioCLI.Run_Validate.UnloadableMeasure + COMMAND $ run --show-stdout -w unloadable_measure.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Run_Validate.UnloadableMeasure PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + + add_test(NAME OpenStudioCLI.Run_Validate.WrongMeasureTypeOrder + COMMAND $ run --show-stdout -w wrong_measure_type_order.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Run_Validate.WrongMeasureTypeOrder PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + + # Classic + add_test(NAME OpenStudioCLI.Classic.Run_Validate.MissingAMeasure + COMMAND $ classic run --show-stdout -w missing_a_measure.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Classic.Run_Validate.MissingAMeasure PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + + add_test(NAME OpenStudioCLI.Classic.Run_Validate.UnloadableMeasure + COMMAND $ run --show-stdout -w unloadable_measure.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Classic.Run_Validate.UnloadableMeasure PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + + add_test(NAME OpenStudioCLI.Classic.Run_Validate.WrongMeasureTypeOrder + COMMAND $ run --show-stdout -w wrong_measure_type_order.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/workflow/invalid_measures/" + ) + set_tests_properties(OpenStudioCLI.Classic.Run_Validate.WrongMeasureTypeOrder PROPERTIES + WILL_FAIL TRUE + RESOURCE_LOCK "invalid_measures" + ) + # ====================== End Workflows should fail ====================== + if (Pytest_AVAILABLE) add_test(NAME OpenStudioCLI.test_loglevel COMMAND ${Python_EXECUTABLE} -m pytest --verbose ${Pytest_XDIST_OPTS} --os-cli-path $ "${CMAKE_CURRENT_SOURCE_DIR}/test/test_loglevel.py"