Skip to content

Commit

Permalink
push some pragmas on bdd.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
noahehall committed Mar 20, 2023
1 parent e946eb6 commit dbcbd00
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 23 deletions.
10 changes: 10 additions & 0 deletions bdd.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# todo: extract this to a separate package
# todo: think through how to auto-clean up stuff created during tests
# ^ think testament auto sets d:testing which can help with this
# ^^ use a pragma to change the appname: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
# ^ also make note about native nimlang procs, e.g. tryRemoveFile returns bool

import std/sugar
Expand All @@ -20,6 +21,13 @@ type BddDefect = ref object of Defect
var failure = BddDefect(msg: "Invalid Test Parameters") ## \
## escape hatch to fail a test early

# TODO: i think pushing these pragmas reduces test speed signficantly
{.hints: off,
optimization: speed,
push checks: off,
stackTrace: on,
warnings: off.}

proc assertCondition(
condition: bool,
matches: bool,
Expand Down Expand Up @@ -85,6 +93,8 @@ proc bdd*(caseName: string): (What, string, () -> bool) -> void =
else: raise failure
)

{.pop.}

export sugar

when isMainModule:
Expand Down
2 changes: 1 addition & 1 deletion config.nims
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--debugger:native
--deepcopy:on
--deepcopy:on # required for mm:orc/arc
--define:nimPreviewHashRef
--define:nimStrictDelete
--define:ssl
Expand Down
22 changes: 11 additions & 11 deletions src/htmldocs/_._/bdd.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/manifest.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/boatConfig.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/boatConstants.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/boatErrors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/captainsLogUtils.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/fileManager.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/boat/private/fileManagerUtils.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/htmldocs/theindex.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions testresults.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dbcbd00

Please sign in to comment.