From 42d5b526b9cbd067509e68ce6514a37e04df928a Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Mon, 29 Sep 2014 09:43:52 -0300 Subject: test: Replace vroom by lua/busted for functional tests The 'lupa' python package provides a simple way to seamless integrate lua and python code. This commit replaces vroom by a python script that exposes the 'neovim' package to a lua state, and invokes busted to run functional tests. This is a temporary solution that will enable writing functional tests using lua/bused while a lua client library is not available. The reason for dropping vroom is flexibility: Lua/busted has a nice DSL-style syntax while also providing the customization power of a full programming language. Another reason is to use a single framework for unit/functional tests. Two other changes were performed in this commit: - Instead of "gcc-unittest/gcc-ia32", the travis builds for gcc are now identified by "gcc/gcc-32". They will run unit/functional tests for both 64 and 32 bits. - Old integration tests(in src/nvim/testdir) are now ran by the 'oldtest' target --- cmake/RunTests.cmake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 cmake/RunTests.cmake (limited to 'cmake/RunTests.cmake') diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake new file mode 100644 index 0000000000..dc02ce5400 --- /dev/null +++ b/cmake/RunTests.cmake @@ -0,0 +1,23 @@ +get_filename_component(BUSTED_DIR ${BUSTED_PRG} PATH) +set(ENV{PATH} "${BUSTED_DIR}:$ENV{PATH}") +if(DEFINED ENV{TEST_FILE}) + set(TEST_DIR $ENV{TEST_FILE}) +endif() + +if(TEST_TYPE STREQUAL "functional") + execute_process( + COMMAND python ${BUSTED_PRG} ${BUSTED_REAL_PRG} -v -o + ${BUSTED_OUTPUT_TYPE} --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/legacy + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE res) +else() + execute_process( + COMMAND ${BUSTED_PRG} -v -o ${BUSTED_OUTPUT_TYPE} + --lpath=${BUILD_DIR}/?.lua ${TEST_DIR}/unit + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE res) +endif() + +if(NOT res EQUAL 0) + message(FATAL_ERROR "Unit tests failed.") +endif() -- cgit