Permalink
Browse files

batch.sh now deletes output files that match the expected output files

This is to save disk space when running many measurements in a row,
e.g. with run-all.sh
  • Loading branch information...
1 parent 05a3f15 commit ef8c8fbdabf21bdcb8d47536ce50ac277e01104a @jafingerhut committed Sep 26, 2011
View
@@ -94,6 +94,6 @@ do
( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -315,3 +315,15 @@ DIFF="diff -c"
# others produces \n only. Ignore trailing carriage returns on input.
CMP="diff --strip-trailing-cr --brief"
#CMP="cmp"
+
+cmp_and_rm_2nd_if_correct()
+{
+ local F1="$1"
+ local F2="$2"
+ ${CMP} "${F1}" "${F2}"
+ local cmp_exit_status=$?
+ if [ $cmp_exit_status == 0 ]
+ then
+ ${RM} "${F2}"
+ fi
+}
View
12 env.sh
@@ -315,3 +315,15 @@ DIFF="diff -c"
# others produces \n only. Ignore trailing carriage returns on input.
CMP="diff --strip-trailing-cr --brief"
#CMP="cmp"
+
+cmp_and_rm_2nd_if_correct()
+{
+ local F1="$1"
+ local F2="$2"
+ ${CMP} "${F1}" "${F2}"
+ local cmp_exit_status=$?
+ if [ $cmp_exit_status == 0 ]
+ then
+ ${RM} "${F2}"
+ fi
+}
View
@@ -98,6 +98,6 @@ do
( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -21,7 +21,7 @@ do
case $1 in
sbcl|perl|ghc|java|clj*) LANGUAGES="$LANGUAGES $1"
;;
- quick|medium|long) TESTS="$TESTS $1"
+ quick|medium*|long) TESTS="$TESTS $1"
;;
*)
1>&2 echo "Unrecognized command line parameter: $1"
@@ -54,6 +54,8 @@ do
;;
medium) N=10
;;
+ medium2) N=11
+ ;;
long) N=12
;;
esac
@@ -93,6 +95,6 @@ do
( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -94,6 +94,6 @@ do
( time ${CMD} ${N} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -69,7 +69,7 @@ do
# threads in parallel. With an empty string, the default
# is 2 more threads than the number of available
# processors.
- clj*) EXTRA_LANG_ARGS=""
+ clj*) EXTRA_LANG_ARGS="1"
;;
esac
@@ -88,6 +88,6 @@ do
( time ${CMD} ${EXTRA_LANG_ARGS} < ${IN} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -101,6 +101,6 @@ do
( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -92,6 +92,6 @@ do
( time ${CMD} ${N} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -97,6 +97,6 @@ do
( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -85,6 +85,6 @@ do
( time ${CMD} < ${IN} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -83,6 +83,6 @@ do
( time ${CMD} < ${IN} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -79,6 +79,6 @@ do
( time ${CMD} < ${IN} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
View
@@ -97,6 +97,6 @@ do
( time ${CMD} ${N} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
- $CMP ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
+ cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done

0 comments on commit ef8c8fb

Please sign in to comment.