forked from elcritch/nesper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nesper.nimble
63 lines (49 loc) · 1.65 KB
/
nesper.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
54
55
56
57
58
59
60
61
# Package
version = "0.6.1"
author = "Jaremy Creechley"
description = "Nim wrappers for ESP-IDF (ESP32)"
license = "Apache-2.0"
srcDir = "src"
# Dependencies
requires "nim >= 1.4.0"
requires "msgpack4nim >= 0.3.1"
requires "stew >= 0.1.0"
# requires "bytesequtils >= 1.1"
# requires "nimcrypto >= 1.0"
# Tasks
import os, strutils
proc general_tests() =
# Regular tests
for dtest in listFiles("tests/"):
if dtest.startsWith("t") and dtest.endsWith(".nim"):
echo("Testing: " & $dtest)
exec "nim c --compileOnly:on --cincludes:c_headers/mock/ --os:freertos $1" % [dtest]
proc driver_tests() =
# Driver tests
for dtest in listFiles("tests/driver/"):
if dtest.startsWith("t") and dtest.endsWith(".nim"):
exec "nim c --compileOnly:on --cincludes:c_headers/mock/ --os:freertos $1" % [dtest]
proc storage_tests() =
# Driver tests
for dtest in listFiles("tests/storage/"):
if dtest.startsWith("t") and dtest.endsWith(".nim"):
exec "nim c --compileOnly:on --cincludes:c_headers/mock/ --os:freertos $1" % [dtest]
proc exec_tests() =
# Exec tests
for dtest in listFiles("tests/exec_tests/"):
if dtest.startsWith("t") and dtest.endsWith(".nim"):
exec "nim c -r --cincludes:$2/tests/c_headers/mock/ $1" % [dtest, getCurrentDir()]
task test, "Runs the test suite":
general_tests()
driver_tests()
storage_tests()
exec_tests()
task test_general, "Runs the test suite":
general_tests()
task test_drivers, "Runs the test suite":
driver_tests()
task test_storage, "Runs the test suite":
storage_tests()
task test_execs, "Runs the test suite":
exec_tests()
# exec "nim c -r tests/trouter.nim"