summaryrefslogtreecommitdiffstats
path: root/courgette
diff options
context:
space:
mode:
authorpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 21:26:24 +0000
committerpaulgazz@chromium.org <paulgazz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-18 21:26:24 +0000
commit5533fadecafc42e768da88e6c22cb0115049353e (patch)
treeb9d8a72d4a716b2ae1e844ca2cef42e7ebc01ee1 /courgette
parent7eb79872c9573c6e3fb132df1fa1267f3851e72e (diff)
downloadchromium_src-5533fadecafc42e768da88e6c22cb0115049353e.zip
chromium_src-5533fadecafc42e768da88e6c22cb0115049353e.tar.gz
chromium_src-5533fadecafc42e768da88e6c22cb0115049353e.tar.bz2
Add testing of disassembly and assembly to the stress tester
BUG=259153 TEST=run_stress_test data/x86-mario_3701.98.0/bin/ data/x86-mario_4206.0.0/bin/ st_bin_x86_test; analyze_stress_test st_bin_x86_test/log; Review URL: https://chromiumcodereview.appspot.com/19278002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'courgette')
-rwxr-xr-xcourgette/analyze_stress_test1
-rwxr-xr-xcourgette/run_stress_test34
2 files changed, 34 insertions, 1 deletions
diff --git a/courgette/analyze_stress_test b/courgette/analyze_stress_test
index f6d0e80..6aff656 100755
--- a/courgette/analyze_stress_test
+++ b/courgette/analyze_stress_test
@@ -43,6 +43,7 @@ EOF
cat <<EOF
$(count_result "PASS_COURGETTE") successful courgette patches
$(count_result "FAIL_COURGETTE") failed courgette patches
+$(count_result "FAIL_DISASSEMBLE") failed to disassemble/assemble
$(count_result "PASS_BSDIFF") succesful bsdiff patches
$(count_result "FAIL_BSDIFF") failed bsdiff patches
$(count_result "BEST_COURGETTE") patch(es) where courgette is smaller
diff --git a/courgette/run_stress_test b/courgette/run_stress_test
index cb0687d..1110e59 100755
--- a/courgette/run_stress_test
+++ b/courgette/run_stress_test
@@ -15,7 +15,9 @@ outdir_prefix="stress_test_"
if [ $# -lt 2 ]; then
cat <<EOF
-USAGE: $(basename ${0}) dir1 dir2 [outdir]
+USAGE: $(basename ${0}) [-s] dir1 dir2 [outdir]
+
+ -s only test files supported by courgette
Stress test courgette by generating and applying patches for two given
directories, dir1 and dir2. The test will use files with the same
@@ -29,6 +31,13 @@ EOF
exit 1
fi
+if [ "${1}" == "-s" ]; then
+ test_supported_only=true
+ shift
+else
+ test_supported_only=
+fi
+
dir1="${1}"
if [ ! -e "${dir1}" ]; then
error "\"${dir1}\" not found"
@@ -51,6 +60,7 @@ mkdir -p "${out_dir}" || exit 1
patches_dir="${out_dir}/patches"
applied_dir="${out_dir}/applied"
+dis_dir="${out_dir}/dis"
bsdiff="${out_dir}/bsdiff"
log="${out_dir}/log"
results="${out_dir}/results"
@@ -64,6 +74,20 @@ run_test() {
local file2="${2}"
local patch="${patches_dir}/${file1}.patch"
local apply="${applied_dir}/${file2}.applied"
+ local dis="${dis_dir}/${file1}.dis"
+ local asm="${dis_dir}/${file1}.asm"
+ mkdir -p "$(dirname "${dis}")"
+ if [ ! $test_supported_only ]; then
+ courgette -supported "${file1}" >/dev/null
+ if [ "${?}" -eq 0 ]; then
+ courgette -dis "${file1}" "${dis}"
+ courgette -asm "${dis}" "${asm}"
+ cmp -s "${file1}" "${asm}"
+ if [ "${?}" -ne 0 ]; then
+ echo "FAIL_DISASSEMBLE ${file1}"
+ fi
+ fi
+ fi
mkdir -p "$(dirname "${patch}")"
mkdir -p "$(dirname "${apply}")"
courgette -gen "${file1}" "${file2}" "${patch}"
@@ -107,6 +131,12 @@ time diff -qr "${dir1}" "${dir2}" 2>/dev/null \
# contain spaces.
file1="$(echo "${file}" | awk '{print $1}')"
file2="$(echo "${file}" | awk '{print $2}')"
+ if [ $test_supported_only ]; then
+ courgette -supported "${file1}" >/dev/null
+ if [ "${?}" -ne 0 ]; then
+ continue;
+ fi
+ fi
run_test "${file1}" "${file2}"
done 2>&1 | tee -a "${log}"
@@ -124,6 +154,8 @@ cat <<EOF | tee -a "${log}"
$(count_result "PASS_COURGETTE") successful courgette patches
$(count_result "FAIL_COURGETTE") failed courgette patches (search log for \
"^FAIL_COURGETTE")
+$(count_result "FAIL_DISASSEMBLE") failed to disassemble/assemble (search log \
+for "^FAIL_DISASSEMBLE")
$(count_result "PASS_BSDIFF") succesful bsdiff patches
$(count_result "FAIL_BSDIFF") failed bsdiff patches
$(count_result "BEST_COURGETTE") patch(es) where courgette is smaller