-
Notifications
You must be signed in to change notification settings - Fork 21
/
msgpack4nim.nimble
53 lines (43 loc) · 1.34 KB
/
msgpack4nim.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Package
version = "0.4.4"
author = "Andri Lim"
description = "MessagePack serializer/deserializer implementation in nim"
license = "MIT"
# Dependencies
requires "nim >= 1.6.0"
srcDir = "src"
# Examples and Tests
skipDirs = @["examples", "tests"]
template exec(cmd) =
echo cmd
system.exec(cmd)
### Helper functions
proc test(env, path: string) =
# Compilation language is controlled by TEST_LANG
var lang = "c"
if existsEnv"TEST_LANG":
lang = getEnv"TEST_LANG"
when defined(macosx):
let specific = if lang == "cpp":
" --passC:\"-Wno-c++11-narrowing\" "
else:
""
else:
const specific = ""
if not dirExists "build":
mkDir "build"
exec "nim " & lang & " " & env & specific &
" -r --hints:off --warnings:off " & path
task test, "Run all tests":
test "-d:debug", "examples/test"
test "-d:msgpack_obj_to_map", "tests/test_any"
test "-d:debug", "tests/test_json"
test "-d:debug", "tests/test_codec"
test "-d:debug", "tests/test_spec"
test "-d:debug", "tests/test_suite"
test "-d:release", "examples/test"
test "-d:release -d:msgpack_obj_to_map", "tests/test_any"
test "-d:release", "tests/test_json"
test "-d:release", "tests/test_codec"
test "-d:release", "tests/test_spec"
test "-d:release", "tests/test_suite"