add: assigment 2
This commit is contained in:
parent
3a0b8a5c3f
commit
32a6e07e56
11 changed files with 437 additions and 0 deletions
20
assignment2/part2/test
Executable file
20
assignment2/part2/test
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue