From f72856c5198166a0788760cee97d1e63c37861c0 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Sun, 21 Jan 2024 09:45:34 -0800 Subject: [PATCH] Improve scripts for 2005/giljade Prompt to run test suite after the main feature is done and improve the prompting. The test suite script gives a warning that it may take a bit of time to run. --- 2005/giljade/test.sh | 3 +++ 2005/giljade/try.sh | 26 ++++++++++++++++---------- thanks-for-help.md | 6 +++--- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/2005/giljade/test.sh b/2005/giljade/test.sh index 8c3c636e3..419dcc3a3 100755 --- a/2005/giljade/test.sh +++ b/2005/giljade/test.sh @@ -24,6 +24,9 @@ EXIT_CODE=0 # delete temporary files first to make sure that they're clean rm -f out out.count +echo "This may take a while: please be patient." 1>&2 +echo 1>&2 + # redirect stdout to 'out' so that we can run the test suite of giljade ./"$GILJADE" > out # here we want to show only the lines matching the regexp '^Line' but write diff --git a/2005/giljade/try.sh b/2005/giljade/try.sh index 866edb149..449747284 100755 --- a/2005/giljade/try.sh +++ b/2005/giljade/try.sh @@ -15,21 +15,27 @@ make CC="$CC" all >/dev/null || exit 1 # clear screen after compilation so that only the entry is shown clear -read -r -p "Do you wish to run the test suite (y/n) ? " -if [[ "$REPLY" == "y" ]]; then - echo "$ make test" 1>&2 - make test -fi - +# We don't use tee(1) here so as to show better what we're doing and to prompt +# them to view the file with less(1) rather than dump it on them all at once. +echo 1>&2 +read -r -n 1 -p "Press any key to run: ./giljade > out: " echo 1>&2 -echo "$ ./giljade > out" 1>&2 ./giljade > out +echo 1>&2 echo "For this next step, make sure to keep pressing space (or hold it down) (q = quit)." 1>&2 -echo "$ less -X out" 1>&2 -read -r -n 1 -p "Press any key to continue: " -less -X out +read -r -n 1 -p "Press any key to run: less -rEXF out: " +less -rEXF out echo 1>&2 echo "We've left the file 'out' for you in case you wish to open it in vi(m). If" 1>&2 echo "you do we recommend you try holding ctrl-f down in a similar way to how you held" 1>&2 echo "down space above. Of course you can open it in another editor if you wish." 1>&2 +echo 1>&2 + +read -r -p "Do you wish to run the test suite (y/n) ? " +if [[ "$REPLY" == "y" || "$REPLY" = "Y" ]]; then + echo "$ make test" 1>&2 + make test +fi + + diff --git a/thanks-for-help.md b/thanks-for-help.md index 1a3a499f3..d3d5580a6 100644 --- a/thanks-for-help.md +++ b/thanks-for-help.md @@ -3201,9 +3201,9 @@ Cody also added the [try.sh](/2005/boutines/try.sh) script. ## [2005/giljade](/2005/giljade/giljade.c) ([README.md](/2005/giljade/README.md])) -After Landon fixed the entry to compile with clang Cody noticed this does not -work at all in modern systems (see below). He fixed this to work and then he -later fixed the self-test feature. +After Landon fixed the entry to compile with clang [Cody](#cody) noticed this +does not work at all in modern systems (see below). He fixed this to work and +then he later fixed the self-test feature. The problem that was showing up is that with either optimising or if anything but 32-bit (as in `-m32`) was used it would not work (at least in 64-bit