Skip to content

Commit 806bdaf

Browse files
committed
Move test from hbs-test repository
1 parent abc23bd commit 806bdaf

156 files changed

Lines changed: 1134 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*/output.txt
2+
*/*/build
3+
4+
# Golden files generated automatically
5+
AddFile/tool-not-set/golden.txt
6+
misc/core-registered-twice/golden.txt
7+
SetStd/*-invalid-std/golden.txt
8+
dry-run/*/golden.txt

tests/AddDep/different-args/cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
../../../hbs run lib::core2::src > output.txt
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
a arg2
2+
a b
3+
b c
4+
c d
5+
a c
6+
a d
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace eval lib {
2+
namespace eval core1 {
3+
proc src {arg1 {arg2 "arg2"}} {
4+
puts "$arg1 $arg2"
5+
}
6+
hbs::Register
7+
}
8+
namespace eval core2 {
9+
proc src {} {
10+
hbs::AddDep lib::core1::src a
11+
hbs::AddDep lib::core1::src a b
12+
hbs::AddDep lib::core1::src b c
13+
hbs::AddDep lib::core1::src c d
14+
hbs::AddDep lib::core1::src a c
15+
hbs::AddDep lib::core1::src a d
16+
}
17+
hbs::Register
18+
}
19+
}

tests/AddDep/no-args/cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
../../../hbs run lib::core2::src > output.txt

tests/AddDep/no-args/golden.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
core1::src1
2+
core1::src2

tests/AddDep/no-args/lib.hbs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace eval lib {
2+
namespace eval core1 {
3+
proc src1 {} {
4+
puts "core1::src1"
5+
}
6+
proc src2 {} {
7+
puts "core1::src2"
8+
}
9+
hbs::Register
10+
}
11+
namespace eval core2 {
12+
proc src {} {
13+
hbs::AddDep lib::core1::src1
14+
# lib::core1::src1 shall not be run second time
15+
hbs::AddDep lib::core1::src1
16+
hbs::AddDep lib::core1::src2
17+
}
18+
hbs::Register
19+
}
20+
}

tests/AddDep/same-args/cmd.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
../../../hbs run lib::core2::src > output.txt

tests/AddDep/same-args/golden.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a arg2
2+
a b

tests/AddDep/same-args/lib.hbs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace eval lib {
2+
namespace eval core1 {
3+
proc src {arg1 {arg2 "arg2"}} {
4+
puts "$arg1 $arg2"
5+
}
6+
hbs::Register
7+
}
8+
namespace eval core2 {
9+
proc src {} {
10+
hbs::AddDep lib::core1::src a
11+
hbs::AddDep lib::core1::src a
12+
hbs::AddDep lib::core1::src a b
13+
hbs::AddDep lib::core1::src a b
14+
hbs::AddDep lib::core1::src a
15+
hbs::AddDep lib::core1::src a b
16+
}
17+
hbs::Register
18+
}
19+
}

0 commit comments

Comments
 (0)