aboutsummaryrefslogtreecommitdiff
path: root/cmake/RunTestsLint.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/RunTestsLint.cmake')
-rw-r--r--cmake/RunTestsLint.cmake11
1 files changed, 11 insertions, 0 deletions
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()