-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtester.nim
44 lines (38 loc) · 941 Bytes
/
tester.nim
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
#
# Nawabs -- The Anti package manager for Nim
# (c) Copyright 2017 Andreas Rumpf
#
# See the file "license.txt", included in this
# distribution, for details about the copyright.
## Tests.
import strutils, os, osutils
template withWs(ws, body) =
removeDir(ws)
createDir(ws)
withDir ws:
body
removeDir(ws)
proc naw(s: string) =
# we go up one directory here as the 'withWs' environment goes down
# into a testing workspace.
when defined(windows):
let n = getCurrentDir() /../ "nawabs.exe"
exec quoteShell(n) & " " & s
else:
exec "../nawabs " & s
proc test1 =
withWs "testws":
naw "init"
naw "build --noquestions c2nim"
naw "update"
naw "pinned c2nim"
naw "refresh"
proc test2 =
withWs "testws2":
naw "init"
naw "clone --noquestions --deps:nimxdeps_ nimx"
naw "update nimx"
when not defined(onlyTest2):
test1()
when not defined(onlyTest1):
test2()