Skip to content

Commit 6073db0

Browse files
committed
Task 3: Fixed a bug with cut-dirs argument
Followed by subsequent changes
1 parent 87c0812 commit 6073db0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Task_3/verifier.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fi
66
# Giving better names to the CLI arguments
77
source_file="$1"
88
url="$2"
9-
cut_dirs=$(($3 + 1))
9+
cut_dirs="$3"
1010

1111
# Getting the test cases
1212
wget -q -r --no-parent --reject "index.html*" -nH --cut-dirs=${cut_dirs} ${url}
@@ -17,20 +17,21 @@ cpp_file=$(basename "${source_file}")
1717
g++ ${cpp_file}
1818

1919
# Compute the output of the code for each input file
20-
mkdir my_outputs
21-
cd inputs
20+
cd $(basename ${url})
21+
mkdir -p my_outputs/
22+
cd inputs/
2223
for input in *.in; do
23-
../a.out <${input} >../my_outputs/${input%.in}.out
24+
../../a.out <${input} >../my_outputs/${input%.in}.out
2425
done
2526

2627
# Now, comparing with the true output and saving the feedback
27-
echo "Failed testcases are:" >../feedback.txt
28+
echo "Failed testcases are:" >../../feedback.txt
2829
count=0
2930
for input in *.in; do
3031
difference=$(diff ../outputs/${input%.in}.out ../my_outputs/${input%.in}.out | wc -m)
3132
if [ ${difference} -ne 0 ]; then
3233
count=$((${count} + 1))
33-
echo "${input%.in}" >>../feedback.txt
34+
echo "${input%.in}" >>../../feedback.txt
3435
fi
3536
done
3637

0 commit comments

Comments
 (0)