Skip to content

Commit

Permalink
Add CLI tests with the broken OSWs, expect them to fail (they don't w…
Browse files Browse the repository at this point in the history
…ith current C++ CLI)
  • Loading branch information
jmarrec committed Nov 7, 2024
1 parent 52a5116 commit a3c8f24
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> 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 $<TARGET_FILE:openstudio> "${CMAKE_CURRENT_SOURCE_DIR}/test/test_loglevel.py"
Expand Down

0 comments on commit a3c8f24

Please sign in to comment.