-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathconfig.nims
More file actions
86 lines (70 loc) · 2.52 KB
/
config.nims
File metadata and controls
86 lines (70 loc) · 2.52 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Tasks
import os, strutils
--nimcache:".nimcache/"
const NFLAGS=" --cincludes:" & (getCurrentDir() / "tests" / "c_headers" / "mock")
proc header(msg: string) =
echo "\n\n", msg, "\n"
proc testExec(extras, file: string, flags=NFLAGS) =
let cmd = "nim c $1 $2 $3" % [flags, extras, file]
echo("")
echo("Testing: " & $file)
echo "running: ", cmd
exec(cmd)
task test_driver, "Runs the test suite":
# Driver tests
header "=== Driver Tests ==="
for dtest in listFiles("tests/driver/"):
if dtest.splitFile()[1].startsWith("t") and dtest.endsWith(".nim"):
echo("\nTesting: " & $dtest)
testExec("--compileOnly:on --os:freertos", dtest)
task test_storage, "Runs the test suite":
# Storage tests
header "=== Storage Tests ==="
for dtest in listFiles("tests/storage/"):
if dtest.splitFile()[1].startsWith("t") and dtest.endsWith(".nim"):
testExec("--compileOnly:on --os:freertos", dtest)
task test_general, "Runs the test suite":
# Regular tests
header "=== Regular Tests ==="
for dtest in listFiles("tests/"):
if dtest.splitFile()[1].startsWith("t") and dtest.endsWith(".nim"):
testExec("--compileOnly:on --os:freertos", dtest)
task test_execs, "Runs the test suite":
# Exec tests
header "=== Exec Tests ==="
for dtest in listFiles("tests/exec_tests/"):
if dtest.splitFile()[1].startsWith("t") and dtest.endsWith(".nim"):
testExec(" -r ", dtest)
# exec "nim c -r tests/trouter.nim"
task test, "Runs the test suite":
test_generalTask()
test_driverTask()
test_storageTask()
task test_all, "Runs the test suite":
test_generalTask()
test_driverTask()
test_storageTask()
test_execsTask()
task testExampleUartEcho, "Build the UART echo example with QEMU":
putEnv("ESP_TARGET", "esp32")
withDir getCurrentDir() / "esp-idf-examples" / "uart_echo":
when not defined(skipEspBuild):
exec("nim espDistClean")
exec("nim espCompile")
when not defined(skipEspBuild):
exec("idf.py set-target esp32")
exec("nim espBuild")
task testExampleSimpleWifi, "Build the UART echo example with QEMU":
putEnv("ESP_TARGET", "esp32")
withDir getCurrentDir() / "esp-idf-examples" / "simplewifi":
putEnv("WIFI_SSID", "TESTWIFI")
putEnv("WIFI_PASSWORD", "12345678")
when not defined(skipEspBuild):
exec("nim espDistClean")
exec("nim espCompile")
when not defined(skipEspBuild):
exec("idf.py set-target esp32")
exec("nim espBuild")
task testExamples, "Build all examples":
testExampleUartEchoTask()
testExampleSimpleWifiTask()