Skip to content

Instantly share code, notes, and snippets.

@xmonader
Created September 9, 2017 20:10
Show Gist options
  • Save xmonader/fc0b0c1c1b88eb4666f8caaaecb45b37 to your computer and use it in GitHub Desktop.
Save xmonader/fc0b0c1c1b88eb4666f8caaaecb45b37 to your computer and use it in GitHub Desktop.
```
╭─striky@asgard ~/wspace/nidb
╰─$ tree .
.
├── LICENSE
├── nidb
├── nidb.nim
├── nidb.nimble
├── README.md
└── tests
├── nimcache
│ ├── nidb_nidb.c
│ ├── nidb_nidb.o
│ ├── nidb_tester.c
│ ├── nidb_tester.o
│ ├── stdlib_system.c
│ ├── stdlib_system.o
│ └── tester.json
├── nim.cfg
├── tester
├── tester.nim
└── tests.nim
```
nidb.nimble
```
╰─$ cat nidb.nimble
# Package
version = "0.1.0"
author = "Ahmed T. Youssef"
description = "Key value store written in nim."
license = "MIT"
# Dependencies
requires "nim >= 0.17.1"
# task build, "build binary":
# exec "nim c nidb.nim"
task run, "run app":
exec "./nidb"
# before run:
# exec build
task test, "runtests":
withDir "tests":
exec "nim c -r tests/tester.nim"
bin = @["nidb"]
skipDirs = @["tests"]%
```
tester.nim
```
╭─striky@asgard ~/wspace/nidb
╰─$ cat tests/tester.nim
import nidb
proc test1() =
assert one() == 2
when isMainModule:
test1()%
```
error
```
╰─$ nimble test
Executing task test in /home/striky/wspace/nidb/nidb.nimble
Error: unhandled exception: No such file or directory [OSError]
stack trace: (most recent call last)
home/striky/.choosenim/toolchains/nim-#devel/lib/system/nimscript.nim(206) testTask
home/striky/.choosenim/toolchains/nim-#devel/lib/system/nimscript.nim(206, 7) Error: unhandled exception: FAILED: nim c -r tests/tester.nim
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment