Skip to content

Commit

Permalink
Redesign @goal_glob #34
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Aug 23, 2021
1 parent 94e833a commit 34f106e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ function resolveGoalsToRun(result, i, goal_name, loop) {

function isPrelude() { return "prelude"==Mode }
function checkPreludeOnly() { if (!isPrelude()) addError("Only use " $1 " in prelude") }
function checkGoalOnly() { if ("goal" != Mode && "goal_glob" != Mode) addError("Only use " $1 " in @goal/@goal_glob") }
function checkGoalOnly() { if ("goal" != Mode && "goal_glob" != Mode) addError("Only use " $1 " in @goal") }
function currentGoalName() { return isPrelude() ? "" : arrLast(GoalNames) }

function realExit(code, i) {
Expand Down
4 changes: 2 additions & 2 deletions tests/13_errors.tush
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

$ cd "$MYDIR"; ./makesure -f tests/13_errors.sh
@ Only use @reached_if in @goal/@goal_glob:
@ Only use @reached_if in @goal:
@ tests/13_errors.sh:2: @reached_if true
@ Only use @doc in @goal/@goal_glob:
@ Only use @doc in @goal:
@ tests/13_errors.sh:4: @doc Doc in prelude
@ Option 'usupported' is not supported:
@ tests/13_errors.sh:5: @options usupported
Expand Down
6 changes: 3 additions & 3 deletions tests/9_prelude.tush
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ $ cd "$MYDIR"; ./makesure -f tests/9_prelude.sh a
| a

$ cd "$MYDIR"; ./makesure -f tests/9_prelude_doc.sh
@ Only use @doc in @goal/@goal_glob:
@ 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
@ Only use @depends_on in @goal/@goal_glob:
@ 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
@ Only use @reached_if in @goal/@goal_glob:
@ Only use @reached_if in @goal:
@ tests/9_prelude_reached_if.sh:2: @reached_if aaa
? 1

0 comments on commit 34f106e

Please sign in to comment.