From 21f502d397376dc8b76df183a1d82ac0a8fd1b54 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Wed, 24 Feb 2021 16:18:18 -0800 Subject: [PATCH] add app tests for command line options --- CMake/teca_app.cmake | 1 + CMake/teca_python.cmake | 1 + test/apps/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/CMake/teca_app.cmake b/CMake/teca_app.cmake index fbaa0e923..82bb06234 100644 --- a/CMake/teca_app.cmake +++ b/CMake/teca_app.cmake @@ -31,6 +31,7 @@ function (teca_add_app app_name) teca_system teca_core teca_data teca_io teca_alg ${APP_LIBS}) endif() + set_target_properties(${app_name} PROPERTIES APP_TYPE C++) install(TARGETS ${app_name} RUNTIME DESTINATION ${BIN_PREFIX}) else() message(STATUS "command line application ${app_name} -- disabled") diff --git a/CMake/teca_python.cmake b/CMake/teca_python.cmake index 181136529..b94dcb80c 100644 --- a/CMake/teca_python.cmake +++ b/CMake/teca_python.cmake @@ -61,6 +61,7 @@ function (teca_add_python_app app_name) set(APP_SOURCES "${app_name}.in") endif() add_custom_target(${app_name}) + set_target_properties(${app_name} PROPERTIES APP_TYPE Python) teca_py_install_apps(${APP_SOURCES}) else() message(STATUS "command line application ${app_name} -- disabled") diff --git a/test/apps/CMakeLists.txt b/test/apps/CMakeLists.txt index 75681fccc..007e11c58 100644 --- a/test/apps/CMakeLists.txt +++ b/test/apps/CMakeLists.txt @@ -442,3 +442,36 @@ teca_add_app_test(test_cf_restripe_app_mpi teca_cf_restripe ${MPIEXEC} ${TEST_CORES} FEATURES ${TECA_HAS_NETCDF_MPI} ${TECA_HAS_MPI} REQ_TECA_DATA) + +set(app_names + teca_bayesian_ar_detect + teca_cf_restripe + teca_convert_table + teca_deeplab_ar_detect + teca_event_filter + teca_integrated_vapor_transport + teca_metadata_probe + teca_profile_explorer + teca_tc_detect + teca_tc_stats + teca_tc_trajectory + teca_tc_trajectory_scalars + teca_tc_wind_radii + teca_tc_wind_radii_stats + teca_temporal_reduction) + +foreach (app_name ${app_names}) + teca_add_app_test(${app_name}_help ${app_name} + COMMAND ${CMAKE_BINARY_DIR}/${BIN_PREFIX}/${app_name} --help) + + get_target_property(app_type ${app_name} APP_TYPE) + if ("${app_type}" STREQUAL "C++") + + teca_add_app_test(${app_name}_full_help ${app_name} + COMMAND ${CMAKE_BINARY_DIR}/${BIN_PREFIX}/${app_name} --full_help) + + teca_add_app_test(${app_name}_advanced_help ${app_name} + COMMAND ${CMAKE_BINARY_DIR}/${BIN_PREFIX}/${app_name} --advanced_help) + + endif() +endforeach()