-
Notifications
You must be signed in to change notification settings - Fork 22
/
nimdata.nimble
54 lines (45 loc) · 1.4 KB
/
nimdata.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
# Package
version = "0.1.0"
author = "Fabian Keller"
description = "DataFrame API enabling fast out-of-core data analytics"
license = "MIT"
srcDir = "src"
binDir = "bin"
# Dependencies
requires "nim >= 1.0.0"
requires "zip >= 0.3.1"
requires "plotly"
import strutils
proc `/`(a, b: string): string = a & "/" & b
iterator iterateSourceFiles(dir: string): string =
# This is currently a bit ugly. Why isn't there a
# recursive listFiles? Would also be nice if we
# could sort the files by name.
for f in listFiles(dir / "src"):
if f.endsWith(".nim"):
yield f
for f in listFiles(dir / "src/nimdata"):
if f.endsWith(".nim"):
yield f
for f in listFiles(dir / "examples"):
if f.endsWith(".nim"):
yield f
proc runTest(file: string) =
echo "\n*** Running tests in: ", file
mkdir("bin")
var cc = getEnv("CC")
if cc == "":
cc = "gcc"
let cmd = "nim c --cc:" & cc & " --verbosity:0 -r -d:testNimData --outdir:bin " & file
echo "exec ", cmd
exec cmd
task tests, "Runs unit tests":
# TODO: How can I ensure nimble installs deps before running this?
withDir(thisDir()):
runTest("tests/all.nim")
runTest("src/nimdata/tuples.nim")
runTest("examples/example_01.nim")
runTest("examples/example_02.nim")
# This does currently not make sense, due to include only source files:
# for f in iterateSourceFiles(thisDir()):
# runTest(f)