Skip to content

Commit

Permalink
tweak ci
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Aug 25, 2020
1 parent c260d48 commit f5b00ab
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 68 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# testes [![Build Status](https://travis-ci.org/disruptek/testes.svg?branch=master)](https://travis-ci.org/disruptek/testes)
# testes ![CI](https://github.com/disruptek/testes/workflows/CI/badge.svg)

A small unittest macro with some features I needed.

Expand Down
2 changes: 1 addition & 1 deletion testes.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,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=80x60 --template=window_frame_powershell --command=\"nim c -r tests/testicles.nim\""
exec "termtosvg docs/demo.svg --loop-delay=10000 --screen-geometry=80x60 --template=window_frame_powershell --command=\"nim c -r tests/balls.nim\""
77 changes: 77 additions & 0 deletions tests/balls.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import std/os
import std/exitprocs

import testes

expandMacros:
testes:

block goats:
## this is a test of goats
discard

block pigs:
## a test of pigs
discard

var r = 3

block sometimes_the_wolf_is_nice:
assert true
inc r

block sheepies:
raise newException(ValueError, "you're terrible")

block check_r:
## checking some things
## this block exists only to test inclusion of
## comments in the test code display...
check r == 3
dump r
check r == 2

block:
## unnamed block
discard

block:
discard "unnamed test"

inc r
assert r > 0
## this is a nice comment
type TypesAreNotTests = bool
## there's really nothing else to say
const VariablesDefinedOutsideBlocksAreNotTests = true

test "a test: block is fine":
discard

block omission:
skip()

block:
## hide this gory when statement
when defined(release):
testes:
const compile = true
proc doesnt(c: bool) =
if not c:
raise

block:
proc fixed() = doesnt(compile)
else:
testes:
block:
proc broken() = doesnt(compile)

block assertions:
assert 2 == 4 div 2
assert 2 != 4 div 2

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

if getEnv("TRAVIS_COMPILER", "unlikely") != "unlikely":
setProgramResult QuitSuccess
117 changes: 51 additions & 66 deletions tests/testicles.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,60 @@ import std/exitprocs

import testes

expandMacros:
testes:
testes:

block goats:
## this is a test of goats
discard
block goats:
## this is a test of goats
discard

block pigs:
## a test of pigs
discard
block pigs:
## a test of pigs
discard

var r = 3

block sometimes_the_wolf_is_nice:
assert true
inc r

block sheepies:
raise newException(ValueError, "you're terrible")

block check_r:
## checking some things
## this block exists only to test inclusion of
## comments in the test code display...
check r == 3
dump r
check r == 2

block:
## unnamed block
discard

block:
discard "unnamed test"
var r = 3

block sometimes_the_wolf_is_nice:
assert true
inc r
assert r > 0
## this is a nice comment
type TypesAreNotTests = bool
## there's really nothing else to say
const VariablesDefinedOutsideBlocksAreNotTests = true

test "a test: block is fine":
discard

block omission:
skip()

block:
## hide this gory when statement
when defined(release):
testes:
const compile = true
proc doesnt(c: bool) =
if not c:
raise

block:
proc fixed() = doesnt(compile)
else:
testes:
block:
proc broken() = doesnt(compile)

block assertions:
assert 2 == 4 div 2
assert 2 != 4 div 2

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

if getEnv("TRAVIS_COMPILER", "unlikely") != "unlikely":
setProgramResult QuitSuccess
block:
## unnamed block
discard

block:
discard "unnamed test"

inc r
assert r > 0
## this is a nice comment
type TypesAreNotTests = bool
## there's really nothing else to say
const VariablesDefinedOutsideBlocksAreNotTests = true

test "a test: block is fine":
discard

block omission:
skip()

block:
## hide this gory when statement
when defined(release):
testes:
const compile = true
proc doesnt(c: bool) =
if not c:
raise

block:
proc fixed() = doesnt(compile)
else:
testes:
block:
proc broken() = doesnt(compile)

block assertions:
assert 2 == 4 div 2
assert 2 != 4 div 2

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

0 comments on commit f5b00ab

Please sign in to comment.