Skip to content

Commit cf916ce

Browse files
author
Your Name
committed
lab6_clean
1 parent 18b544b commit cf916ce

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

lab6/llvm-pass.so

-215 KB
Binary file not shown.

lab6/target

-15.7 KB
Binary file not shown.

lab6/validate.sh

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
#!/bin/bash
2-
3-
# Check for unwanted files
4-
for file in *; do
5-
if [[ $file != "llvm-pass.so.cc" && $file != "target.c" && $file != "Makefile" && $file != "README.md" && $file != "validate.sh" && $file != "ans" ]]; then
6-
echo "[!] Unwanted file detected: $file."
7-
exit 1
8-
fi
9-
done
10-
11-
test_path="${BASH_SOURCE[0]}"
12-
solution_path="$(realpath .)"
13-
tmp_dir=$(mktemp -d -t lab5-XXXXXXXXXX)
14-
answer=""
15-
16-
cd $tmp_dir
17-
18-
rm -rf *
19-
cp $solution_path/Makefile .
20-
cp $solution_path/*.c .
21-
cp $solution_path/*.cc .
22-
cp $solution_path/ans .
23-
24-
make
25-
make run > out 2>&1
26-
result=$(diff --strip-trailing-cr ans out)
27-
if [[ -n $result ]]; then
28-
echo "[!] Expected: "
29-
cat ans
30-
echo ""
31-
echo "[!] Actual: "
32-
cat out
33-
echo ""
34-
exit 1
35-
else
36-
echo "[V] Pass"
37-
fi
38-
39-
rm -rf $tmp_dir
40-
41-
exit 0
42-
43-
# vim: set fenc=utf8 ff=unix et sw=2 ts=2 sts=2:
1+
#!/bin/bash
2+
3+
# Check for unwanted files
4+
for file in *; do
5+
if [[ $file != "llvm-pass.so.cc" && $file != "target.c" && $file != "Makefile" && $file != "README.md" && $file != "validate.sh" && $file != "ans" ]]; then
6+
echo "[!] Unwanted file detected: $file."
7+
exit 1
8+
fi
9+
done
10+
11+
test_path="${BASH_SOURCE[0]}"
12+
solution_path="$(realpath .)"
13+
tmp_dir=$(mktemp -d -t lab5-XXXXXXXXXX)
14+
answer=""
15+
16+
cd $tmp_dir
17+
18+
rm -rf *
19+
cp $solution_path/Makefile .
20+
cp $solution_path/*.c .
21+
cp $solution_path/*.cc .
22+
cp $solution_path/ans .
23+
24+
make
25+
make run > out 2>&1
26+
result=$(diff --strip-trailing-cr ans out)
27+
if [[ -n $result ]]; then
28+
echo "[!] Expected: "
29+
cat ans
30+
echo ""
31+
echo "[!] Actual: "
32+
cat out
33+
echo ""
34+
exit 1
35+
else
36+
echo "[V] Pass"
37+
fi
38+
39+
rm -rf $tmp_dir
40+
41+
exit 0
42+
43+
# vim: set fenc=utf8 ff=unix et sw=2 ts=2 sts=2:

0 commit comments

Comments
 (0)