Skip to content

Commit

Permalink
rm unnecessary cd "$MYDIR" from all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Jan 3, 2024
1 parent 28bfb78 commit 3c0c377
Show file tree
Hide file tree
Showing 30 changed files with 192 additions and 192 deletions.
8 changes: 4 additions & 4 deletions tests/0_basic.tush
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

$ cd "$MYDIR"; ./$MAKESURE -v | awk -v "v=$NEXT_VERSION" '{ sub(v,"XXX") } 1'
$ ./$MAKESURE -v | awk -v "v=$NEXT_VERSION" '{ sub(v,"XXX") } 1'
| XXX

$ cd "$MYDIR"; ./$MAKESURE --version | awk -v "v=$NEXT_VERSION" '{ sub(v,"XXX") } 1'
$ ./$MAKESURE --version | awk -v "v=$NEXT_VERSION" '{ sub(v,"XXX") } 1'
| XXX

$ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE -v | awk -v "v=$NEXT_VERSION" '{ sub(v,"XXX") } 1'
Expand All @@ -25,14 +25,14 @@ $ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE -h | awk -v "v=$NEXT_VERSION" '{ s
| -h,--help print help and exit
| -U,--selfupdate update makesure to latest version

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

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

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

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

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testA -D A="val with spaces\"'"
$ ./$MAKESURE -f tests/10_define.sh testA -D A="val with spaces\"'"
| goal 'testA' ...
| A=val with spaces"'

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

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh -D B=xxx testB
$ ./$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
$ ./$MAKESURE -f tests/10_define.sh -D A=yyy testB
| goal 'testB' ...
| B=yyybbb

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

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testABC
$ ./$MAKESURE -f tests/10_define.sh testABC
| goal 'testA' ...
| A=aaa
| goal 'testB' ...
Expand All @@ -32,7 +32,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'
$ ./$MAKESURE -f tests/10_define.sh testABC --define A=111 -D "B=222" --define 'C=333'
| goal 'testA' ...
| A=111
| goal 'testB' ...
Expand All @@ -41,13 +41,13 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh testABC --define A=111 -D "B=22
| C=333
| goal 'testABC' [empty].

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh must_be_reached1
$ ./$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
$ ./$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
$ ./$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 @@ -56,31 +56,31 @@ $ 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
$ ./$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
$ ./$MAKESURE -f tests/10_define.sh children_reached_or_not -d
| Resolved goals to reach for 'children_reached_or_not':
| other_goal_2
| is_not_reached

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh test_commented_define
$ ./$MAKESURE -f tests/10_define.sh test_commented_define
| goal 'test_commented_define' ...
| in goal: value
| in child process: value

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define.sh echo
$ ./$MAKESURE -f tests/10_define.sh echo
| goal 'echo' ...
| Hello

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define_in_goal.sh
$ ./$MAKESURE -f tests/10_define_in_goal.sh
@ Shell code is not allowed outside goals/libs:
@ tests/10_define_in_goal.sh:4: echo "$0"
? 1

$ cd "$MYDIR"; ./$MAKESURE -f tests/10_define_issue_142.sh issue142
$ ./$MAKESURE -f tests/10_define_issue_142.sh issue142
| goal 'issue142' ...
| a b
16 changes: 8 additions & 8 deletions tests/11_goal_glob.tush
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh -l
$ ./$MAKESURE -f tests/11_goal_glob.sh -l
| Available goals:
| '11_goal_glob*.txt' : test goal_glob
| 'non-existent-glob*'
| test1
| test2
| glob_goal_name

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh -la
$ ./$MAKESURE -f tests/11_goal_glob.sh -la
| Available goals:
| 11_goal_glob_1.txt : test goal_glob
| 11_goal_glob_2.txt : test goal_glob
Expand All @@ -23,13 +23,13 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh -la
| glob_goal_name@11_goal_glob_10.txt
| glob_goal_name

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh -d '11_goal_glob*.txt'
$ ./$MAKESURE -f tests/11_goal_glob.sh -d '11_goal_glob*.txt'
| Resolved goals to reach for '11_goal_glob*.txt':
| 11_goal_glob_1.txt
| 11_goal_glob_3.txt
| 11_goal_glob_10.txt

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh test1
$ ./$MAKESURE -f tests/11_goal_glob.sh test1
| goal '11_goal_glob_1.txt' ...
| 11_goal_glob_1.txt :: 0 :: 4
| content 111
Expand All @@ -39,14 +39,14 @@ $ 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
$ ./$MAKESURE -f tests/11_goal_glob.sh test2
| goal 'glob_goal_name@11_goal_glob_2.txt' ...
| glob_goal_name ::: 11_goal_glob_2.txt :: 1 :: 4
| goal 'glob_goal_name@11_goal_glob_3.txt' ...
| glob_goal_name ::: 11_goal_glob_3.txt :: 2 :: 4
| goal 'test2' [empty].

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh glob_goal_name
$ ./$MAKESURE -f tests/11_goal_glob.sh glob_goal_name
| goal 'glob_goal_name@11_goal_glob_1.txt' ...
| glob_goal_name ::: 11_goal_glob_1.txt :: 0 :: 4
| goal 'glob_goal_name@11_goal_glob_2.txt' ...
Expand All @@ -57,7 +57,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh glob_goal_name
| glob_goal_name ::: 11_goal_glob_10.txt :: 3 :: 4
| goal 'glob_goal_name' [empty].

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob_lib.sh '11_goal_glob*.txt'
$ ./$MAKESURE -f tests/11_goal_glob_lib.sh '11_goal_glob*.txt'
| goal '11_goal_glob_1.txt' ...
| Unnamed lib ::: 11_goal_glob_1.txt :: 0 :: 4
| @glob ::: 11_goal_glob_1.txt :: 0 :: 4
Expand All @@ -72,7 +72,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob_lib.sh '11_goal_glob*.txt'
| @glob ::: 11_goal_glob_10.txt :: 3 :: 4
| goal '11_goal_glob*.txt' [empty].

$ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob_lib.sh glob_goal_name
$ ./$MAKESURE -f tests/11_goal_glob_lib.sh glob_goal_name
| goal 'glob_goal_name@11_goal_glob_1.txt' ...
| lib lib_name ::: 11_goal_glob_1.txt :: 0 :: 4
| glob_goal_name ::: 11_goal_glob_1.txt :: 0 :: 4
Expand Down
2 changes: 1 addition & 1 deletion tests/12_errors.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; ./$MAKESURE -f tests/12_errors.sh
$ ./$MAKESURE -f tests/12_errors.sh
@ Shell code is not allowed outside goals/libs:
@ tests/12_errors.sh:2: echo 'code in prelude'
@ Only use @reached_if in @goal:
Expand Down
6 changes: 3 additions & 3 deletions tests/13_doc.tush
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@


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


$ cd "$MYDIR"; ./$MAKESURE -f tests/14_private.sh -l
$ ./$MAKESURE -f tests/14_private.sh -l
| Available goals:
| a
| 14_private.sh

$ cd "$MYDIR"; ./$MAKESURE -f tests/14_private.sh --list-all
$ ./$MAKESURE -f tests/14_private.sh --list-all
| Available goals:
| a
| b
Expand Down
12 changes: 6 additions & 6 deletions tests/15_lib.tush
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@


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

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

$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh g2
$ ./$MAKESURE -f tests/15_lib.sh g2
| goal 'g2' ...
| Hello lib_name World

$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh g3
$ ./$MAKESURE -f tests/15_lib.sh g3
| goal 'g3' [already satisfied].

$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib.sh g4
$ ./$MAKESURE -f tests/15_lib.sh g4
| goal 'g4' ...
| Should see this

$ cd "$MYDIR"; ./$MAKESURE -f tests/15_lib_unknown.sh g3
$ ./$MAKESURE -f tests/15_lib_unknown.sh g3
@ Goal 'g3' uses unknown lib 'unknown':
@ tests/15_lib_unknown.sh:3: @use_lib unknown
? 1
4 changes: 2 additions & 2 deletions tests/16_define_validation.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; ./$MAKESURE -f tests/16_define_validation_pass.sh
$ ./$MAKESURE -f tests/16_define_validation_pass.sh
| goal 'default' ...
| EMPTY=
| EMPTY1=
Expand Down Expand Up @@ -30,7 +30,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/16_define_validation_pass.sh
| KC1=aaabbbcc'ca b ceee
| LC1=aaabbb bbbcc'c cc'ca b ceee eee

$ cd "$MYDIR"; ./$MAKESURE -f tests/16_define_validation_error.sh
$ ./$MAKESURE -f tests/16_define_validation_error.sh
@ Invalid @define syntax, should be @define VAR_NAME 'value':
@ tests/16_define_validation_error.sh:2: @define echo
@ Syntax error: wrong unquoted: 'echo;':
Expand Down
2 changes: 1 addition & 1 deletion tests/17_empty_prelude.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/17_empty_prelude.sh
$ PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/17_empty_prelude.sh
| goal 'default' ...
| running bash
| hello
16 changes: 8 additions & 8 deletions tests/18_vars_priority.tush
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@

$ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh
$ ./$MAKESURE -f tests/18_vars_priority.sh
| goal 'default' ...
| A=
| V=V_prelude
| in child: A=
| in child: V=V_prelude

$ cd "$MYDIR"; A=A_env ./$MAKESURE -f tests/18_vars_priority.sh
$ A=A_env ./$MAKESURE -f tests/18_vars_priority.sh
| goal 'default' ...
| A=A_env
| V=V_prelude
| in child: A=A_env
| in child: V=V_prelude

$ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/18_vars_priority.sh
$ V=V_env ./$MAKESURE -f tests/18_vars_priority.sh
| goal 'default' ...
| A=
| V=V_prelude
| in child: A=
| in child: V=V_prelude

$ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D
$ ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D
| goal 'default' ...
| A=
| V=V_D
| in child: A=
| in child: V=V_D

$ cd "$MYDIR"; V=V_env ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D
$ V=V_env ./$MAKESURE -f tests/18_vars_priority.sh -D V=V_D
| goal 'default' ...
| A=
| V=V_D
| in child: A=
| in child: V=V_D

$ cd "$MYDIR"; ./$MAKESURE -f tests/18_vars_priority.sh g
$ ./$MAKESURE -f tests/18_vars_priority.sh g
| goal 'g' ...
| E=defaultVal

$ cd "$MYDIR"; E=fromEnv ./$MAKESURE -f tests/18_vars_priority.sh g
$ E=fromEnv ./$MAKESURE -f tests/18_vars_priority.sh g
| goal 'g' ...
| E=fromEnv

$ cd "$MYDIR"; E=fromEnv ./$MAKESURE -f tests/18_vars_priority.sh -D E=fromD g
$ E=fromEnv ./$MAKESURE -f tests/18_vars_priority.sh -D E=fromD g
| goal 'g' ...
| E=fromD
2 changes: 1 addition & 1 deletion tests/19_optimize_goals.tush
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

$ cd "$MYDIR"; PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/19_optimize_goals.sh hello_empty
$ PATH=tests/wrapper/bash:$PATH ./$MAKESURE -f tests/19_optimize_goals.sh hello_empty
| goal 'hello' ...
| running bash
| Hello world
Expand Down
Loading

0 comments on commit 3c0c377

Please sign in to comment.