Skip to content

Commit

Permalink
change define prefix and update docs (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefantalpalaru committed Apr 29, 2021
1 parent c847fc3 commit b9b61cf
Show file tree
Hide file tree
Showing 6 changed files with 1,394 additions and 1,377 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nim-unittest2 CI
name: CI
on: [push, pull_request]

jobs:
Expand Down Expand Up @@ -136,13 +136,13 @@ jobs:
- name: Build the Nim compiler
shell: bash
run: |
git clone -b ${{ matrix.branch }} --depth 1 git://github.com/nim-lang/nim nim/
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_nim.sh
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} CC=gcc QUICK_AND_DIRTY_COMPILER=1 bash build_nim.sh nim csources dist/nimble NimBinaries
env MAKE="${MAKE_CMD} -j${ncpu}" ARCH_OVERRIDE=${PLATFORM} CC=gcc QUICK_AND_DIRTY_COMPILER=1 NIM_COMMIT=${{ matrix.branch }} bash build_nim.sh nim csources dist/nimble NimBinaries
echo '${{ github.workspace }}/nim/bin' >> $GITHUB_PATH
- name: Run tests
shell: bash
run: |
nim --version
nim --hints:off --verbosity:0 test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ requires "unittest2"

## Usage

See [unittest2.html](https://status-im.github.io/nim-unittest2/unittest2.html) documentation generated by `nim doc unittest2.nim`.
See [unittest2.html](https://status-im.github.io/nim-unittest2/unittest2.html) documentation generated by `nim buildDocs`.

Create a file that contains your unit tests:

Expand Down
20 changes: 18 additions & 2 deletions config.nims
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
task test, "Run tests":
let
xmlFile = "test_results.xml"
commandStart = "nim c -r -f --threads:on --hints:off --verbosity:0 --skipParentCfg:on --skipUserCfg:on "

for f in listFiles("tests"):
if f.len > 4 and f[^4..^1] == ".nim":
let cmd = "nim c -r -f --threads:on --hints:off --verbosity:0 --skipParentCfg:on --skipUserCfg:on " & f
# This should generate an XML results file.
var cmd = commandStart & f & " --xml:" & xmlFile & " --console"
echo cmd
exec cmd
rmFile(f[0..^5].toExe())
doAssert fileExists xmlFile
rmFile xmlFile

# This should not, since we disable param processing.
cmd = commandStart & "-d:unittest2DisableParamFiltering " & f & " --xml:" & xmlFile
echo cmd
exec cmd
doAssert not fileExists xmlFile
rmFile f[0..^5].toExe

task buildDocs, "Build docs":
exec "nim doc --skipParentCfg:on --skipUserCfg:on --git.url:https://github.com/status-im/nim-unittest2 --git.commit:master --git.devel:master unittest2.nim"

Loading

0 comments on commit b9b61cf

Please sign in to comment.