Skip to content

Commit

Permalink
Compact makesure_stable by removing comments, empty lines #32
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Sep 3, 2021
1 parent 04e8772 commit f4375fb
Show file tree
Hide file tree
Showing 18 changed files with 89 additions and 88 deletions.
7 changes: 4 additions & 3 deletions Makesurefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
@lib testing_tush
function run_tush_file() {
local f="$1"
local makesure="$2"

before_count=$(calc_temp_files)

Expand Down Expand Up @@ -96,12 +95,14 @@
@goal @glob tests/*.tush @private
@depends_on prepared4tests
@use_lib testing_tush
run_tush_file "$ITEM" makesure
MAKESURE=makesure \
run_tush_file "$ITEM"

@goal test_stable_version @glob tests/*.tush @private
@depends_on prepared4tests
@use_lib testing_tush
run_tush_file "$ITEM" makesure_stable
MAKESURE=makesure_stable \
run_tush_file "$ITEM"

@goal tested
@doc runs all tests with default awk on './makesure'
Expand Down
12 changes: 6 additions & 6 deletions tests/0_basic.tush
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

$ cd "$MYDIR"; ./makesure -v; ./makesure --version
$ cd "$MYDIR"; ./$MAKESURE -v; ./$MAKESURE --version
| NEXT_VERSION
| NEXT_VERSION

$ cd "$MYDIR/tests/emptydir"; ../../makesure -v
$ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE -v
| NEXT_VERSION

$ cd "$MYDIR/tests/emptydir"; ../../makesure -h
$ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE -h
| makesure ver. NEXT_VERSION
| Usage: makesure [options...] [-f buildfile] [goals...]
| -f,--file buildfile
Expand All @@ -23,14 +23,14 @@ $ cd "$MYDIR/tests/emptydir"; ../../makesure -h
| -h,--help print help and exit
| -U,--selfupdate update makesure to latest version

$ cd "$MYDIR"; ./makesure -f non-existent-file
$ cd "$MYDIR"; ./$MAKESURE -f non-existent-file
@ makesure file not found: non-existent-file
? 1

$ cd "$MYDIR/tests/emptydir"; ../../makesure
$ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE
@ makesure file not found: Makesurefile
? 1

$ cd "$MYDIR"; ./makesure -f tests/dir
$ cd "$MYDIR"; ./$MAKESURE -f tests/dir
| goal 'default' ...
| test
26 changes: 13 additions & 13 deletions tests/10_define.tush
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh testA
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testA
| goal 'testA' ...
| A=aaa

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh testB
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testB
| goal 'testB' ...
| B=aaabbb

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh -D B=xxx testB
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh -D B=xxx testB
| goal 'testB' ...
| B=xxx

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh -D A=yyy testB
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh -D A=yyy testB
| goal 'testB' ...
| B=yyybbb

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh testC
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testC
| goal 'testC' ...
| C=

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh testABC
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testABC
| goal 'testA' ...
| A=aaa
| goal 'testB' ...
Expand All @@ -28,7 +28,7 @@ $ cd "$MYDIR"; ./makesure -f tests/10_define.sh testABC
| C=
| goal 'testABC' [empty].

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh testABC --define A=111 -D "B=222" --define 'C=333'
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testABC --define A=111 -D "B=222" --define 'C=333'
| goal 'testA' ...
| A=111
| goal 'testB' ...
Expand All @@ -37,13 +37,13 @@ $ cd "$MYDIR"; ./makesure -f tests/10_define.sh testABC --define A=111 -D "B=222
| C=333
| goal 'testABC' [empty].

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh must_be_reached1
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh must_be_reached1
| goal 'must_be_reached1' [already satisfied].

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh must_be_reached2
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh must_be_reached2
| goal 'must_be_reached2' [already satisfied].

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh children_reached_or_not
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh children_reached_or_not
| goal 'must_be_reached1' [already satisfied].
| goal 'must_be_reached2' [already satisfied].
| goal 'other_goal_2' ...
Expand All @@ -52,21 +52,21 @@ $ cd "$MYDIR"; ./makesure -f tests/10_define.sh children_reached_or_not
| should show
| goal 'children_reached_or_not' [empty].

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh is_not_reached
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh is_not_reached
| goal 'other_goal_2' ...
| other goal 2
| goal 'is_not_reached' ...
| should show

$ cd "$MYDIR"; ./makesure -f tests/10_define.sh children_reached_or_not -d
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh children_reached_or_not -d
| Resolved goals to reach for 'children_reached_or_not':
| must_be_reached1
| must_be_reached2
| other_goal_2
| is_not_reached
| children_reached_or_not

$ cd "$MYDIR"; ./makesure -f tests/10_define_in_goal.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define_in_goal.sh
@ Only use @define in prelude:
@ tests/10_define_in_goal.sh:3: @define A=1
? 1
Expand Down
6 changes: 3 additions & 3 deletions tests/11_goal_glob.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; ./makesure -f tests/11_goal_glob.sh test1 -l
$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh test1 -l
| Available goals:
| 11_goal_glob_1.txt - test goal_glob
| 11_goal_glob_2.txt - test goal_glob
Expand All @@ -10,7 +10,7 @@ $ cd "$MYDIR"; ./makesure -f tests/11_goal_glob.sh test1 -l
| goal_name@11_goal_glob_2.txt
| goal_name@11_goal_glob_3.txt

$ cd "$MYDIR"; ./makesure -f tests/11_goal_glob.sh test1
$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh test1
| goal '11_goal_glob_1.txt' ...
| 11_goal_glob_1.txt :: 0 :: 3
| content 111
Expand All @@ -20,7 +20,7 @@ $ cd "$MYDIR"; ./makesure -f tests/11_goal_glob.sh test1
| content 333
| goal 'test1' [empty].

$ cd "$MYDIR"; ./makesure -f tests/11_goal_glob.sh test2
$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh test2
| goal 'goal_name@11_goal_glob_2.txt' ...
| goal_name ::: 11_goal_glob_2.txt :: 1 :: 3
| goal 'goal_name@11_goal_glob_3.txt' ...
Expand Down
6 changes: 3 additions & 3 deletions tests/12_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/12_update.sh test_err
| goal 'makesure_prepared' ...
| goal 'run_selfupdate' ...
| XXX
| goal 'run_selfupdate' failed
@ wget/curl no found
? 1

$ cd "$MYDIR"; ./makesure -f tests/12_update.sh test_wget
$ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_wget
| goal 'makesure_prepared' ...
| goal 'wget_prepared' ...
| goal 'run_selfupdate' ...
Expand All @@ -19,7 +19,7 @@ $ cd "$MYDIR"; ./makesure -f tests/12_update.sh test_wget
| 0.9.7.1
| goal 'test_wget' [empty].

$ cd "$MYDIR"; ./makesure -f tests/12_update.sh test_curl
$ cd "$MYDIR"; ./$MAKESURE -f tests/12_update.sh test_curl
| goal 'makesure_prepared' ...
| goal 'curl_prepared' ...
| goal 'run_selfupdate' ...
Expand Down
2 changes: 1 addition & 1 deletion tests/13_errors.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; ./makesure -f tests/13_errors.sh
$ 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:
Expand Down
6 changes: 3 additions & 3 deletions tests/14_doc.tush
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@


$ cd "$MYDIR"; ./makesure -f tests/14_doc_multi1.sh
$ 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
$ 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
$ cd "$MYDIR"; ./$MAKESURE -f tests/14_doc.sh -l
| Available goals:
| a - doc for a
| b - doc for b
Expand Down
4 changes: 2 additions & 2 deletions tests/15_private.tush
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@


$ cd "$MYDIR"; ./makesure -f tests/15_private.sh -l
$ 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
$ cd "$MYDIR"; ./$MAKESURE -f tests/15_private.sh --list-all
| Available goals:
| a
| b
Expand Down
8 changes: 4 additions & 4 deletions tests/16_lib.tush
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@


$ cd "$MYDIR"; ./makesure -f tests/16_lib.sh -l
$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib.sh -l
| Available goals:
| g1
| g2

$ cd "$MYDIR"; ./makesure -f tests/16_lib.sh g1
$ cd "$MYDIR"; ./$MAKESURE -f tests/16_lib.sh g1
| goal 'g1' ...
| Hello World

$ cd "$MYDIR"; ./makesure -f tests/16_lib.sh g2
$ 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
$ 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
Expand Down
24 changes: 12 additions & 12 deletions tests/1_goals.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh
| goal 'ddd' ...
| ddd
| goal 'ccc' ...
Expand All @@ -10,19 +10,19 @@ $ cd "$MYDIR"; ./makesure -f tests/1_goals.sh
| aaa
| goal 'default' [empty].

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh -s
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -s
| ddd
| ccc
| bbb
| aaa

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh --silent
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh --silent
| ddd
| ccc
| bbb
| aaa

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh -l
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -l
| Available goals:
| default
| aaa - Documenatation for aaa
Expand All @@ -32,48 +32,48 @@ $ cd "$MYDIR"; ./makesure -f tests/1_goals.sh -l
| fail
| fail123

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh -d
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -d
| Resolved goals to reach for 'default':
| ddd
| ccc
| bbb
| aaa
| default

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh fail
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh fail
| goal 'fail' ...
| stdout
| goal 'fail' failed
@ stderr
? 1

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh fail123
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh fail123
| goal 'fail123' ...
| stdout
| goal 'fail123' failed
@ stderr
? 123

$ cd "$MYDIR"; ./makesure -f tests/1_goals_unknown.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_unknown.sh
@ Goal 'a' has unknown dependency 'unknown':
@ tests/1_goals_unknown.sh:3: @depends_on unknown
? 1

$ cd "$MYDIR"; ./makesure -f tests/1_goals.sh zzz
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh zzz
@ Goal not found: zzz
? 1

$ cd "$MYDIR"; ./makesure -f tests/1_goals_already_defined.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_already_defined.sh
@ Goal 'a' is already defined:
@ tests/1_goals_already_defined.sh:5: @goal a
? 1

$ cd "$MYDIR"; ./makesure -f tests/1_goals_no_name.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_no_name.sh
@ Goal must have a name:
@ tests/1_goals_no_name.sh:5: @goal
? 1

$ cd "$MYDIR"; ./makesure -f tests/1_goals_multi_reached_if.sh
$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_multi_reached_if.sh
@ Multiple @reached_if not allowed for a goal:
@ tests/1_goals_multi_reached_if.sh:4: @reached_if false
? 1
Loading

0 comments on commit f4375fb

Please sign in to comment.