Skip to content

Commit

Permalink
Natural ordering of @goal @glob is broken #64 : rename the slowest te…
Browse files Browse the repository at this point in the history
…st 12 -> 200 to run last
  • Loading branch information
xonixx committed Oct 10, 2021
1 parent fc45e34 commit 69ec6e2
Show file tree
Hide file tree
Showing 36 changed files with 147 additions and 147 deletions.
File renamed without changes.
37 changes: 37 additions & 0 deletions tests/12_errors.tush
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tests/14_doc.sh → tests/13_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions tests/13_doc.tush
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/13_doc_multi2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

@goal @glob 13_doc.tush
@doc d1
@doc d2
37 changes: 0 additions & 37 deletions tests/13_errors.tush

This file was deleted.

17 changes: 0 additions & 17 deletions tests/14_doc.tush

This file was deleted.

4 changes: 0 additions & 4 deletions tests/14_doc_multi2.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tests/15_private.sh → tests/14_private.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 15 additions & 0 deletions tests/14_private.tush
Original file line number Diff line number Diff line change
@@ -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


File renamed without changes.
20 changes: 20 additions & 0 deletions tests/15_lib.tush
Original file line number Diff line number Diff line change
@@ -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

File renamed without changes.
15 changes: 0 additions & 15 deletions tests/15_private.tush

This file was deleted.

20 changes: 0 additions & 20 deletions tests/16_lib.tush

This file was deleted.

2 changes: 1 addition & 1 deletion tests/17_prelude_fail.sh → tests/16_prelude_fail.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


echo "hello"
exit 17
exit 47
echo "world"

@goal default
Expand Down
6 changes: 6 additions & 0 deletions tests/16_prelude_fail.tush
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


$ cd "$MYDIR"; ./$MAKESURE -f tests/16_prelude_fail.sh
| hello
| prelude failed
? 47
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions tests/17_prelude_fail.tush

This file was deleted.

File renamed without changes.
10 changes: 5 additions & 5 deletions tests/19_vars_priority.tush → tests/18_vars_priority.tush
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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
Expand All @@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/12_update.tush → tests/200_update.tush
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

$ 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
| goal 'test_err' failed
@ 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' ...
Expand All @@ -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' ...
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/21_list_goals.tush → tests/20_list_goals.tush
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions tests/21_parsing.tush
Original file line number Diff line number Diff line change
@@ -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].
File renamed without changes.
8 changes: 8 additions & 0 deletions tests/21_parsing_spaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


@goal @glob 21_parsing*.txt
echo "$ITEM"
cat "$ITEM"

@goal test2
@depends_on '21_parsing 2.txt'
24 changes: 0 additions & 24 deletions tests/22_parsing.tush

This file was deleted.

Loading

0 comments on commit 69ec6e2

Please sign in to comment.