Skip to content

Commit

Permalink
0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Aug 6, 2020
1 parent 4bd9552 commit 4094fad
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 64 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Because `testament` and `testutils` are going nowhere fast.

## Goals

- we expect everything to work; any statement is a test
- expect everything to work; any statement is a test
- show the test code as we run it, unless not :wink:
- better stack traces and test source output
- less magical syntax and less output omission
- aim to run many cheap tests in fewer files
Expand All @@ -20,8 +21,7 @@ Because `testament` and `testutils` are going nowhere fast.

## Notable Mentions

- With `--define:release`, your tests must compile.
- `check` doesn't work inside other scopes due to a bug.
- With `--define:release`, _all code_ **must** compile.

## Usage

Expand Down
107 changes: 53 additions & 54 deletions docs/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/testes.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h1 class="title">testes</h1>
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<a id="skip,string"></a>
<dt><pre><span class="Keyword">proc</span> <a href="#skip%2Cstring"><span class="Identifier">skip</span></a><span class="Other">(</span><span class="Identifier">msg</span> <span class="Other">=</span> <span class="StringLit">&quot;skipped&quot;</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">SkipError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">WriteIOEffect</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
<dt><pre><span class="Keyword">proc</span> <a href="#skip%2Cstring"><span class="Identifier">skip</span></a><span class="Other">(</span><span class="Identifier">msg</span> <span class="Other">=</span> <span class="StringLit">&quot;skipped&quot;</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">SkipError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt>
<dd>


Expand Down Expand Up @@ -167,7 +167,7 @@ <h1><a class="toc-backref" href="#18">Templates</a></h1>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-08-05 23:08:02 UTC</small>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-08-06 16:20:19 UTC</small>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/theindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h1 class="title">Index</h1>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br/>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-08-05 23:08:02 UTC</small>
<small style="color: var(--hint);">Made with Nim. Generated: 2020-08-06 16:20:19 UTC</small>
</div>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions testes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import std/terminal
import std/sugar
import std/strutils
import std/macros
import std/compilesettings


import cutelog

Expand Down Expand Up @@ -183,7 +185,7 @@ proc skipped(t: Test; n: NimNode): NimNode =
assert not n.isNil
result = newStmtList()
result.add t.output(infix(newLit("" & t.name & ": "), "&",
n.exceptionString))
newDotExpr(n, ident"msg")))

proc exception(t: var Test; n: NimNode): NimNode =
assert not n.isNil
Expand All @@ -203,7 +205,8 @@ proc compilerr(t: var Test): NimNode =
result.add t.setExitCode

proc skip*(msg = "skipped") =
report "💣 skipping is broken on C (not C++) backend due to a bug"
when querySetting(command) == "c":
report "💣 skipping is broken on C (not C++) backend due to a bug"
raise newException(SkipError, msg)

proc wrapExcept(t: var Test): NimNode =
Expand Down
4 changes: 2 additions & 2 deletions testes.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.1.5"
version = "0.1.6"
author = "disruptek"
description = "a cure for salty testes"
license = "MIT"
Expand All @@ -23,4 +23,4 @@ task test, "run tests for travis":

task docs, "generate some docs":
exec "nim doc --project --outdir=docs testes.nim"
exec "termtosvg docs/demo.svg --loop-delay=10000 --screen-geometry=80x40 --template=window_frame_powershell --command=\"nim cpp -r tests/testicles.nim\""
exec "termtosvg docs/demo.svg --loop-delay=10000 --screen-geometry=80x50 --template=window_frame_powershell --command=\"nim cpp -r tests/testicles.nim\""
6 changes: 6 additions & 0 deletions tests/testicles.nim
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import std/os
import std/exitprocs

import testes

expandMacros:
Expand Down Expand Up @@ -69,3 +72,6 @@ expandMacros:
assert 2 != 4 div 2

assert "any statement is a test" != ""

if getEnv("TRAVIS_COMPILER", "unlikely") != "unlikely":
setProgramResult QuitSuccess

0 comments on commit 4094fad

Please sign in to comment.