Skip to content

Commit

Permalink
tests: explicitly enable stack traces where needed (nim-lang#21236)
Browse files Browse the repository at this point in the history
* tests/assert/tassert_c.nim: explicitly enable stack traces

* tests/errmsgs: explicitly enable stack traces
  • Loading branch information
CyberTailor authored and capocasa committed Mar 31, 2023
1 parent df0e6df commit 09b4725
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion tests/assert/tassert_c.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
discard """
cmd: "nim $target $options -d:nimPreviewSlimSystem --excessiveStackTrace:off $file"
matrix: "-d:nimPreviewSlimSystem --stackTrace:on --excessiveStackTrace:off"
output: '''true'''
"""
import std/assertions
Expand Down
31 changes: 16 additions & 15 deletions tests/errmsgs/tproper_stacktrace.nim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
discard """
matrix: "--stackTrace:on --hint:all:off --warnings:off"
output: '''ok'''
"""
import strscans, strutils
Expand Down Expand Up @@ -76,10 +77,10 @@ when true:
bar()

const expectedStackTrace = """
tproper_stacktrace.nim(86) tproper_stacktrace
tproper_stacktrace.nim(76) foo
tproper_stacktrace.nim(73) bar
tproper_stacktrace.nim(7) raiseTestException
tproper_stacktrace.nim(87) tproper_stacktrace
tproper_stacktrace.nim(77) foo
tproper_stacktrace.nim(74) bar
tproper_stacktrace.nim(8) raiseTestException
"""

verifyStackTrace expectedStackTrace:
Expand All @@ -93,9 +94,9 @@ when true:
bar(x)

const expectedStackTrace = """
tproper_stacktrace.nim(103) tproper_stacktrace
tproper_stacktrace.nim(90) bar
tproper_stacktrace.nim(7) raiseTestException
tproper_stacktrace.nim(104) tproper_stacktrace
tproper_stacktrace.nim(91) bar
tproper_stacktrace.nim(8) raiseTestException
"""

verifyStackTrace expectedStackTrace:
Expand All @@ -110,10 +111,10 @@ when true:
bar()

const expectedStackTrace = """
tproper_stacktrace.nim(120) tproper_stacktrace
tproper_stacktrace.nim(110) foo
tproper_stacktrace.nim(107) bar
tproper_stacktrace.nim(7) raiseTestException
tproper_stacktrace.nim(121) tproper_stacktrace
tproper_stacktrace.nim(111) foo
tproper_stacktrace.nim(108) bar
tproper_stacktrace.nim(8) raiseTestException
"""

verifyStackTrace expectedStackTrace:
Expand All @@ -129,10 +130,10 @@ when true:
bar()

const expectedStackTrace = """
tproper_stacktrace.nim(139) tproper_stacktrace
tproper_stacktrace.nim(129) foo
tproper_stacktrace.nim(125) baz
tproper_stacktrace.nim(7) raiseTestException
tproper_stacktrace.nim(140) tproper_stacktrace
tproper_stacktrace.nim(130) foo
tproper_stacktrace.nim(126) baz
tproper_stacktrace.nim(8) raiseTestException
"""

verifyStackTrace expectedStackTrace:
Expand Down
3 changes: 2 additions & 1 deletion tests/errmsgs/tproper_stacktrace2.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
discard """
outputsub: '''tproper_stacktrace2.nim(20) main'''
matrix: "--stackTrace:on"
outputsub: '''tproper_stacktrace2.nim(21) main'''
exitcode: 1
"""

Expand Down
3 changes: 2 additions & 1 deletion tests/errmsgs/tproper_stacktrace3.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
discard """
outputsub: '''tproper_stacktrace3.nim(21) main'''
matrix: "--stackTrace:on"
outputsub: '''tproper_stacktrace3.nim(22) main'''
exitcode: 1
"""

Expand Down

0 comments on commit 09b4725

Please sign in to comment.