From 75fb8ed039b078e9df96fcb9f9786b1984d328a6 Mon Sep 17 00:00:00 2001 From: lmaosoggypancakes Date: Sun, 20 Apr 2025 12:56:08 -0400 Subject: [PATCH] bash autograder --- Bash-arith/README.md | 23 +++++++++++++++++++++++ Bash-arith/autograde-Makefile | 9 +++++++++ Bash-arith/autograde.tar | Bin 0 -> 20480 bytes Bash-arith/math.sh | 12 ++++++++++++ Bash-arith/refsol.tar | Bin 0 -> 10240 bytes Bash-arith/refsol/math.sh | 12 ++++++++++++ Bash-arith/test_autograder/driver.py | Bin 0 -> 10240 bytes Bash-arith/test_autograder/tests.py | 6 ++++++ 8 files changed, 62 insertions(+) create mode 100644 Bash-arith/README.md create mode 100644 Bash-arith/autograde-Makefile create mode 100644 Bash-arith/autograde.tar create mode 100755 Bash-arith/math.sh create mode 100644 Bash-arith/refsol.tar create mode 100755 Bash-arith/refsol/math.sh create mode 100644 Bash-arith/test_autograder/driver.py create mode 100644 Bash-arith/test_autograder/tests.py diff --git a/Bash-arith/README.md b/Bash-arith/README.md new file mode 100644 index 0000000..0072e77 --- /dev/null +++ b/Bash-arith/README.md @@ -0,0 +1,23 @@ +# Bash Arithmetic Lab +Make a shell script that performs * operations with the flags -a -b, +i.e. +``` +./math -a 1 -b 2 +>>> 2 +./math -a 4 -b 8 +>>> 32 +``` + +## Assesment Language +Bash + +## Autograder Language +Python + +## Autograding Environment Packages +Python3 + +## Hand-in Format +`math.sh` + + diff --git a/Bash-arith/autograde-Makefile b/Bash-arith/autograde-Makefile new file mode 100644 index 0000000..f004e5a --- /dev/null +++ b/Bash-arith/autograde-Makefile @@ -0,0 +1,9 @@ +all: + tar xvf autograde.tar + tar xvf handin.tar + cp math.sh test_autograder + + (cd test_autograder; python3 driver.py) + +clean: + rm -rf *~ test_autograder diff --git a/Bash-arith/autograde.tar b/Bash-arith/autograde.tar new file mode 100644 index 0000000000000000000000000000000000000000..6def71bddb246a860a9a51e3746890f20d67805b GIT binary patch literal 20480 zcmeI&O;5rw0LJm1`4kQ3Mcb}j;o!xaiJw41%p#TGK}=Un`1ZDl8A7I)k@)g&NJjRI zX8S!Ir$*n#`(_i@%g`)*xGc^vWE#%eA{~^o^6;3WJPKu8UDZa*$`w*ox;BNdXSkP> zDK~9wf)K^iy7iAIX?Nngyu0#OeTzr^FT(28hl`i(fKQPNu8leD{bL=ZM4Q9@mCF5F zrBnZMzQIgq6=rI1~4v+&Px6}S6eO-eE8!rLY+{Vvg!v9+5_ z-{&>;R8`icD@XIufX~BJ2q1s}0tg_000IagfB*srAb7~0VZP8}3t6sKaS`tBs4A_@hj42b`h zQ|=V&^!=?Vy{jWOX2pGFQnJ1!nT$X7VKo#>(oD@%DwI$xPLi2YjO3U{?cd(`PPatt z!Ff~ehe!Hv`y;>ng;D#K|D*2gxwqq7JOunx{z9am@)t^`jN)<5Iehh>=YM(^Up{jYE4jUcP@*>z?-`ri^ zUhNi(_eCDk>dV4-UG#4@hI3O`N5OQuq%&HDA?Jqy;R^x~fB*y_009U<00Izz00bZa j0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|_)g#j(s)p? literal 0 HcmV?d00001 diff --git a/Bash-arith/refsol/math.sh b/Bash-arith/refsol/math.sh new file mode 100755 index 0000000..80d1573 --- /dev/null +++ b/Bash-arith/refsol/math.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +while getopts a:b: flag +do + case "${flag}" in + a) X=${OPTARG};; + b) Y=${OPTARG};; + esac +done + +echo $((X * Y)) + diff --git a/Bash-arith/test_autograder/driver.py b/Bash-arith/test_autograder/driver.py new file mode 100644 index 0000000000000000000000000000000000000000..a84566b5bd4a60a7c9df2b130d3e31daf9b56b88 GIT binary patch literal 10240 zcmeIvv1-FG5XN!Meu^WrXeC>=oS{p%LZ6_<6w#<59qM8!L*Bkh8c3J4O9l`BLmb*oru-WAdD_ll6X*L}>&!pl(>EROg&3oAs^vy&oe}n^sxpyQZsc=}@K|yisCq z_=c;a_9=&1M14#tzF+N9|K@*OU2=5#Z+VcRl2XI!F{ItwO3Pri)MbsMJ|{16o{oXh z;8!?T$w0gf0R#|0009IL qKmY**5I_I{1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|OsK7UoxH&-p literal 0 HcmV?d00001 diff --git a/Bash-arith/test_autograder/tests.py b/Bash-arith/test_autograder/tests.py new file mode 100644 index 0000000..e529f3f --- /dev/null +++ b/Bash-arith/test_autograder/tests.py @@ -0,0 +1,6 @@ +tests = [ + ["Basic", [1, 2, 2]], + ["Zero", [0, 4, 0]], + ["Identity", [1, 8, 8]], + ["Large", [123456789, 2, 246913578]] +]