-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathx.nu
More file actions
executable file
·64 lines (51 loc) · 1.55 KB
/
x.nu
File metadata and controls
executable file
·64 lines (51 loc) · 1.55 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
#!/usr/bin/env nu
const cwd = path self | path dirname
def main [] {
help main
}
def "main nufmt" [] {
topiary format **/*.nu
}
def "main test" [] {
cd $cwd
cargo build -q --manifest-path ($cwd | path join Cargo.toml) -p nuze --bin nuze
let nuze = $cwd | path join target debug nuze
const always_exclude = "**/_*.nu"
for test in (glob tests/**/*.nu --exclude [$always_exclude experimental/**]) {
info $test
try {
^$nuze -0 $test
} catch {|err|
info ko $test $nuze
continue
}
info ok $test
}
for test in (glob tests/experimental/**/*.nu --exclude [$always_exclude]) {
info $test
try {
^$nuze -X0 $test
} catch {|err|
info ko $test $nuze
continue
}
info ok $test
}
}
def info [test] {
print -e $"(ansi yellow_bold)TEST:(ansi reset) ($test | path relative-to $"($cwd)/tests")"
}
def "info ko" [test nuze -x] {
if $x {
print -e $"(ansi red_bold)KO:(ansi reset) ($test | path relative-to $"($cwd)/tests") \(experimental\); rerun with `($nuze) -X0 ($test)`"
} else {
print -e $"(ansi red_bold)KO:(ansi reset) ($test | path relative-to $"($cwd)/tests"); rerun with `($nuze) -0 ($test)`"
}
}
def "info ok" [test -x] {
if $x {
print -e $"(ansi green_bold)OK:(ansi reset) ($test | path relative-to $"($cwd)/tests") \(experimental\)"
} else {
print -e $"(ansi green_bold)OK:(ansi reset) ($test | path relative-to $"($cwd)/tests")"
}
}