From 818f926eb0ad1cdb3ca60a9f08682b50df4094e3 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 17 Nov 2015 13:16:33 +0100 Subject: Tests: add luacheck for linting tests Source: https://github.com/mpeterv/luacheck Docs: http://luacheck.readthedocs.org/en/0.12.0/index.html Run via "make testlint". --- cmake/RunTestsLint.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cmake/RunTestsLint.cmake (limited to 'cmake') diff --git a/cmake/RunTestsLint.cmake b/cmake/RunTestsLint.cmake new file mode 100644 index 0000000000..cf5465803e --- /dev/null +++ b/cmake/RunTestsLint.cmake @@ -0,0 +1,11 @@ +execute_process( + COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} + WORKING_DIRECTORY ${TEST_DIR} + ERROR_VARIABLE err + RESULT_VARIABLE res + ${EXTRA_ARGS}) + +if(NOT res EQUAL 0) + message(STATUS "Output to stderr:\n${err}") + message(FATAL_ERROR "Linting tests failed with error: ${res}.") +endif() -- cgit