add: assigment 2

This commit is contained in:
Kiana Sheibani 2025-10-06 23:27:46 -04:00
parent 3a0b8a5c3f
commit 32a6e07e56
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
11 changed files with 437 additions and 0 deletions

20
assignment2/part2/test Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
echo "Building executable..."
cd "${FLAKE:-$(dirname $0)}"
if command -v nix; then
bidirectional="$(nix build --no-link --print-out-paths .#a2-p2-bidirectional)/bin/bidirectional"
else
gcc bidirectional.c -o bidirectional
bidirectional="./bidirectional"
fi
out="$("$bidirectional")"
read -r -d '' expected <<EOF
Sending message from parent to child
Response from child to parent
EOF
if test "$out" = "$expected"; then
echo "SUCCESS"
fi