diff options
Diffstat (limited to '')
-rw-r--r-- | tools/lint/CMakeLists.txt | 48 |
1 files changed, 6 insertions, 42 deletions
diff --git a/tools/lint/CMakeLists.txt b/tools/lint/CMakeLists.txt index 32cdcbf..14f8b76 100644 --- a/tools/lint/CMakeLists.txt +++ b/tools/lint/CMakeLists.txt @@ -17,6 +17,12 @@ set(lintsrc cmd_load.c cmd_print.c cmd_searchpath.c + cmd_extdata.c + cmd_help.c + cmd_verb.c + cmd_debug.c + yl_opt.c + yl_schema_features.c common.c ) if(YANGLINT_INTERACTIVE) @@ -46,45 +52,3 @@ if(WIN32) target_include_directories(yanglint PRIVATE ${GETOPT_INCLUDE_DIR}) target_link_libraries(yanglint ${GETOPT_LIBRARY}) endif() - -# -# tests -# -function(add_yanglint_test) - cmake_parse_arguments(ADDTEST "" "NAME;VIA;SCRIPT" "" ${ARGN}) - set(TEST_NAME yanglint_${ADDTEST_NAME}) - - if(${ADDTEST_VIA} STREQUAL "bash") - set(WRAPPER /usr/bin/env bash) - elseif(${ADDTEST_VIA} STREQUAL "expect") - set(WRAPPER ${PATH_EXPECT}) - else() - message(FATAL_ERROR "build: unexpected wrapper '${ADDTEST_VIA}'") - endif() - - add_test(NAME ${TEST_NAME} COMMAND ${WRAPPER} ${CMAKE_CURRENT_SOURCE_DIR}/tests/${ADDTEST_SCRIPT}) - set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "YANGLINT=${PROJECT_BINARY_DIR}/yanglint") - set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "YANG_MODULES_DIR=${PROJECT_SOURCE_DIR}/tests/modules/yang") - set_property(TEST ${TEST_NAME} APPEND PROPERTY ENVIRONMENT "CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}") -endfunction(add_yanglint_test) - -if(ENABLE_TESTS) - # tests of non-interactive mode using shunit2 - find_program(PATH_SHUNIT NAMES shunit2) - if(NOT PATH_SHUNIT) - message(WARNING "'shunit2' not found! The yanglint(1) non-interactive tests will not be available.") - else() - add_yanglint_test(NAME ni_list VIA bash SCRIPT shunit2/list.sh) - add_yanglint_test(NAME ni_feature VIA bash SCRIPT shunit2/feature.sh) - endif() - - # tests of interactive mode using expect - find_program(PATH_EXPECT NAMES expect) - if(NOT PATH_EXPECT) - message(WARNING "'expect' not found! The yanglint(1) interactive tests will not be available.") - elseif(YANGLINT_INTERACTIVE) - add_yanglint_test(NAME in_list VIA expect SCRIPT expect/list.exp) - add_yanglint_test(NAME in_feature VIA expect SCRIPT expect/feature.exp) - add_yanglint_test(NAME in_completion VIA expect SCRIPT expect/completion.exp) - endif() -endif() |