Skip to content

Commit

Permalink
Run all tests with debug symbols.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Aug 20, 2020
1 parent de24c6c commit 2387ed3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ foreach(TERRA_TEST ${TERRA_TESTS})
COMMAND $<TARGET_FILE:TerraExecutable> ${TERRA_TEST}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests
)
# again, with debug symbols
add_test(NAME ${TERRA_TEST}
COMMAND $<TARGET_FILE:TerraExecutable> -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)
Expand Down
13 changes: 9 additions & 4 deletions tests/run
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 2387ed3

Please sign in to comment.