From 2387ed316cbea448f786d4926afe4baa802eab7a Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Thu, 20 Aug 2020 11:36:09 -0700 Subject: [PATCH] Run all tests with debug symbols. --- src/CMakeLists.txt | 5 +++++ tests/run | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5de3e5341..726a52e31 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -386,6 +386,11 @@ foreach(TERRA_TEST ${TERRA_TESTS}) COMMAND $ ${TERRA_TEST} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests ) + # again, with debug symbols + add_test(NAME ${TERRA_TEST} + COMMAND $ -mg ${TERRA_TEST} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests + ) endforeach() foreach(TERRA_TEST ${TERRA_TESTS_INSTALL}) get_filename_component(TERRA_TEST_DIR ${TERRA_TEST} DIRECTORY) diff --git a/tests/run b/tests/run index 58e5c194a..dabdf5823 100755 --- a/tests/run +++ b/tests/run @@ -32,10 +32,15 @@ for line in io.popen(lscmd):lines() do end local file = line:match("^([^/]*%.t)$") or line:match("^(fails/[^/]*%.t)$") if file then - print(file .. ":") - local execstring = getcommand(file) .. " " .. file - local result = os.execute(execstring) - if type(result) == "number" and result == 0 or result == true then + local pass = true + for test_debug = 0, 1 do + debug_flag = test_debug == 1 and "-mg" or "" + print(debug_flag .. file .. ":") + local execstring = getcommand(file) .. " " .. file + local result = os.execute(execstring) + pass = pass and (type(result) == "number" and result == 0 or result == true) + end + if pass then table.insert(passed,file) else --error("fail")