From cfca178b140acb6234c06d943a344543d17abaef Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Wed, 25 Oct 2023 05:33:37 -0700 Subject: [PATCH] Improve test script (now scripts) for 1995/garry Added alt test script to use alt code (though in this case it has no real use other than to be complete). It makes sure to compile the alt code before trying to use it, exiting if it fails. The original test script now also makes sure to compile the program before use, exiting if it fails. I also fixed the thanks file with this: I didn't fix the main entry; that already compiled. I had fixed the alt code which did not compile (partly because I agreed with the judges that it looked like a rat dumping core). Why an alt test script instead of just adding an environmental variable like I did with others? Because it felt like it'd be easier to type. It might be that I end up doing this with the scripts I added a way to specify the program, when I come across it, if it seems worth it (which for some it might very well be worth it). --- 1995/garry/README.md | 19 +++++++++++++++++-- 1995/garry/garry.test.sh | 5 ++++- thanks-for-fixes.md | 19 +++++++++++++++---- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/1995/garry/README.md b/1995/garry/README.md index 7dc612526..fcb7aacde 100644 --- a/1995/garry/README.md +++ b/1995/garry/README.md @@ -35,13 +35,28 @@ judges noted that the C pre-processed version (with the `#include`s left intact) looked very much like a rat "dropping core". See [garry.alt.c](garry.alt.c) and judge for yourself! -To use try: +#### To build: + ```sh make alt ``` -Use `garry.alt` as you would `garry` above. +#### To use: + +```sh +./garry.alt output_file +``` + +#### Try: + +```sh + +GARRY=garry.alt ./garry.test.sh + +./garry.alt < README.md +``` + ## Judges' remarks: diff --git a/1995/garry/garry.test.sh b/1995/garry/garry.test.sh index a8b33e56d..50adf04aa 100755 --- a/1995/garry/garry.test.sh +++ b/1995/garry/garry.test.sh @@ -1,10 +1,13 @@ #!/usr/bin/env sh # -# garry.test - example of how to use garry +# garry.test.sh - example of how to use garry EXAMPLEON="\33\133\61\73\67\155" EXAMPLEOFF="\33\133\155" DOLLAR="$" export EXAMPLEON EXAMPLEOFF DOLLAR +# make sure code is built, first +make all || exit 1 + ./garry