From 3c0c3776743c4771f3fcdfc5bdc1151963cbeb30 Mon Sep 17 00:00:00 2001 From: xonix Date: Wed, 3 Jan 2024 19:34:18 +0200 Subject: [PATCH] rm unnecessary `cd "$MYDIR"` from all tests --- tests/0_basic.tush | 8 ++-- tests/10_define.tush | 34 +++++++-------- tests/11_goal_glob.tush | 16 +++---- tests/12_errors.tush | 2 +- tests/13_doc.tush | 6 +-- tests/14_private.tush | 4 +- tests/15_lib.tush | 12 +++--- tests/16_define_validation.tush | 4 +- tests/17_empty_prelude.tush | 2 +- tests/18_vars_priority.tush | 16 +++---- tests/19_optimize_goals.tush | 2 +- tests/1_goals.tush | 26 +++++------ tests/200_update.tush | 6 +-- tests/20_list_goals.tush | 4 +- tests/21_parsing.tush | 24 +++++------ tests/22_nat_order.tush | 4 +- tests/23_bash_glob.tush | 2 +- tests/24_define_everywhere.tush | 4 +- tests/25_lazy_reached_if.tush | 12 +++--- tests/26_resolved.tush | 10 ++--- tests/27_parameterized_goals.tush | 72 +++++++++++++++---------------- tests/28_revamp_define.tush | 24 +++++------ tests/2_mydir.tush | 24 +++++------ tests/3_loop.tush | 2 +- tests/4_trace.tush | 12 +++--- tests/5_shell.tush | 10 ++--- tests/6_reached_if.tush | 16 +++---- tests/7_options.tush | 8 ++-- tests/8_timing.tush | 10 ++--- tests/9_prelude.tush | 8 ++-- 30 files changed, 192 insertions(+), 192 deletions(-) diff --git a/tests/0_basic.tush b/tests/0_basic.tush index 1e75b83..04aaf46 100644 --- a/tests/0_basic.tush +++ b/tests/0_basic.tush @@ -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' @@ -25,7 +25,7 @@ $ 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 @@ -33,6 +33,6 @@ $ cd "$MYDIR/tests/emptydir"; ../../$MAKESURE @ makesure file not found: Makesurefile ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/dir +$ ./$MAKESURE -f tests/dir | goal 'default' ... | test diff --git a/tests/10_define.tush b/tests/10_define.tush index 7272ada..fc66b8b 100644 --- a/tests/10_define.tush +++ b/tests/10_define.tush @@ -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' ... @@ -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' ... @@ -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' ... @@ -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 diff --git a/tests/11_goal_glob.tush b/tests/11_goal_glob.tush index e949d2e..f041e1a 100644 --- a/tests/11_goal_glob.tush +++ b/tests/11_goal_glob.tush @@ -1,5 +1,5 @@ -$ 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*' @@ -7,7 +7,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/11_goal_glob.sh -l | 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 @@ -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 @@ -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' ... @@ -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 @@ -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 diff --git a/tests/12_errors.tush b/tests/12_errors.tush index 3d0cc4c..30071cd 100644 --- a/tests/12_errors.tush +++ b/tests/12_errors.tush @@ -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: diff --git a/tests/13_doc.tush b/tests/13_doc.tush index 2b55a54..55dae08 100644 --- a/tests/13_doc.tush +++ b/tests/13_doc.tush @@ -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 diff --git a/tests/14_private.tush b/tests/14_private.tush index 2970ee4..b754075 100644 --- a/tests/14_private.tush +++ b/tests/14_private.tush @@ -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 diff --git a/tests/15_lib.tush b/tests/15_lib.tush index 201d260..1bd68dd 100644 --- a/tests/15_lib.tush +++ b/tests/15_lib.tush @@ -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 diff --git a/tests/16_define_validation.tush b/tests/16_define_validation.tush index cf6c3c3..5eb4a74 100644 --- a/tests/16_define_validation.tush +++ b/tests/16_define_validation.tush @@ -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= @@ -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;': diff --git a/tests/17_empty_prelude.tush b/tests/17_empty_prelude.tush index 70dfa7c..eea2f6f 100644 --- a/tests/17_empty_prelude.tush +++ b/tests/17_empty_prelude.tush @@ -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 diff --git a/tests/18_vars_priority.tush b/tests/18_vars_priority.tush index be88287..fc986d6 100644 --- a/tests/18_vars_priority.tush +++ b/tests/18_vars_priority.tush @@ -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 diff --git a/tests/19_optimize_goals.tush b/tests/19_optimize_goals.tush index 913cd37..b0d2632 100644 --- a/tests/19_optimize_goals.tush +++ b/tests/19_optimize_goals.tush @@ -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 diff --git a/tests/1_goals.tush b/tests/1_goals.tush index 90836bb..1363384 100644 --- a/tests/1_goals.tush +++ b/tests/1_goals.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh +$ ./$MAKESURE -f tests/1_goals.sh | goal 'ddd' ... | ddd | goal 'ccc' ... @@ -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 +$ ./$MAKESURE -f tests/1_goals.sh -s | ddd | ccc | bbb | aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh --silent +$ ./$MAKESURE -f tests/1_goals.sh --silent | ddd | ccc | bbb | aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -l +$ ./$MAKESURE -f tests/1_goals.sh -l | Available goals: | default | aaa : Documenatation for aaa @@ -32,50 +32,50 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -l | fail | fail123 -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh -d +$ ./$MAKESURE -f tests/1_goals.sh -d | Resolved goals to reach for 'default': | ddd | ccc | bbb | aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh fail +$ ./$MAKESURE -f tests/1_goals.sh fail | goal 'fail' ... | stdout | goal 'fail' failed @ stderr ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals.sh fail123 +$ ./$MAKESURE -f tests/1_goals.sh fail123 | goal 'fail123' ... | stdout | goal 'fail123' failed @ stderr ? 123 -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_unknown.sh +$ ./$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 +$ ./$MAKESURE -f tests/1_goals.sh zzz @ Goal not found: zzz ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_goals_already_defined.sh +$ ./$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 +$ ./$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 +$ ./$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 -$ cd "$MYDIR"; ./$MAKESURE -f tests/1_empty.sh -l +$ ./$MAKESURE -f tests/1_empty.sh -l | Available goals: diff --git a/tests/200_update.tush b/tests/200_update.tush index 0485a87..8f01013 100644 --- a/tests/200_update.tush +++ b/tests/200_update.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_err +$ ./$MAKESURE -f tests/200_update.sh test_err | goal 'makesure_prepared' ... | goal 'test_err' ... | XXX @@ -7,7 +7,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_err @ wget/curl not found ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_wget | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' +$ ./$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/200_update.sh test_wget | awk '{ sub(/[0-9][ | you have latest version YYY installed | YYY -$ cd "$MYDIR"; ./$MAKESURE -f tests/200_update.sh test_curl | awk '{ sub(/[0-9][0-9.]+/,"YYY") } 1' +$ ./$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/20_list_goals.tush b/tests/20_list_goals.tush index 6926747..32c9c81 100644 --- a/tests/20_list_goals.tush +++ b/tests/20_list_goals.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/20_list_goals.sh -l +$ ./$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/20_list_goals.sh -l | yet_another_goal_looooooooooooooooooong : do something even more important | hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/20_list_goals.sh -la +$ ./$MAKESURE -f tests/20_list_goals.sh -la | Available goals: | aaa : some description | other_goal : do something important diff --git a/tests/21_parsing.tush b/tests/21_parsing.tush index 7901d94..e8502c1 100644 --- a/tests/21_parsing.tush +++ b/tests/21_parsing.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh -la +$ ./$MAKESURE -f tests/21_parsing_spaces.sh -la | Available goals: | $'21_parsing \'.txt' | '21_parsing 1.txt' @@ -16,35 +16,35 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh -la | test3 | test4 -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh test2 +$ ./$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_spaces.sh test3 +$ ./$MAKESURE -f tests/21_parsing_spaces.sh test3 | goal 'g1@21_parsing 2.txt' ... | 21_parsing 2.txt | 2 | goal 'test3' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_spaces.sh test4 +$ ./$MAKESURE -f tests/21_parsing_spaces.sh test4 | goal 'g2@21_parsing 2.txt' ... | 21_parsing 2.txt | 2 | goal 'test4' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_comments.sh -la +$ ./$MAKESURE -f tests/21_parsing_comments.sh -la | Available goals: | goal_with_comment : doc with comment | test1 : doc with comment -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_comments.sh test1 +$ ./$MAKESURE -f tests/21_parsing_comments.sh test1 | goal 'goal_with_comment' ... | goal_with_comment | goal 'test1' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_quoting.sh -l +$ ./$MAKESURE -f tests/21_parsing_quoting.sh -l | Available goals: | no_space : no_space | 'name with spaces' : name with spaces @@ -54,19 +54,19 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_quoting.sh -l | 'goal&c' | default -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_quoting.sh -d +$ ./$MAKESURE -f tests/21_parsing_quoting.sh -d | Resolved goals to reach for 'default': | no_space | 'name with spaces' | $'name with \' quote' -$ cd "$MYDIR"; bash -c "./$MAKESURE -f tests/21_parsing_quoting.sh -d default $'name with \' quote' 'goal|a'" +$ bash -c "./$MAKESURE -f tests/21_parsing_quoting.sh -d default $'name with \' quote' 'goal|a'" | Resolved goals to reach for 'default' $'name with \' quote' 'goal|a': | no_space | 'name with spaces' | $'name with \' quote' -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_quoting.sh +$ ./$MAKESURE -f tests/21_parsing_quoting.sh | goal 'no_space' ... | no_space | goal 'name with spaces' ... @@ -78,12 +78,12 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_quoting.sh | goal 'goal&c' [empty]. | goal 'default' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_err1.sh +$ ./$MAKESURE -f tests/21_parsing_err1.sh @ Syntax error: unterminated argument: @ tests/21_parsing_err1.sh:3: @goal 'goal name ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/21_parsing_err2.sh +$ ./$MAKESURE -f tests/21_parsing_err2.sh @ Syntax error: wrong unquoted: 'doc'text': @ tests/21_parsing_err2.sh:4: @doc doc'text ? 1 diff --git a/tests/22_nat_order.tush b/tests/22_nat_order.tush index a72afac..7471020 100644 --- a/tests/22_nat_order.tush +++ b/tests/22_nat_order.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_nat_order.sh nat_order_test +$ ./$MAKESURE -f tests/22_nat_order.sh nat_order_test | 0_basic.tush | 1_goals.tush | 2_mydir.tush @@ -23,7 +23,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/22_nat_order.sh nat_order_test | 20_list_goals.tush | 21_parsing.tush -$ cd "$MYDIR"; ./$MAKESURE -f tests/22_nat_order nat_order_test +$ ./$MAKESURE -f tests/22_nat_order nat_order_test | ../0_basic.tush | ../1_goals.tush | ../2_mydir.tush diff --git a/tests/23_bash_glob.tush b/tests/23_bash_glob.tush index cf976db..4f16ef8 100644 --- a/tests/23_bash_glob.tush +++ b/tests/23_bash_glob.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/23_bash_glob.sh g1 +$ ./$MAKESURE -f tests/23_bash_glob.sh g1 | goal 'g1@1_goals.tush' ... | 0 -> 1_goals.tush | goal 'g1@2_mydir.tush' ... diff --git a/tests/24_define_everywhere.tush b/tests/24_define_everywhere.tush index ddba2bc..0f3cd5f 100644 --- a/tests/24_define_everywhere.tush +++ b/tests/24_define_everywhere.tush @@ -1,11 +1,11 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/24_define_everywhere.sh +$ ./$MAKESURE -f tests/24_define_everywhere.sh | goal 'default' ... | a | ab | abc -$ cd "$MYDIR"; ./$MAKESURE -f tests/24_define_everywhere.sh -D B=bbb +$ ./$MAKESURE -f tests/24_define_everywhere.sh -D B=bbb | goal 'default' ... | a | bbb diff --git a/tests/25_lazy_reached_if.tush b/tests/25_lazy_reached_if.tush index 1f8f138..f8b634a 100644 --- a/tests/25_lazy_reached_if.tush +++ b/tests/25_lazy_reached_if.tush @@ -1,29 +1,29 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if_loop.sh a +$ ./$MAKESURE -f tests/25_lazy_reached_if_loop.sh a @ There is a loop in goal dependencies via a -> b ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if_loop.sh b +$ ./$MAKESURE -f tests/25_lazy_reached_if_loop.sh b @ There is a loop in goal dependencies via a -> b ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if.sh a +$ ./$MAKESURE -f tests/25_lazy_reached_if.sh a | reached_if@a | reached_if@b | goal 'b' [already satisfied]. | goal 'a' ... | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if.sh b +$ ./$MAKESURE -f tests/25_lazy_reached_if.sh b | reached_if@b | goal 'b' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if.sh c +$ ./$MAKESURE -f tests/25_lazy_reached_if.sh c | reached_if@c | goal 'c' ... | c -$ cd "$MYDIR"; ./$MAKESURE -f tests/25_lazy_reached_if.sh d +$ ./$MAKESURE -f tests/25_lazy_reached_if.sh d | goal 'd' ... | d diff --git a/tests/26_resolved.tush b/tests/26_resolved.tush index 8ed907f..5a2abbf 100644 --- a/tests/26_resolved.tush +++ b/tests/26_resolved.tush @@ -1,23 +1,23 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/26_resolved.sh --resolved a +$ ./$MAKESURE -f tests/26_resolved.sh --resolved a | Resolved goals to reach for 'a': | b | c | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/26_resolved.sh -D REACHED=c --resolved a +$ ./$MAKESURE -f tests/26_resolved.sh -D REACHED=c --resolved a | Resolved goals to reach for 'a': | b | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/26_resolved.sh -D REACHED=b --resolved a +$ ./$MAKESURE -f tests/26_resolved.sh -D REACHED=b --resolved a | Resolved goals to reach for 'a': | c | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/26_resolved.sh -D REACHED=bc --resolved a +$ ./$MAKESURE -f tests/26_resolved.sh -D REACHED=bc --resolved a | Resolved goals to reach for 'a': | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/26_resolved.sh -D REACHED=a --resolved a +$ ./$MAKESURE -f tests/26_resolved.sh -D REACHED=a --resolved a | Resolved goals to reach for 'a': diff --git a/tests/27_parameterized_goals.tush b/tests/27_parameterized_goals.tush index 1359783..dc15699 100644 --- a/tests/27_parameterized_goals.tush +++ b/tests/27_parameterized_goals.tush @@ -1,96 +1,96 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_1.sh -l | Available goals: | a | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1.sh -la +$ ./$MAKESURE -f tests/27_parameterized_goals_1.sh -la | Available goals: | a | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1.sh -d a +$ ./$MAKESURE -f tests/27_parameterized_goals_1.sh -d a | Resolved goals to reach for 'a': | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_1.sh a | goal 'b@hello' ... | hello world | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh -l | Available goals: | e | f | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh -d e +$ ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh -d e | Resolved goals to reach for 'e': | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh e +$ ./$MAKESURE -f tests/27_parameterized_goals_1_1.sh e | goal 'b@hello' ... | hello world | goal 'f' [empty]. | goal 'e' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh -l | Available goals: | a : doc a | c@hello : doc c -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -la +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh -la | Available goals: | a : doc a | b@hello : doc b | c@hello : doc c -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -d a +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh -d a | Resolved goals to reach for 'a': | c@hello | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh -d b@hello +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh -d b@hello | Resolved goals to reach for 'b@hello': | c@hello | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh a | goal 'c@hello' ... | hello world from c | goal 'b@hello' ... | hello world from b | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh b@hello +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh b@hello | goal 'c@hello' ... | hello world from c | goal 'b@hello' ... | hello world from b -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_2.sh c@hello +$ ./$MAKESURE -f tests/27_parameterized_goals_2.sh c@hello | goal 'c@hello' ... | hello world from c -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_3.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_3.sh -l | Available goals: | a | e | f | b@hello -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_3.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_3.sh a | goal 'b@hello' ... | hello world | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_3.sh e +$ ./$MAKESURE -f tests/27_parameterized_goals_3.sh e | goal 'b@hello' ... | hello world | goal 'f' [empty]. | goal 'e' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_4.sh -l | Available goals: | a | e @@ -100,7 +100,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh -l | 'b@hi hi hi' | b@salut -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_4.sh a | goal 'b@hello' ... | hello world | goal 'b@hi' ... @@ -111,11 +111,11 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh a | salut world | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh 'b@hi hi hi' +$ ./$MAKESURE -f tests/27_parameterized_goals_4.sh 'b@hi hi hi' | goal 'b@hi hi hi' ... | hi hi hi world -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh e +$ ./$MAKESURE -f tests/27_parameterized_goals_4.sh e | goal 'b@hello' ... | hello world | goal 'b@hi' ... @@ -123,60 +123,60 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_4.sh e | goal 'f' [empty]. | goal 'e' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err1.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err1.sh -l @ There is a loop in goal dependencies via a -> c ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err1.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err1.sh a @ There is a loop in goal dependencies via a -> c ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err2.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_6_loop_err2.sh a @ There is a loop in goal dependencies via b -> c ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_5_ok.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_5_ok.sh a | goal 'b@' ... | world from b | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_5_err1.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_5_err1.sh a @ wrong args count for 'b': @ tests/27_parameterized_goals_5_err1.sh:3: @depends_on b @args # err missing args ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_5_err2.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_5_err2.sh a @ wrong args count for 'b': @ tests/27_parameterized_goals_5_err2.sh:3: @depends_on b # err missing args ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_5_err3.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_5_err3.sh a @ wrong args count for 'b': @ tests/27_parameterized_goals_5_err3.sh:3: @depends_on b @args 'hello' 'hi' # err more args than params ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_7_err1.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_7_err1.sh a @ wrong arg 'ARG1': @ tests/27_parameterized_goals_7_err1.sh:3: @depends_on b @args ARG1 # err unknown arg @ wrong arg 'ARG2': @ tests/27_parameterized_goals_7_err1.sh:8: @depends_on c @args ARG2 # err unknown arg ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_8_err1.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_8_err1.sh a @ @args only allowed at position 3: @ tests/27_parameterized_goals_8_err1.sh:3: @depends_on c c @args 'hello' @ @args only allowed at position 3: @ tests/27_parameterized_goals_8_err1.sh:4: @depends_on @args 'hi' ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_9.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_9.sh -l | Available goals: | a | $'greet2@John@\'quoted\'' | greet@John | $'greet@\'quoted\'' -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_9.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_9.sh a | goal 'greet@John' ... | hello John | goal $'greet@\'quoted\'' ... @@ -184,14 +184,14 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_9.sh a | goal $'greet2@John@\'quoted\'' [empty]. | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_9.sh 'greet2@John@'\''quoted'\' +$ ./$MAKESURE -f tests/27_parameterized_goals_9.sh 'greet2@John@'\''quoted'\' | goal 'greet@John' ... | hello John | goal $'greet@\'quoted\'' ... | hello 'quoted' | goal $'greet2@John@\'quoted\'' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_10_errors.sh -l +$ ./$MAKESURE -f tests/27_parameterized_goals_10_errors.sh -l @ missing parameters: @ tests/27_parameterized_goals_10_errors.sh:25: @goal f @params # zero params is invalid @ missing parameters: @@ -240,7 +240,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_10_errors.sh -l @ tests/27_parameterized_goals_10_errors.sh:9: @depends_on e @args 'arg1' # err args for non-PG ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_11_reached_if.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_11_reached_if.sh a | goal 'b@hi' ... | W is hi | goal 'b@hello' [already satisfied]. @@ -248,7 +248,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_11_reached_if.sh a | W is salut | goal 'a' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/27_parameterized_goals_12_lib.sh a +$ ./$MAKESURE -f tests/27_parameterized_goals_12_lib.sh a | goal 'b@hi' ... | in lib W=hi | goal 'b@hello' ... diff --git a/tests/28_revamp_define.tush b/tests/28_revamp_define.tush index 72a63d1..74e2521 100644 --- a/tests/28_revamp_define.tush +++ b/tests/28_revamp_define.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh -l +$ ./$MAKESURE -f tests/28_revamp_define_1.sh -l | Available goals: | g1 | g2 @@ -17,17 +17,17 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh -l | pg2@Str | 'pg@the Value' -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g1 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g1 | goal 'pg@Value' ... | A=Value | goal 'g1' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g2 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g2 | goal 'pg@Str1' ... | A=Str1 | goal 'g2' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g3 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g3 | goal 'pg@Str1' ... | A=Str1 | goal 'pg@Value' ... @@ -37,7 +37,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g3 | goal 'pg2@Str1' [empty]. | goal 'g3' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g4 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g4 | goal 'pg@Value' ... | A=Value | goal 'pg@Str' ... @@ -45,7 +45,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g4 | goal 'pg2@Value' [empty]. | goal 'g4' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g5 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g5 | goal 'pg@Value' ... | A=Value | goal 'pg@Str' ... @@ -53,7 +53,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g5 | goal 'pg2@Value' [empty]. | goal 'g5' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g6 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g6 | goal 'pg@Str' ... | A=Str | goal 'pg@Value' ... @@ -61,17 +61,17 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g6 | goal 'pg2@Str' [empty]. | goal 'g6' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g7 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g7 | goal 'pg@the Value' ... | A=the Value | goal 'g7' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_1.sh g8 +$ ./$MAKESURE -f tests/28_revamp_define_1.sh g8 | goal 'g8' ... | 1.2.3 email@example.com default\}$" -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_2_err_quoting.sh -l +$ ./$MAKESURE -f tests/28_revamp_define_2_err_quoting.sh -l @ Wrong quoting: sh: @ tests/28_revamp_define_2_err_quoting.sh:6: @shell "sh" @ Wrong quoting: tracing: @@ -104,13 +104,13 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_2_err_quoting.sh -l @ tests/28_revamp_define_2_err_quoting.sh:30: @depends_on pg "@args" 'value' ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_3_issue152.sh -l +$ ./$MAKESURE -f tests/28_revamp_define_3_issue152.sh -l | Available goals: | g | pg@aaa | pg@bbb -$ cd "$MYDIR"; ./$MAKESURE -f tests/28_revamp_define_4_interpolation_including_pg_params.sh g +$ ./$MAKESURE -f tests/28_revamp_define_4_interpolation_including_pg_params.sh g | goal 'pg1@hello world' ... | hello world | goal 'pg@world' [empty]. diff --git a/tests/2_mydir.tush b/tests/2_mydir.tush index a7c5ceb..ac0bd18 100644 --- a/tests/2_mydir.tush +++ b/tests/2_mydir.tush @@ -1,17 +1,17 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_1 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_1 | goal 'mydir_1' ... | mydir -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_2 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_2 | goal 'mydir_2' ... | mydir -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_3 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_3 | goal 'mydir_3' ... | mydir -$ cd "$MYDIR"; ./$MAKESURE -f tests/dir\ with\ spaces/2_mydir.sh +$ ./$MAKESURE -f tests/dir\ with\ spaces/2_mydir.sh | goal 'default' ... | mydir @@ -19,33 +19,33 @@ $ cd "$MYDIR/tests/dir with spaces"; ../../$MAKESURE -f 2_mydir.sh | goal 'default' ... | mydir -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_1 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_1 | goal 'mydir_in_reached_if_1' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_2 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_2 | goal 'mydir_in_reached_if_2' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_3 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_3 | goal 'mydir_in_reached_if_3' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_4 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_4 | goal 'mydir_in_reached_if_4' ... | should show -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_5 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_5 | goal 'mydir_in_reached_if_5' ... | should show -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_6 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_6 | goal 'mydir_in_reached_if_6' ... | should show -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_of_dep_1 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_of_dep_1 | goal 'dep_1' [already satisfied]. | goal 'mydir_in_reached_if_of_dep_1' ... | should show -$ cd "$MYDIR"; ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_of_dep_2 +$ ./$MAKESURE -f tests/2_mydir.sh mydir_in_reached_if_of_dep_2 | goal 'dep_3' ... | dep_3 | goal 'dep_2' ... diff --git a/tests/3_loop.tush b/tests/3_loop.tush index 698612a..c01eba4 100644 --- a/tests/3_loop.tush +++ b/tests/3_loop.tush @@ -1,4 +1,4 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/3_loop.sh a +$ ./$MAKESURE -f tests/3_loop.sh a @ There is a loop in goal dependencies via a -> c ? 1 diff --git a/tests/4_trace.tush b/tests/4_trace.tush index ffc9e7b..f5875b7 100644 --- a/tests/4_trace.tush +++ b/tests/4_trace.tush @@ -1,12 +1,12 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace.sh +$ ./$MAKESURE -f tests/4_trace.sh | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 | goal 'default' ... | A=aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace.sh -x 2>&1 | awk -f tests/unify_tracing_output.awk +$ ./$MAKESURE -f tests/4_trace.sh -x 2>&1 | awk -f tests/unify_tracing_output.awk | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 @@ -41,7 +41,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace.sh -x 2>&1 | awk -f tests/un @ + export A @ + echo A=aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace.sh --tracing 2>&1 | awk -f tests/unify_tracing_output.awk +$ ./$MAKESURE -f tests/4_trace.sh --tracing 2>&1 | awk -f tests/unify_tracing_output.awk | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 @@ -77,14 +77,14 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace.sh --tracing 2>&1 | awk -f tests/un @ + echo A=aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace_shell_sh.sh +$ ./$MAKESURE -f tests/4_trace_shell_sh.sh | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 | goal 'default' ... | A=aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace_shell_sh.sh -x 2>&1 | awk -f tests/unify_tracing_output.awk +$ ./$MAKESURE -f tests/4_trace_shell_sh.sh -x 2>&1 | awk -f tests/unify_tracing_output.awk | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 @@ -119,7 +119,7 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace_shell_sh.sh -x 2>&1 | awk -f @ + export A @ + echo A=aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/4_trace_shell_sh.sh --tracing 2>&1 | awk -f tests/unify_tracing_output.awk +$ ./$MAKESURE -f tests/4_trace_shell_sh.sh --tracing 2>&1 | awk -f tests/unify_tracing_output.awk | goal 'goal2' [already satisfied]. | goal 'goal1' ... | goal1 diff --git a/tests/5_shell.tush b/tests/5_shell.tush index 78d4a77..4882af2 100644 --- a/tests/5_shell.tush +++ b/tests/5_shell.tush @@ -1,23 +1,23 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/5_shell_bash.sh +$ ./$MAKESURE -f tests/5_shell_bash.sh | goal 'default' ... | bash -$ cd "$MYDIR"; ./$MAKESURE -f tests/5_shell_sh.sh +$ ./$MAKESURE -f tests/5_shell_sh.sh | goal 'default' ... | sh -$ cd "$MYDIR"; ./$MAKESURE -f tests/5_shell_sh.sh a +$ ./$MAKESURE -f tests/5_shell_sh.sh a | goal 'b' [already satisfied]. | goal 'a' ... | should show -$ cd "$MYDIR"; ./$MAKESURE -f tests/5_shell_not_supported.sh +$ ./$MAKESURE -f tests/5_shell_not_supported.sh @ Shell 'not_supported' is not supported: @ tests/5_shell_not_supported.sh:1: @shell not_supported ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/5_shell_in_goal.sh +$ ./$MAKESURE -f tests/5_shell_in_goal.sh @ Only use @shell in prelude: @ tests/5_shell_in_goal.sh:3: @shell sh ? 1 diff --git a/tests/6_reached_if.tush b/tests/6_reached_if.tush index dff43d5..3cf440b 100644 --- a/tests/6_reached_if.tush +++ b/tests/6_reached_if.tush @@ -1,33 +1,33 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if.sh +$ ./$MAKESURE -f tests/6_reached_if.sh | goal 'bbb' [already satisfied]. | goal 'aaa' ... | aaa | goal 'default' [empty]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if.sh -d +$ ./$MAKESURE -f tests/6_reached_if.sh -d | Resolved goals to reach for 'default': | aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if.sh --resolved bbb +$ ./$MAKESURE -f tests/6_reached_if.sh --resolved bbb | Resolved goals to reach for 'bbb': -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if_issue_113.sh g1 +$ ./$MAKESURE -f tests/6_reached_if_issue_113.sh g1 | goal 'g1' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if_issue_113.sh g2 +$ ./$MAKESURE -f tests/6_reached_if_issue_113.sh g2 | goal 'g2' ... | must show -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if_issue_142.sh g +$ ./$MAKESURE -f tests/6_reached_if_issue_142.sh g | a b | goal 'g' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if_issue_142.sh g1 +$ ./$MAKESURE -f tests/6_reached_if_issue_142.sh g1 | a b | goal 'g1' [already satisfied]. -$ cd "$MYDIR"; ./$MAKESURE -f tests/6_reached_if_issue_142.sh g2 +$ ./$MAKESURE -f tests/6_reached_if_issue_142.sh g2 | a b | goal 'g2' [already satisfied]. diff --git a/tests/7_options.tush b/tests/7_options.tush index 3457180..59838b5 100644 --- a/tests/7_options.tush +++ b/tests/7_options.tush @@ -1,20 +1,20 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_silent.sh +$ ./$MAKESURE -f tests/7_options_silent.sh | ccc | bbb | aaa -$ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_invalid.sh +$ ./$MAKESURE -f tests/7_options_invalid.sh @ Option 'invalid' is not supported: @ tests/7_options_invalid.sh:2: @options invalid ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_in_goal.sh +$ ./$MAKESURE -f tests/7_options_in_goal.sh @ Only use @options in prelude: @ tests/7_options_in_goal.sh:3: @options tracing ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/7_options_tracing.sh 2>&1 | awk -f tests/unify_tracing_output.awk +$ ./$MAKESURE -f tests/7_options_tracing.sh 2>&1 | awk -f tests/unify_tracing_output.awk | goal 'default' ... | test @ + : default diff --git a/tests/8_timing.tush b/tests/8_timing.tush index fe8df64..09550de 100644 --- a/tests/8_timing.tush +++ b/tests/8_timing.tush @@ -1,11 +1,11 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/8_options_timing.sh | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' +$ ./$MAKESURE -f tests/8_options_timing.sh | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' | goal 'default' ... | test | goal 'default' took X | total time X -$ cd "$MYDIR"; ./$MAKESURE -f tests/8_options_timing.sh empty_goal | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' +$ ./$MAKESURE -f tests/8_options_timing.sh empty_goal | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' | goal 'reached_goal' [already satisfied]. | goal 'not_reached_goal_1' ... | should show 1 @@ -16,14 +16,14 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/8_options_timing.sh empty_goal | sed 's#took | goal 'empty_goal' [empty]. | total time X -$ cd "$MYDIR"; ./$MAKESURE -f tests/8_options_timing_silent.sh +$ ./$MAKESURE -f tests/8_options_timing_silent.sh | test -$ cd "$MYDIR"; ./$MAKESURE -t -f tests/8_timing.sh | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' +$ ./$MAKESURE -t -f tests/8_timing.sh | sed 's#took .*$#took X#g ; s#total time .*$#total time X#g' | goal 'default' ... | test | goal 'default' took X | total time X -$ cd "$MYDIR"; ./$MAKESURE -t -s -f tests/8_timing.sh +$ ./$MAKESURE -t -s -f tests/8_timing.sh | test diff --git a/tests/9_prelude.tush b/tests/9_prelude.tush index fc43e4c..e59660b 100644 --- a/tests/9_prelude.tush +++ b/tests/9_prelude.tush @@ -1,5 +1,5 @@ -$ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude.sh a +$ ./$MAKESURE -f tests/9_prelude.sh a | goal 'c' [already satisfied]. | goal 'd' ... | d @@ -8,17 +8,17 @@ $ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude.sh a | goal 'a' ... | a -$ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude_doc.sh +$ ./$MAKESURE -f tests/9_prelude_doc.sh @ Only use @doc in @goal: @ tests/9_prelude_doc.sh:2: @doc Doc in prelude ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude_depends_on.sh +$ ./$MAKESURE -f tests/9_prelude_depends_on.sh @ Only use @depends_on in @goal: @ tests/9_prelude_depends_on.sh:2: @depends_on g1 ? 1 -$ cd "$MYDIR"; ./$MAKESURE -f tests/9_prelude_reached_if.sh +$ ./$MAKESURE -f tests/9_prelude_reached_if.sh @ Only use @reached_if in @goal: @ tests/9_prelude_reached_if.sh:2: @reached_if aaa ? 1