diff --git a/tests/10_define.sh b/tests/10_define.sh index 3f57103..7d4c5f6 100644 --- a/tests/10_define.sh +++ b/tests/10_define.sh @@ -2,7 +2,6 @@ @define A=aaa @define B=${A}bbb -C=ccc @goal testA echo A=$A diff --git a/tests/12_errors.sh b/tests/12_errors.sh index 37025e5..d49663f 100644 --- a/tests/12_errors.sh +++ b/tests/12_errors.sh @@ -1,4 +1,7 @@ +echo 'code in prelude' +echo 'more code in prelude' + @reached_if true @depends_on g1 @doc Doc in prelude diff --git a/tests/12_errors.tush b/tests/12_errors.tush index cfc1d64..5dd2d68 100644 --- a/tests/12_errors.tush +++ b/tests/12_errors.tush @@ -1,47 +1,49 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/12_errors.sh +@ Shell code is not allowed in prelude area: +@ tests/12_errors.sh:2: echo 'code in prelude' @ Only use @reached_if in @goal: -@ tests/12_errors.sh:2: @reached_if true +@ tests/12_errors.sh:5: @reached_if true @ Only use @depends_on in @goal: -@ tests/12_errors.sh:3: @depends_on g1 +@ tests/12_errors.sh:6: @depends_on g1 @ Only use @doc in @goal: -@ tests/12_errors.sh:4: @doc Doc in prelude +@ tests/12_errors.sh:7: @doc Doc in prelude @ Option 'unsupported' is not supported: -@ tests/12_errors.sh:5: @options unsupported +@ tests/12_errors.sh:8: @options unsupported @ Provide at least one option: -@ tests/12_errors.sh:6: @options +@ tests/12_errors.sh:9: @options @ Shell 'unsupported' is not supported: -@ tests/12_errors.sh:7: @shell unsupported +@ tests/12_errors.sh:10: @shell unsupported @ Shell '' is not supported: -@ tests/12_errors.sh:8: @shell +@ tests/12_errors.sh:11: @shell @ Only use @use_lib in @goal: -@ tests/12_errors.sh:9: @use_lib lib1 +@ tests/12_errors.sh:12: @use_lib lib1 @ Goal must have a name: -@ tests/12_errors.sh:11: @goal +@ tests/12_errors.sh:14: @goal @ Goal 'g1' is already defined: -@ tests/12_errors.sh:17: @goal g1 +@ tests/12_errors.sh:20: @goal g1 @ Provide at least one dependency: -@ tests/12_errors.sh:18: @depends_on +@ tests/12_errors.sh:21: @depends_on @ Multiple @reached_if not allowed for a goal: -@ tests/12_errors.sh:20: @reached_if false +@ tests/12_errors.sh:23: @reached_if false @ Only use @shell in prelude: -@ tests/12_errors.sh:25: @shell sh +@ tests/12_errors.sh:28: @shell sh @ Only use @define in prelude: -@ tests/12_errors.sh:26: @define A=1 +@ tests/12_errors.sh:29: @define A=1 @ Multiple @doc not allowed for a goal: -@ tests/12_errors.sh:31: @doc doc2 +@ tests/12_errors.sh:34: @doc doc2 @ Only use @options in prelude: -@ tests/12_errors.sh:32: @options timing +@ tests/12_errors.sh:35: @options timing @ Unknown directive: @unknown_directive: -@ tests/12_errors.sh:33: @unknown_directive arg +@ tests/12_errors.sh:36: @unknown_directive arg @ You can only use one @lib in a @goal: -@ tests/12_errors.sh:35: @use_lib lib2 +@ tests/12_errors.sh:38: @use_lib lib2 @ Goal 'g1' has unknown dependency 'unknown': -@ tests/12_errors.sh:15: @depends_on unknown +@ tests/12_errors.sh:18: @depends_on unknown @ Goal 'g2' uses unknown lib 'unknown': -@ tests/12_errors.sh:24: @use_lib unknown +@ tests/12_errors.sh:27: @use_lib unknown @ Goal 'g13' uses unknown lib 'unknown1': -@ tests/12_errors.sh:38: @use_lib unknown1 +@ tests/12_errors.sh:41: @use_lib unknown1 @ Goal 'g14' has unknown dependency 'unknown1': -@ tests/12_errors.sh:41: @depends_on unknown1 +@ tests/12_errors.sh:44: @depends_on unknown1 ? 1 diff --git a/tests/16_prelude_fail.tush b/tests/16_prelude_fail.tush.TBD.txt similarity index 100% rename from tests/16_prelude_fail.tush rename to tests/16_prelude_fail.tush.TBD.txt diff --git a/tests/18_vars_priority.sh b/tests/18_vars_priority.sh index 15e0bb3..77063bc 100644 --- a/tests/18_vars_priority.sh +++ b/tests/18_vars_priority.sh @@ -1,16 +1,6 @@ -echo "in prelude: A=$A" -echo "in prelude: V=$V" -sh -c 'echo "in prelude: in child: A=$A"' -sh -c 'echo "in prelude: in child: V=$V"' - @define V="V_prelude" -echo "in prelude: A=$A" -echo "in prelude: V=$V" -sh -c 'echo "in prelude: in child: A=$A"' -sh -c 'echo "in prelude: in child: V=$V"' - @goal default echo "A=$A" echo "V=$V" diff --git a/tests/18_vars_priority.tush b/tests/18_vars_priority.tush index ea6159a..8a26316 100644 --- a/tests/18_vars_priority.tush +++ b/tests/18_vars_priority.tush @@ -1,13 +1,5 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh -| in prelude: A= -| in prelude: V= -| in prelude: in child: A= -| in prelude: in child: V= -| in prelude: A= -| in prelude: V=V_prelude -| in prelude: in child: A= -| in prelude: in child: V=V_prelude | goal 'default' ... | A= | V=V_prelude @@ -15,14 +7,6 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh | in child: V=V_prelude $ cd "$MYDIR"; A=A_env ./$MAKESURE -f tests/18_vars_priority.sh -| in prelude: A=A_env -| in prelude: V= -| in prelude: in child: A=A_env -| in prelude: in child: V= -| in prelude: A=A_env -| in prelude: V=V_prelude -| in prelude: in child: A=A_env -| in prelude: in child: V=V_prelude | goal 'default' ... | A=A_env | V=V_prelude @@ -30,14 +14,6 @@ $ cd "$MYDIR"; A=A_env ./$MAKESURE -f tests/18_vars_priority.sh | in child: V=V_prelude $ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/18_vars_priority.sh -| in prelude: A= -| in prelude: V=V_env -| in prelude: in child: A= -| in prelude: in child: V=V_env -| in prelude: A= -| in prelude: V=V_prelude -| in prelude: in child: A= -| in prelude: in child: V=V_prelude | goal 'default' ... | A= | V=V_prelude @@ -45,14 +21,6 @@ $ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/18_vars_priority.sh | in child: V=V_prelude $ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D -| in prelude: A= -| in prelude: V=V_D -| in prelude: in child: A= -| in prelude: in child: V=V_D -| in prelude: A= -| in prelude: V=V_D -| in prelude: in child: A= -| in prelude: in child: V=V_D | goal 'default' ... | A= | V=V_D @@ -60,14 +28,6 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D | in child: V=V_D $ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D -| in prelude: A= -| in prelude: V=V_D -| in prelude: in child: A= -| in prelude: in child: V=V_D -| in prelude: A= -| in prelude: V=V_D -| in prelude: in child: A= -| in prelude: in child: V=V_D | goal 'default' ... | A= | V=V_D diff --git a/tests/7_options.tush b/tests/7_options.tush index 0cc0927..82a7dc6 100644 --- a/tests/7_options.tush +++ b/tests/7_options.tush @@ -15,10 +15,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_in_goal.sh ? 1 $ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_tracing.sh -x -| prelude 123 | goal 'default' ... | test -@ + A=123 -@ + echo 'prelude 123' @ + echo test diff --git a/tests/7_options_tracing.sh b/tests/7_options_tracing.sh index 68cf89e..ccbea4d 100644 --- a/tests/7_options_tracing.sh +++ b/tests/7_options_tracing.sh @@ -1,8 +1,5 @@ @options tracing -A=123 -echo "prelude $A" - @goal default echo test diff --git a/tests/9_prelude.sh b/tests/9_prelude.sh index 4aa173c..18b7cde 100644 --- a/tests/9_prelude.sh +++ b/tests/9_prelude.sh @@ -1,5 +1,9 @@ -echo "prelude should execute only once" +# no code allowed in prelude, +# only comments, @define, @shell, @options + +@shell bash +@define A=B @goal a @depends_on b diff --git a/tests/9_prelude.tush b/tests/9_prelude.tush index c0815cf..fc43e4c 100644 --- a/tests/9_prelude.tush +++ b/tests/9_prelude.tush @@ -1,6 +1,5 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude.sh a -| prelude should execute only once | goal 'c' [already satisfied]. | goal 'd' ... | d