From b0b9a0e00e41238ff5beca5549473e7438e921e8 Mon Sep 17 00:00:00 2001 From: xonix Date: Sat, 6 Jan 2024 22:51:14 +0200 Subject: [PATCH] Should use parameterized goals instead of calling `./makesure` #151 --- Makesurefile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Makesurefile b/Makesurefile index 3488445..837eba7 100644 --- a/Makesurefile +++ b/Makesurefile @@ -64,6 +64,13 @@ awk_ver 'MAKESURE_AWK' "$MAKESURE_AWK" bash --version| head -n 1 +@goal debug_pg @params AWK MAKESURE_AWK @private +@doc 'shows software versions' +@use_lib awk_ver + awk_ver 'AWK' "$AWK" + awk_ver 'MAKESURE_AWK' "$MAKESURE_AWK" + bash --version| head -n 1 + @goal prepared4tests @private @depends_on fhtagn_installed debug @@ -99,11 +106,15 @@ # to run `./makesure tests/test.tush` instead of `./makesure tested@tests/test.tush` @goal tested @doc 'runs all *.tush tests (stop at 1st error)' -@depends_on 'tests/*.tush' +@depends_on 'tests/*.tush' @args '' '' -@goal @glob 'tests/*.tush' @private -@depends_on prepared4tests +@goal @glob 'tests/*.tush' @params MAKESURE_AWK MAKESURE_AWK_OPTS @private +@depends_on fhtagn_installed +@depends_on debug_pg @args "$AWK" MAKESURE_AWK @use_lib testing + [[ -n $MAKESURE_AWK ]] && MAKESURE_AWK="$(realpath $MAKESURE_AWK)" + export MAKESURE_AWK + export MAKESURE_AWK_OPTS MAKESURE=makesure_dev \ run_tush_file "$ITEM" @@ -114,14 +125,14 @@ MAKESURE=makesure_candidate \ run_tush_file "$ITEM" -@define COVERPROFILE "/tmp/cov.txt" +@define COVERPROFILE '/tmp/cov.txt' -@goal _cover_profile_prepared @private - rm -f "$COVERPROFILE" +@goal file_removed @params F + rm -f "$F" - MAKESURE_AWK="$(pwd)/soft/$GOAWK" \ - MAKESURE_AWK_OPTS="-covermode=set -coverprofile=$COVERPROFILE -coverappend" \ - ./makesure tested +@goal _cover_profile_prepared @private +@depends_on file_removed @args COVERPROFILE +@depends_on 'tests/*.tush' @args "./soft/$GOAWK" "-covermode=set -coverprofile=$COVERPROFILE -coverappend" @goal coverage @doc 'prepares code coverage report'