File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 66# Giving better names to the CLI arguments
77source_file=" $1 "
88url=" $2 "
9- cut_dirs=$(( $3 + 1 ))
9+ cut_dirs=" $3 "
1010
1111# Getting the test cases
1212wget -q -r --no-parent --reject " index.html*" -nH --cut-dirs=${cut_dirs} ${url}
@@ -17,20 +17,21 @@ cpp_file=$(basename "${source_file}")
1717g++ ${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/
2223for input in * .in; do
23- ../a.out < ${input} > ../my_outputs/${input% .in} .out
24+ ../../ a.out < ${input} > ../my_outputs/${input% .in} .out
2425done
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
2829count=0
2930for 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
3536done
3637
You can’t perform that action at this time.
0 commit comments