diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt index e41b1833798..dced056736a 100644 --- a/src/cli/CMakeLists.txt +++ b/src/cli/CMakeLists.txt @@ -87,119 +87,125 @@ if(BUILD_TESTING) COMMAND $ --help ) - add_test(NAME OpenStudioCLI.run_compact_ruby_only_osw - COMMAND $ run -w compact_ruby_only.osw + add_test(NAME OpenStudioCLI.Classic.run_compact_ruby_only_osw + COMMAND $ classic run -w compact_ruby_only.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.run_compact_ruby_only_osw PROPERTIES RESOURCE_LOCK "compact_osw") + set_tests_properties(OpenStudioCLI.Classic.run_compact_ruby_only_osw PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.openstudio_version - COMMAND $ labs openstudio_version + add_test(NAME OpenStudioCLI.openstudio_version + COMMAND $ openstudio_version ) - add_test(NAME OpenStudioCLI.Labs.energyplus_version - COMMAND $ labs energyplus_version + add_test(NAME OpenStudioCLI.energyplus_version + COMMAND $ energyplus_version ) - add_test(NAME OpenStudioCLI.Labs.ruby_version - COMMAND $ labs ruby_version + add_test(NAME OpenStudioCLI.ruby_version + COMMAND $ ruby_version ) - add_test(NAME OpenStudioCLI.Labs.python_version - COMMAND $ labs python_version + add_test(NAME OpenStudioCLI.python_version + COMMAND $ python_version ) - set_tests_properties(OpenStudioCLI.Labs.python_version PROPERTIES + set_tests_properties(OpenStudioCLI.python_version PROPERTIES PASS_REGULAR_EXPRESSION "3\.8\.1[0-9]" ) - add_test(NAME OpenStudioCLI.Labs.ruby_execute_line - COMMAND $ labs -e "puts(OpenStudio::Model::Model.new())" + add_test(NAME OpenStudioCLI.ruby_execute_line + COMMAND $ -e "puts(OpenStudio::Model::Model.new())" ) - add_test(NAME OpenStudioCLI.ruby_execute_line_no_chop_single_quote - COMMAND $ -e "puts 'hello world'" + add_test(NAME OpenStudioCLI.Classic.ruby_execute_line_no_chop_single_quote + COMMAND $ classic -e "puts 'hello world'" ) - add_test(NAME OpenStudioCLI.Labs.ruby_execute_line_no_chop_single_quote - COMMAND $ labs -e "puts 'hello world'" + add_test(NAME OpenStudioCLI.ruby_execute_line_no_chop_single_quote + COMMAND $ -e "puts 'hello world'" ) - add_test(NAME OpenStudioCLI.Labs.ruby_execute_line.embedded_gem - COMMAND $ labs -e "require 'minitest'" + add_test(NAME OpenStudioCLI.ruby_execute_line.embedded_gem + COMMAND $ -e "require 'minitest'" ) - add_test(NAME OpenStudioCLI.Labs.ruby_execute_line.embedded_native_gem - COMMAND $ labs -e "require 'oga'" + add_test(NAME OpenStudioCLI.ruby_execute_line.embedded_native_gem + COMMAND $ -e "require 'oga'" ) - add_test(NAME OpenStudioCLI.Labs.python_execute_line - COMMAND $ labs -c "print(openstudio.model.Model())" + add_test(NAME OpenStudioCLI.python_execute_line + COMMAND $ -c "print(openstudio.model.Model())" ) - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script - COMMAND $ labs execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb OpenStudioLabs "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_ruby_script + COMMAND $ execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb OpenStudioLabs "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script PROPERTIES PASS_REGULAR_EXPRESSION "Hello from OpenStudioLabs, at National Renewable Energy Laboratory" ) # Ensure we don't get these # > eval:1: warning: already initialized constant OpenStudio::Airflow::AirflowElement::DR_DOOR # > eval:1: warning: previous definition of DR_DOOR was here - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.no_previous_definition - COMMAND $ labs execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb OpenStudioLabs "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_ruby_script.no_previous_definition + COMMAND $ execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb OpenStudioLabs "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script.no_previous_definition PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script.no_previous_definition PROPERTIES FAIL_REGULAR_EXPRESSION "previous definition of;already initialized constant" ) - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags - COMMAND $ labs execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb -x "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags + COMMAND $ execute_ruby_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb -x "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script.forward_flags PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at National Renewable Energy Laboratory" ) - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags.omit_execute - COMMAND $ labs ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb -x "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.omit_execute + COMMAND $ ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_ruby_script_with_arguments_test.rb -x "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script.forward_flags PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at National Renewable Energy Laboratory" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script - COMMAND $ labs execute_python_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py OpenStudioLabs "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_python_script + COMMAND $ execute_python_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py OpenStudioLabs "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_python_script PROPERTIES + set_tests_properties(OpenStudioCLI.execute_python_script PROPERTIES PASS_REGULAR_EXPRESSION "Hello from OpenStudioLabs, at National Renewable Energy Laboratory" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.forward_flags - COMMAND $ labs execute_python_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py -x "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_python_script.forward_flags + COMMAND $ execute_python_script ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py -x "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_python_script.forward_flags PROPERTIES + set_tests_properties(OpenStudioCLI.execute_python_script.forward_flags PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at National Renewable Energy Laboratory" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.forward_flags.omit_execute - COMMAND $ labs ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py -x "National Renewable Energy Laboratory" + add_test(NAME OpenStudioCLI.execute_python_script.forward_flags.omit_execute + COMMAND $ ${CMAKE_CURRENT_SOURCE_DIR}/test/execute_python_script_with_arguments_test.py -x "National Renewable Energy Laboratory" ) - set_tests_properties(OpenStudioCLI.Labs.execute_python_script.forward_flags PROPERTIES + set_tests_properties(OpenStudioCLI.execute_python_script.forward_flags PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at National Renewable Energy Laboratory" ) + add_test(NAME OpenStudioCLI.Classic.Run_RubyOnly + COMMAND $ classic run -w compact_ruby_only.osw + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" + ) + set_tests_properties(OpenStudioCLI.Classic.Run_RubyOnly PROPERTIES RESOURCE_LOCK "compact_osw") + add_test(NAME OpenStudioCLI.Run_RubyOnly COMMAND $ run -w compact_ruby_only.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) set_tests_properties(OpenStudioCLI.Run_RubyOnly PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.Run_RubyOnly - COMMAND $ labs run -w compact_ruby_only.osw + + add_test(NAME OpenStudioCLI.Classic.Run_RubyOnly.absolute_path + COMMAND $ classic run -w "'${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/compact_ruby_only.osw'" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.Labs.Run_RubyOnly PROPERTIES RESOURCE_LOCK "compact_osw") - + set_tests_properties(OpenStudioCLI.Classic.Run_RubyOnly.absolute_path PROPERTIES RESOURCE_LOCK "compact_osw") add_test(NAME OpenStudioCLI.Run_RubyOnly.absolute_path COMMAND $ run -w "'${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/compact_ruby_only.osw'" @@ -207,53 +213,47 @@ if(BUILD_TESTING) ) set_tests_properties(OpenStudioCLI.Run_RubyOnly.absolute_path PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.Run_RubyOnly.absolute_path - COMMAND $ labs run -w "'${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/compact_ruby_only.osw'" - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" - ) - set_tests_properties(OpenStudioCLI.Labs.Run_RubyOnly.absolute_path PROPERTIES RESOURCE_LOCK "compact_osw") - - add_test(NAME OpenStudioCLI.Labs.Run_PythonOnly - COMMAND $ labs run -w compact_python_only.osw + add_test(NAME OpenStudioCLI.Run_PythonOnly + COMMAND $ run -w compact_python_only.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.Labs.Run_PythonOnly PROPERTIES RESOURCE_LOCK "compact_osw") + set_tests_properties(OpenStudioCLI.Run_PythonOnly PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.Run_PythonOnly_TwoMeasure - COMMAND $ labs run -w compact_python_only_twomeasures.osw + add_test(NAME OpenStudioCLI.Run_PythonOnly_TwoMeasure + COMMAND $ run -w compact_python_only_twomeasures.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.Labs.Run_PythonOnly_TwoMeasure PROPERTIES RESOURCE_LOCK "compact_osw") + set_tests_properties(OpenStudioCLI.Run_PythonOnly_TwoMeasure PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.Run_RubyPython - COMMAND $ labs run -w compact_ruby_then_python.osw + add_test(NAME OpenStudioCLI.Run_RubyPython + COMMAND $ run -w compact_ruby_then_python.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.Labs.Run_RubyPython PROPERTIES RESOURCE_LOCK "compact_osw") + set_tests_properties(OpenStudioCLI.Run_RubyPython PROPERTIES RESOURCE_LOCK "compact_osw") - add_test(NAME OpenStudioCLI.Labs.Run_PythonRuby - COMMAND $ labs run -w compact_python_then_ruby.osw + add_test(NAME OpenStudioCLI.Run_PythonRuby + COMMAND $ run -w compact_python_then_ruby.osw WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/resources/Examples/compact_osw/" ) - set_tests_properties(OpenStudioCLI.Labs.Run_PythonRuby PROPERTIES RESOURCE_LOCK "compact_osw") + set_tests_properties(OpenStudioCLI.Run_PythonRuby PROPERTIES RESOURCE_LOCK "compact_osw") if (Pytest_AVAILABLE) - add_test(NAME OpenStudioCLI.Labs.test_loglevel + 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" ) else() # TODO: Remove. Fallback on these for now, as I don't know if CI has pytest installed - add_test(NAME OpenStudioCLI.test_logger_rb - COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.rb + add_test(NAME OpenStudioCLI.Classic.test_logger_rb + COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ --classic ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.rb ) - add_test(NAME OpenStudioCLI.Labs.test_logger_rb - COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ --labs ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.rb + add_test(NAME OpenStudioCLI.test_logger_rb + COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.rb ) - add_test(NAME OpenStudioCLI.Labs.test_logger_py - COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ --labs ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.py + add_test(NAME OpenStudioCLI.test_logger_py + COMMAND ${Python_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/test/run_test_logger.py" $ ${CMAKE_CURRENT_SOURCE_DIR}/test/logger_test.py ) endif() @@ -269,77 +269,77 @@ if(BUILD_TESTING) # Test via optparse and check file exists # Historical CLI versions - add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.optparse.path_forwardslash - COMMAND $ execute_ruby_script execute_ruby_script_optparse_path.rb -x "./test_folder/hello.xml" + add_test(NAME OpenStudioCLI.Classic.execute_ruby_script.forward_flags.optparse.path_forwardslash + COMMAND $ classic execute_ruby_script execute_ruby_script_optparse_path.rb -x "./test_folder/hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) if (WIN32) # Posix paths don't understand a backward slash anyways - add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.optparse.path_backwardslash - COMMAND $ execute_ruby_script execute_ruby_script_optparse_path.rb -x ".\\test_folder\\hello.xml" + add_test(NAME OpenStudioCLI.Classic.execute_ruby_script.forward_flags.optparse.path_backwardslash + COMMAND $ classic execute_ruby_script execute_ruby_script_optparse_path.rb -x ".\\test_folder\\hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) endif() # Labs versions - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags.optparse.path_forwardslash - COMMAND $ labs execute_ruby_script execute_ruby_script_optparse_path.rb -x "./test_folder/hello.xml" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.optparse.path_forwardslash + COMMAND $ execute_ruby_script execute_ruby_script_optparse_path.rb -x "./test_folder/hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) if (WIN32) - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags.optparse.path_backwardslash - COMMAND $ labs execute_ruby_script execute_ruby_script_optparse_path.rb -x ".\\test_folder\\hello.xml" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.optparse.path_backwardslash + COMMAND $ execute_ruby_script execute_ruby_script_optparse_path.rb -x ".\\test_folder\\hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) endif() # Historical CLI versions - add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.path_forwardslash - COMMAND $ execute_ruby_script execute_ruby_script_with_arguments_test.rb -x "./test_folder/hello.xml" + add_test(NAME OpenStudioCLI.Classic.execute_ruby_script.forward_flags.path_forwardslash + COMMAND $ classic execute_ruby_script execute_ruby_script_with_arguments_test.rb -x "./test_folder/hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags.path_forwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.Classic.execute_ruby_script.forward_flags.path_forwardslash PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at ./test_folder/hello.xml" ) - add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.path_backwardslash - COMMAND $ execute_ruby_script execute_ruby_script_with_arguments_test.rb -x ".\\test_folder\\hello.xml" + add_test(NAME OpenStudioCLI.Classic.execute_ruby_script.forward_flags.path_backwardslash + COMMAND $ classic execute_ruby_script execute_ruby_script_with_arguments_test.rb -x ".\\test_folder\\hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags.path_backwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.Classic.execute_ruby_script.forward_flags.path_backwardslash PROPERTIES # Cmake regexes require double escaping the \ escape, this tests that `Hello from -x, at .\test_folder\hello.xml` is printed to the console PASS_REGULAR_EXPRESSION "Hello from -x, at .\\\\test_folder\\\\hello.xml" ) # Labs versions - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags.path_forwardslash - COMMAND $ labs execute_ruby_script execute_ruby_script_with_arguments_test.rb -x "./test_folder/hello.xml" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.path_forwardslash + COMMAND $ execute_ruby_script execute_ruby_script_with_arguments_test.rb -x "./test_folder/hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script.forward_flags.path_forwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags.path_forwardslash PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at ./test_folder/hello.xml" ) - add_test(NAME OpenStudioCLI.Labs.execute_ruby_script.forward_flags.path_backwardslash - COMMAND $ labs execute_ruby_script execute_ruby_script_with_arguments_test.rb -x ".\\test_folder\\hello.xml" + add_test(NAME OpenStudioCLI.execute_ruby_script.forward_flags.path_backwardslash + COMMAND $ execute_ruby_script execute_ruby_script_with_arguments_test.rb -x ".\\test_folder\\hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.Labs.execute_ruby_script.forward_flags.path_backwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.execute_ruby_script.forward_flags.path_backwardslash PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at .\\\\test_folder\\\\hello.xml" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.forward_flags.path_forwardslash - COMMAND $ labs execute_python_script execute_python_script_with_arguments_test.py -x "./test_folder/hello.xml" + add_test(NAME OpenStudioCLI.execute_python_script.forward_flags.path_forwardslash + COMMAND $ execute_python_script execute_python_script_with_arguments_test.py -x "./test_folder/hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.Labs.execute_python_script.forward_flags.path_forwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.execute_python_script.forward_flags.path_forwardslash PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at ./test_folder/hello.xml" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.forward_flags.path_backwardslash - COMMAND $ labs execute_python_script execute_python_script_with_arguments_test.py -x ".\\test_folder\\hello.xml" + add_test(NAME OpenStudioCLI.execute_python_script.forward_flags.path_backwardslash + COMMAND $ execute_python_script execute_python_script_with_arguments_test.py -x ".\\test_folder\\hello.xml" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - set_tests_properties(OpenStudioCLI.Labs.execute_python_script.forward_flags.path_backwardslash PROPERTIES + set_tests_properties(OpenStudioCLI.execute_python_script.forward_flags.path_backwardslash PROPERTIES PASS_REGULAR_EXPRESSION "Hello from -x, at .\\\\test_folder\\\\hello.xml" ) @@ -378,21 +378,21 @@ if(BUILD_TESTING) message(DEBUG "PYTHON_PATH=${PYTHON_PATH}") - add_test(NAME OpenStudioCLI.Labs.execute_python_script.numpy.explicit_sys_path_insert - COMMAND $ labs execute_python_script execute_python_script_with_numpy.py ${Python_STDLIB} + add_test(NAME OpenStudioCLI.execute_python_script.numpy.explicit_sys_path_insert + COMMAND $ execute_python_script execute_python_script_with_numpy.py ${Python_STDLIB} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.numpy.python_path - COMMAND $ labs + add_test(NAME OpenStudioCLI.execute_python_script.numpy.python_path + COMMAND $ "$<$:--python_path;$>" execute_python_script execute_python_script_with_numpy.py COMMAND_EXPAND_LISTS WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" ) - add_test(NAME OpenStudioCLI.Labs.execute_python_script.numpy.python_home - COMMAND $ labs + add_test(NAME OpenStudioCLI.execute_python_script.numpy.python_home + COMMAND $ --python_home "$" execute_python_script execute_python_script_with_numpy.py WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/" diff --git a/src/cli/main.cpp b/src/cli/main.cpp index a3ff19f3d97..04b54a51364 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -74,6 +74,12 @@ int main(int argc, char* argv[]) { openstudio::ScriptEngineInstance pythonEngine("pythonengine", args); if (is_classic) { + fmt::print(fmt::fg(fmt::color::orange), + "┌{0:─^{2}}┐\n" + "│{1: ^{2}}│\n" + "└{0:─^{2}}┘", + "", "The `classic` command is deprecated and will be removed in a future release", 80); + fmt::print("\n"); #if defined _WIN32 // Poor man's hack #4847 // Disable this logger, we have a duplicate in the ruby shared lib @@ -252,13 +258,13 @@ int main(int argc, char* argv[]) { }); // Not hidding any commands right now - // [[maybe_unused]] auto* list_commandsCommand = experimentalApp->add_subcommand("list_commands", "Lists the entire set of available commands"); + // [[maybe_unused]] auto* list_commandsCommand = app.add_subcommand("list_commands", "Lists the entire set of available commands"); // run command openstudio::cli::setupRunOptions(&app, rubyEngine, pythonEngine); // update (model) command - // openstudio::cli::setupUpdateCommand(experimentalApp); + // openstudio::cli::setupUpdateCommand(&app); { bool keep = false; auto* updateCommand = app.add_subcommand("update", "Updates OpenStudio Models to the current version"); diff --git a/src/cli/test/execute_python_script_with_numpy.py b/src/cli/test/execute_python_script_with_numpy.py index 8f205edbd3f..7b6ce5cf8be 100644 --- a/src/cli/test/execute_python_script_with_numpy.py +++ b/src/cli/test/execute_python_script_with_numpy.py @@ -23,7 +23,7 @@ def test_with_sys_path_explicit(std_lib: Path): if dynload.exists(): sys.path.insert(0, str(dynload)) # Only for debian - dist_pack = std_lib.parent.parent / 'local/lib/python3.8/dist-packages' + dist_pack = std_lib.parent.parent / "local/lib/python3.8/dist-packages" if dist_pack.exists(): sys.path.insert(0, str(dist_pack)) diff --git a/src/cli/test/run_test_logger.py b/src/cli/test/run_test_logger.py index 21d302cdd94..0d48f6246d3 100644 --- a/src/cli/test/run_test_logger.py +++ b/src/cli/test/run_test_logger.py @@ -13,17 +13,17 @@ def validate_file(arg): if __name__ == "__main__": parser = argparse.ArgumentParser(description="Run a logger test.") parser.add_argument("os_cli_path", type=validate_file, help="Path to the OS CLI") - parser.add_argument("--labs", action="store_true") + parser.add_argument("--classic", action="store_true", help="Use the classic/legacy CLI") parser.add_argument("logger_file", type=validate_file, help="Path to the logger test file to run") args = parser.parse_args() print(args) command = [str(args.os_cli_path)] - if args.labs: - command.append("labs") + if args.classic: + command.append("classic") if (ext := args.logger_file.suffix) == ".py": - if not args.labs: - raise ValueError("When supplying a .py file, you must pass --labs") + if args.classic: + raise ValueError("When supplying a .py file, you must NOT pass --classic") command.append("execute_python_script") elif ext == ".rb": command.append("execute_ruby_script") @@ -35,10 +35,10 @@ def validate_file(arg): r = subprocess.check_output(command, encoding="utf-8") lines = r.splitlines() - # Pop the labs box + # Pop the classic box i_warn = 0 for i, line in enumerate(lines): - if "The `labs` command is experimental - Do not use in production" in line: + if "The `classic` command is deprecated and will be removed in a future release" in line: i_warn = i break lines = lines[: (i_warn - 1)] + lines[(i_warn + 2) :] diff --git a/src/cli/test/test_loglevel.py b/src/cli/test/test_loglevel.py index 9be36b5846f..bd10a3dbcc6 100644 --- a/src/cli/test/test_loglevel.py +++ b/src/cli/test/test_loglevel.py @@ -14,14 +14,15 @@ ) -def remove_labs_box(lines: List[str]) -> List[str]: - """Pop the labs box.""" - i_warn = 0 +def remove_classic_box(lines: List[str]) -> List[str]: + """Pop the classic box.""" + i_warn = None for i, line in enumerate(lines): - if "The `labs` command is experimental - Do not use in production" in line: + if "The `classic` command is deprecated and will be removed in a future release" in line: i_warn = i break - lines = lines[: (i_warn - 1)] + lines[(i_warn + 2) :] + if i_warn is not None: + lines = lines[: (i_warn - 1)] + lines[(i_warn + 2) :] return lines @@ -38,13 +39,13 @@ def get_loglevel_int_value(logLevel: str) -> int: def test_loglevel(osclipath: Path, language: str, logLevel: str): list_index = get_loglevel_list_index(logLevel=logLevel) loglevel_int_value = get_loglevel_int_value(logLevel=logLevel) - args = [str(osclipath), "labs", "--loglevel", logLevel] + args = [str(osclipath), "--loglevel", logLevel] if language == "ruby": args += ["-e", RUBY_PROGRAM] else: args += ["-c", PYTHON_PROGRAM] lines = subprocess.check_output(args, encoding="utf-8").splitlines() - lines = remove_labs_box(lines) + lines = remove_classic_box(lines) assert f"Setting Log Level to {logLevel} ({loglevel_int_value})" in lines for i, msgLevel in enumerate(LOG_LEVELS): msg = f"[test] <{get_loglevel_int_value(msgLevel)}> {msgLevel}" @@ -66,8 +67,8 @@ def test_loglevel(osclipath: Path, language: str, logLevel: str): ) def test_run_logger_file(osclipath, language: str, is_labs: bool): command = [str(osclipath)] - if is_labs: - command.append("labs") + if not is_labs: + command.append("classic") if language == "ruby": command.append("execute_ruby_script") command.append(Path(__file__).parent / "logger_test.rb") @@ -79,7 +80,7 @@ def test_run_logger_file(osclipath, language: str, is_labs: bool): r = subprocess.check_output(command, encoding="utf-8") lines = r.splitlines() - lines = remove_labs_box(lines) + lines = remove_classic_box(lines) # Ruby when called this way has the openstudio logger messages first instead of last, so just sort lines.sort()