File tree Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,9 @@ includes:
44 build : " ./taskfiles/build.yaml"
55 deps : " ./taskfiles/deps.yaml"
66 lint : " ./taskfiles/lint.yaml"
7- test : " ./taskfiles/test.yaml"
7+ test :
8+ taskfile : " ./taskfiles/test.yaml"
9+ flatten : true
810 utils : " tools/yscope-dev-utils/taskfiles/utils.yaml"
911
1012vars :
Original file line number Diff line number Diff line change 3030 - " {{.TARGET}}"
3131
3232 unit-test-* :
33- desc : " Builds unit test target for the specified library."
33+ desc : " Builds the unit test target for the specified library."
3434 vars :
3535 TEST_TARGET : >-
3636 {{printf "unit-test-%s" (index .MATCH 0)}}
Original file line number Diff line number Diff line change 11version : " 3"
22
3+ vars :
4+ YSTDLIBS :
5+ - " testlib"
6+
37tasks :
4- all :
8+ test- all :
59 desc : " Runs all unit tests."
10+ deps :
11+ - " build:unit-test-all"
612 cmds :
7- - task : " run -all"
13+ - " {{.G_TEST_BIN_DIR}}/unit-test -all"
814
9- run -* :
10- desc : " Runs unit test for the specified library."
15+ test -* :
16+ desc : " Runs unit tests for the specified library."
1117 vars :
18+ LIBRARY : >-
19+ {{index .MATCH 0}}
1220 TEST_TARGET : >-
13- {{printf "unit-test-%s" (index .MATCH 0)}}
14- deps :
15- - task : " :build:{{.TEST_TARGET}}"
16- cmd : " {{.G_TEST_BIN_DIR}}/{{.TEST_TARGET}}"
21+ {{printf "unit-test-%s" .LIBRARY}}
22+ preconditions :
23+ - sh : >-
24+ {{ has .LIBRARY .YSTDLIBS }}
25+ msg: |-
26+ {{.LIBRARY}} is not a valid ystdlib-cpp library!
27+ List of libraries:
28+ {{- range .YSTDLIBS }}
29+ {{.}}
30+ {{- end}}
31+ cmds :
32+ - task : " build:{{.TEST_TARGET}}"
33+ - " {{.G_TEST_BIN_DIR}}/{{.TEST_TARGET}}"
You can’t perform that action at this time.
0 commit comments