diff --git a/tests/13_errors.sh b/tests/12_errors.sh similarity index 100% rename from tests/13_errors.sh rename to tests/12_errors.sh diff --git a/tests/12_errors.tush b/tests/12_errors.tush new file mode 100644 index 0000000..54cac0a --- /dev/null +++ b/tests/12_errors.tush @@ -0,0 +1,37 @@ + +$ cd "$MYDIR"; ./$MAKESURE -f tests/12_errors.sh +@ Only use @reached_if in @goal: +@ tests/12_errors.sh:2: @reached_if true +@ Only use @depends_on in @goal: +@ tests/12_errors.sh:3: @depends_on g1 +@ Only use @doc in @goal: +@ tests/12_errors.sh:4: @doc Doc in prelude +@ Option 'unsupported' is not supported: +@ tests/12_errors.sh:5: @options unsupported +@ Shell 'unsupported' is not supported: +@ tests/12_errors.sh:6: @shell unsupported +@ Only use @use_lib in @goal: +@ tests/12_errors.sh:7: @use_lib lib1 +@ Goal must have a name: +@ tests/12_errors.sh:9: @goal +@ Goal 'g1' is already defined: +@ tests/12_errors.sh:15: @goal g1 +@ Multiple @reached_if not allowed for a goal: +@ tests/12_errors.sh:17: @reached_if false +@ Only use @shell in prelude: +@ tests/12_errors.sh:22: @shell sh +@ Only use @define in prelude: +@ tests/12_errors.sh:23: @define A=1 +@ Multiple @doc not allowed for a goal: +@ tests/12_errors.sh:28: @doc doc2 +@ Only use @options in prelude: +@ tests/12_errors.sh:29: @options timing +@ Unknown directive: @unknown_directive: +@ tests/12_errors.sh:30: @unknown_directive arg +@ You can only use one @lib in a @goal: +@ tests/12_errors.sh:32: @use_lib lib2 +@ Goal 'g1' has unknown dependency 'unknown': +@ tests/12_errors.sh:13: @depends_on unknown +@ Goal 'g2' uses unknown lib 'unknown': +@ tests/12_errors.sh:21: @use_lib unknown +? 1 diff --git a/tests/14_doc.sh b/tests/13_doc.sh similarity index 80% rename from tests/14_doc.sh rename to tests/13_doc.sh index a033560..2b19998 100644 --- a/tests/14_doc.sh +++ b/tests/13_doc.sh @@ -6,6 +6,6 @@ @depends_on a @doc doc for b -@goal @glob 14_doc.tush +@goal @glob 13_doc.tush @depends_on a b @doc doc for glob \ No newline at end of file diff --git a/tests/13_doc.tush b/tests/13_doc.tush new file mode 100644 index 0000000..2b55a54 --- /dev/null +++ b/tests/13_doc.tush @@ -0,0 +1,17 @@ + + +$ cd "$MYDIR"; ./$MAKESURE -f tests/13_doc_multi1.sh +@ Multiple @doc not allowed for a goal: +@ tests/13_doc_multi1.sh:4: @doc d2 +? 1 + +$ cd "$MYDIR"; ./$MAKESURE -f tests/13_doc_multi2.sh -l +@ Multiple @doc not allowed for a goal: +@ tests/13_doc_multi2.sh:4: @doc d2 +? 1 + +$ cd "$MYDIR"; ./$MAKESURE -f tests/13_doc.sh -l +| Available goals: +| a : doc for a +| b : doc for b +| 13_doc.tush : doc for glob diff --git a/tests/14_doc_multi1.sh b/tests/13_doc_multi1.sh similarity index 100% rename from tests/14_doc_multi1.sh rename to tests/13_doc_multi1.sh diff --git a/tests/13_doc_multi2.sh b/tests/13_doc_multi2.sh new file mode 100644 index 0000000..8087c4e --- /dev/null +++ b/tests/13_doc_multi2.sh @@ -0,0 +1,4 @@ + +@goal @glob 13_doc.tush +@doc d1 +@doc d2 \ No newline at end of file diff --git a/tests/13_errors.tush b/tests/13_errors.tush deleted file mode 100644 index 8fb23c8..0000000 --- a/tests/13_errors.tush +++ /dev/null @@ -1,37 +0,0 @@ - -$ cd "$MYDIR"; ./$MAKESURE -f tests/13_errors.sh -@ Only use @reached_if in @goal: -@ tests/13_errors.sh:2: @reached_if true -@ Only use @depends_on in @goal: -@ tests/13_errors.sh:3: @depends_on g1 -@ Only use @doc in @goal: -@ tests/13_errors.sh:4: @doc Doc in prelude -@ Option 'unsupported' is not supported: -@ tests/13_errors.sh:5: @options unsupported -@ Shell 'unsupported' is not supported: -@ tests/13_errors.sh:6: @shell unsupported -@ Only use @use_lib in @goal: -@ tests/13_errors.sh:7: @use_lib lib1 -@ Goal must have a name: -@ tests/13_errors.sh:9: @goal -@ Goal 'g1' is already defined: -@ tests/13_errors.sh:15: @goal g1 -@ Multiple @reached_if not allowed for a goal: -@ tests/13_errors.sh:17: @reached_if false -@ Only use @shell in prelude: -@ tests/13_errors.sh:22: @shell sh -@ Only use @define in prelude: -@ tests/13_errors.sh:23: @define A=1 -@ Multiple @doc not allowed for a goal: -@ tests/13_errors.sh:28: @doc doc2 -@ Only use @options in prelude: -@ tests/13_errors.sh:29: @options timing -@ Unknown directive: @unknown_directive: -@ tests/13_errors.sh:30: @unknown_directive arg -@ You can only use one @lib in a @goal: -@ tests/13_errors.sh:32: @use_lib lib2 -@ Goal 'g1' has unknown dependency 'unknown': -@ tests/13_errors.sh:13: @depends_on unknown -@ Goal 'g2' uses unknown lib 'unknown': -@ tests/13_errors.sh:21: @use_lib unknown -? 1 diff --git a/tests/14_doc.tush b/tests/14_doc.tush deleted file mode 100644 index b2f9d13..0000000 --- a/tests/14_doc.tush +++ /dev/null @@ -1,17 +0,0 @@ - - -$ cd "$MYDIR"; ./$MAKESURE -f tests/14_doc_multi1.sh -@ Multiple @doc not allowed for a goal: -@ tests/14_doc_multi1.sh:4: @doc d2 -? 1 - -$ cd "$MYDIR"; ./$MAKESURE -f tests/14_doc_multi2.sh -l -@ Multiple @doc not allowed for a goal: -@ tests/14_doc_multi2.sh:4: @doc d2 -? 1 - -$ cd "$MYDIR"; ./$MAKESURE -f tests/14_doc.sh -l -| Available goals: -| a : doc for a -| b : doc for b -| 14_doc.tush : doc for glob diff --git a/tests/14_doc_multi2.sh b/tests/14_doc_multi2.sh deleted file mode 100644 index 71fd85d..0000000 --- a/tests/14_doc_multi2.sh +++ /dev/null @@ -1,4 +0,0 @@ - -@goal @glob 14_doc.tush -@doc d1 -@doc d2 \ No newline at end of file diff --git a/tests/15_private.sh b/tests/14_private.sh similarity index 50% rename from tests/15_private.sh rename to tests/14_private.sh index 9afd646..4662d3b 100644 --- a/tests/15_private.sh +++ b/tests/14_private.sh @@ -5,8 +5,8 @@ echo a @goal b @private echo b -@goal @glob 15_private.sh +@goal @glob 14_private.sh echo $ITEM -@goal @glob 15_private.tush @private +@goal @glob 14_private.tush @private echo $ITEM diff --git a/tests/14_private.tush b/tests/14_private.tush new file mode 100644 index 0000000..2970ee4 --- /dev/null +++ b/tests/14_private.tush @@ -0,0 +1,15 @@ + + +$ cd "$MYDIR"; ./$MAKESURE -f tests/14_private.sh -l +| Available goals: +| a +| 14_private.sh + +$ cd "$MYDIR"; ./$MAKESURE -f tests/14_private.sh --list-all +| Available goals: +| a +| b +| 14_private.sh +| 14_private.tush + + diff --git a/tests/16_lib.sh b/tests/15_lib.sh similarity index 100% rename from tests/16_lib.sh rename to tests/15_lib.sh diff --git a/tests/15_lib.tush b/tests/15_lib.tush new file mode 100644 index 0000000..5f7e750 --- /dev/null +++ b/tests/15_lib.tush @@ -0,0 +1,20 @@ + + +$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh -l +| Available goals: +| g1 +| g2 + +$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh g1 +| goal 'g1' ... +| Hello World + +$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh g2 +| goal 'g2' ... +| Hello lib_name World + +$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib_unknown.sh g3 +@ Goal 'g3' uses unknown lib 'unknown': +@ tests/15_lib_unknown.sh:3: @use_lib unknown +? 1 + diff --git a/tests/16_lib_unknown.sh b/tests/15_lib_unknown.sh similarity index 100% rename from tests/16_lib_unknown.sh rename to tests/15_lib_unknown.sh diff --git a/tests/15_private.tush b/tests/15_private.tush deleted file mode 100644 index 3980b21..0000000 --- a/tests/15_private.tush +++ /dev/null @@ -1,15 +0,0 @@ - - -$ cd "$MYDIR"; ./$MAKESURE -f tests/15_private.sh -l -| Available goals: -| a -| 15_private.sh - -$ cd "$MYDIR"; ./$MAKESURE -f tests/15_private.sh --list-all -| Available goals: -| a -| b -| 15_private.sh -| 15_private.tush - - diff --git a/tests/16_lib.tush b/tests/16_lib.tush deleted file mode 100644 index 86ca1ef..0000000 --- a/tests/16_lib.tush +++ /dev/null @@ -1,20 +0,0 @@ - - -$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib.sh -l -| Available goals: -| g1 -| g2 - -$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib.sh g1 -| goal 'g1' ... -| Hello World - -$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib.sh g2 -| goal 'g2' ... -| Hello lib_name World - -$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib_unknown.sh g3 -@ Goal 'g3' uses unknown lib 'unknown': -@ tests/16_lib_unknown.sh:3: @use_lib unknown -? 1 - diff --git a/tests/17_prelude_fail.sh b/tests/16_prelude_fail.sh similarity index 88% rename from tests/17_prelude_fail.sh rename to tests/16_prelude_fail.sh index 2310b2a..77b287c 100644 --- a/tests/17_prelude_fail.sh +++ b/tests/16_prelude_fail.sh @@ -1,7 +1,7 @@ echo "hello" -exit 17 +exit 47 echo "world" @goal default diff --git a/tests/16_prelude_fail.tush b/tests/16_prelude_fail.tush new file mode 100644 index 0000000..cccdaf2 --- /dev/null +++ b/tests/16_prelude_fail.tush @@ -0,0 +1,6 @@ + + +$ cd "$MYDIR"; ./$MAKESURE -f tests/16_prelude_fail.sh +| hello +| prelude failed +? 47 diff --git a/tests/18_empty_prelude.sh b/tests/17_empty_prelude.sh similarity index 100% rename from tests/18_empty_prelude.sh rename to tests/17_empty_prelude.sh diff --git a/tests/18_empty_prelude.tush b/tests/17_empty_prelude.tush similarity index 83% rename from tests/18_empty_prelude.tush rename to tests/17_empty_prelude.tush index 36e94eb..70dfa7c 100644 --- a/tests/18_empty_prelude.tush +++ b/tests/17_empty_prelude.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/18_empty_prelude.sh +$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/17_empty_prelude.sh | goal 'default' ... | running bash | hello diff --git a/tests/17_prelude_fail.tush b/tests/17_prelude_fail.tush deleted file mode 100644 index d7723fd..0000000 --- a/tests/17_prelude_fail.tush +++ /dev/null @@ -1,6 +0,0 @@ - - -$ cd "$MYDIR"; ./$MAKESURE -f tests/17_prelude_fail.sh -| hello -| prelude failed -? 17 diff --git a/tests/19_vars_priority.sh b/tests/18_vars_priority.sh similarity index 100% rename from tests/19_vars_priority.sh rename to tests/18_vars_priority.sh diff --git a/tests/19_vars_priority.tush b/tests/18_vars_priority.tush similarity index 81% rename from tests/19_vars_priority.tush rename to tests/18_vars_priority.tush index 64e7429..ea6159a 100644 --- a/tests/19_vars_priority.tush +++ b/tests/18_vars_priority.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/19_vars_priority.sh +$ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh | in prelude: A= | in prelude: V= | in prelude: in child: A= @@ -14,7 +14,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/19_vars_priority.sh | in child: A= | in child: V=V_prelude -$ cd "$MYDIR"; A=A_env ./$MAKESURE -f tests/19_vars_priority.sh +$ 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 @@ -29,7 +29,7 @@ $ cd "$MYDIR"; A=A_env ./$MAKESURE -f tests/19_vars_priority.sh | in child: A=A_env | in child: V=V_prelude -$ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/19_vars_priority.sh +$ 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= @@ -44,7 +44,7 @@ $ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/19_vars_priority.sh | in child: A= | in child: V=V_prelude -$ cd "$MYDIR"; ./$MAKESURE -f tests/19_vars_priority.sh -D V=V_D +$ 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= @@ -59,7 +59,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/19_vars_priority.sh -D V=V_D | in child: A= | in child: V=V_D -$ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/19_vars_priority.sh -D 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= diff --git a/tests/20_optimize_goals.sh b/tests/19_optimize_goals.sh similarity index 100% rename from tests/20_optimize_goals.sh rename to tests/19_optimize_goals.sh diff --git a/tests/20_optimize_goals.tush b/tests/19_optimize_goals.tush similarity index 80% rename from tests/20_optimize_goals.tush rename to tests/19_optimize_goals.tush index 22fdfac..913cd37 100644 --- a/tests/20_optimize_goals.tush +++ b/tests/19_optimize_goals.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/20_optimize_goals.sh hello_empty +$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/19_optimize_goals.sh hello_empty | goal 'hello' ... | running bash | Hello world diff --git a/tests/12_update.sh b/tests/200_update.sh similarity index 100% rename from tests/12_update.sh rename to tests/200_update.sh diff --git a/tests/12_update.tush b/tests/200_update.tush similarity index 65% rename from tests/12_update.tush rename to tests/200_update.tush index dd14a87..066c5a3 100644 --- a/tests/12_update.tush +++ b/tests/200_update.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_err +$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_err | goal 'makesure_prepared' ... | goal 'test_err' ... | XXX @@ -7,7 +7,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_err @ wget/curl no found ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_wget | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' +$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_wget | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' | goal 'makesure_prepared' ... | goal 'wget_prepared' ... | goal 'test_wget' ... @@ -18,7 +18,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_wget | awk '{ sub(/[0-9][0 | you have latest version YYY installed | YYY -$ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_curl | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' +$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_curl | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' | goal 'makesure_prepared' ... | goal 'curl_prepared' ... | goal 'test_curl' ... diff --git a/tests/21_list_goals.sh b/tests/20_list_goals.sh similarity index 100% rename from tests/21_list_goals.sh rename to tests/20_list_goals.sh diff --git a/tests/21_list_goals.tush b/tests/20_list_goals.tush similarity index 86% rename from tests/21_list_goals.tush rename to tests/20_list_goals.tush index a9433e1..6926747 100644 --- a/tests/21_list_goals.tush +++ b/tests/20_list_goals.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_list_goals.sh -l +$ cd "$MYDIR"; ./$MAKESURE -f tests/20_list_goals.sh -l | Available goals: | aaa : some description | other_goal : do something important @@ -8,7 +8,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/21_list_goals.sh -l | yet_another_goal_looooooooooooooooooong : do something even more important | hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_list_goals.sh -la +$ cd "$MYDIR"; ./$MAKESURE -f tests/20_list_goals.sh -la | Available goals: | aaa : some description | other_goal : do something important diff --git a/tests/22_parsing 1.txt b/tests/21_parsing 1.txt similarity index 100% rename from tests/22_parsing 1.txt rename to tests/21_parsing 1.txt diff --git a/tests/22_parsing 2.txt b/tests/21_parsing 2.txt similarity index 100% rename from tests/22_parsing 2.txt rename to tests/21_parsing 2.txt diff --git a/tests/21_parsing.tush b/tests/21_parsing.tush new file mode 100644 index 0000000..df4d842 --- /dev/null +++ b/tests/21_parsing.tush @@ -0,0 +1,24 @@ + +$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh -la +| Available goals: +| 21_parsing 1.txt +| 21_parsing 2.txt +| 21_parsing*.txt +| test2 + +$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh test2 +| goal '21_parsing 2.txt' ... +| 21_parsing 2.txt +| 2 +| goal 'test2' [empty]. + + +$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_comments.sh -la +| Available goals: +| goal_with_comment +| test1 + +$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_comments.sh test1 +| goal 'goal_with_comment' ... +| goal_with_comment +| goal 'test1' [empty]. diff --git a/tests/22_parsing_comments.sh b/tests/21_parsing_comments.sh similarity index 100% rename from tests/22_parsing_comments.sh rename to tests/21_parsing_comments.sh diff --git a/tests/21_parsing_spaces.sh b/tests/21_parsing_spaces.sh new file mode 100644 index 0000000..80b1f61 --- /dev/null +++ b/tests/21_parsing_spaces.sh @@ -0,0 +1,8 @@ + + +@goal @glob 21_parsing*.txt + echo "$ITEM" + cat "$ITEM" + +@goal test2 +@depends_on '21_parsing 2.txt' \ No newline at end of file diff --git a/tests/22_parsing.tush b/tests/22_parsing.tush deleted file mode 100644 index 5d6efb3..0000000 --- a/tests/22_parsing.tush +++ /dev/null @@ -1,24 +0,0 @@ - -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_parsing_spaces.sh -la -| Available goals: -| 22_parsing 1.txt -| 22_parsing 2.txt -| 22_parsing*.txt -| test2 - -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_parsing_spaces.sh test2 -| goal '22_parsing 2.txt' ... -| 22_parsing 2.txt -| 2 -| goal 'test2' [empty]. - - -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_parsing_comments.sh -la -| Available goals: -| goal_with_comment -| test1 - -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_parsing_comments.sh test1 -| goal 'goal_with_comment' ... -| goal_with_comment -| goal 'test1' [empty]. diff --git a/tests/22_parsing_spaces.sh b/tests/22_parsing_spaces.sh deleted file mode 100644 index 2632291..0000000 --- a/tests/22_parsing_spaces.sh +++ /dev/null @@ -1,8 +0,0 @@ - - -@goal @glob 22_parsing*.txt - echo "$ITEM" - cat "$ITEM" - -@goal test2 -@depends_on '22_parsing 2.txt' \ No newline at end of file