From ad74a519d62d85f14da8497f8da3b3a32f834ebb Mon Sep 17 00:00:00 2001 From: Danny Abukalam Date: Fri, 27 Jan 2012 15:40:04 +0000 Subject: Patch problem fixed! Still a problem with patch 7. --- Makefile | 4 +--- README.testing | 15 +++++++++++++++ tests/PATCHES/patchfive.tbd | Bin 77 -> 77 bytes tests/PATCHES/patchfour.tbd | Bin 71 -> 71 bytes tests/PATCHES/patchone.tbd | Bin 56 -> 4409 bytes tests/PATCHES/patchseven.tbd | Bin 75 -> 75 bytes tests/PATCHES/patchsix.tbd | Bin 74 -> 74 bytes tests/PATCHES/patchthree.tbd | Bin 69 -> 69 bytes tests/PATCHES/patchtwo.tbd | Bin 575 -> 581 bytes tests/cross_plat.sh | 25 ++++--------------------- tests/gen.sh | 2 +- 11 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index 98cc33f..3c83800 100644 --- a/Makefile +++ b/Makefile @@ -42,9 +42,7 @@ uninstall: rm -rf /usr/local/bin/$(CREATE) test: - cd tests && ./run_tests.sh && cd .. -# cross platform test needs fixing -# cd tests && ./run_tests.sh && fakeroot -- ./cross_plat.sh && cd .. + cd tests && ./run_tests.sh && fakeroot -- ./cross_plat.sh && cd .. .PHONY: clean diff --git a/README.testing b/README.testing index f7c39a4..238e01f 100644 --- a/README.testing +++ b/README.testing @@ -17,6 +17,10 @@ To run each test individually: $ ./00_my_individual_test.sh ../path/to/test-create ../path/to/test-deploy +To run the cross platform test: + +$ fakeroot -- ./cross_plat.sh + Anatomy of a unit test ---------------------- @@ -77,3 +81,14 @@ then check that it is non-zero create_test_return () { test $1 != 0; } # create must fail with error code 1 create_test_return () { test $1 = 1; } + + +Cross Platform Test +------------------- + +The cross-platform test is designed to make sure that patches are endian and +architecture independent. This is done with PATCHES generated and commited to +begin with, and then deployed and re-created and compared to check that the +patches are identical. This test should be run after every modification to +ensure that tbdiff remains endian and architecture independant after any +modifications are made. diff --git a/tests/PATCHES/patchfive.tbd b/tests/PATCHES/patchfive.tbd index e1fea2f..6bed2fe 100644 Binary files a/tests/PATCHES/patchfive.tbd and b/tests/PATCHES/patchfive.tbd differ diff --git a/tests/PATCHES/patchfour.tbd b/tests/PATCHES/patchfour.tbd index 95bc2a3..e22eeb9 100644 Binary files a/tests/PATCHES/patchfour.tbd and b/tests/PATCHES/patchfour.tbd differ diff --git a/tests/PATCHES/patchone.tbd b/tests/PATCHES/patchone.tbd index 45de964..ef83ac8 100644 Binary files a/tests/PATCHES/patchone.tbd and b/tests/PATCHES/patchone.tbd differ diff --git a/tests/PATCHES/patchseven.tbd b/tests/PATCHES/patchseven.tbd index cb0733e..afe674e 100644 Binary files a/tests/PATCHES/patchseven.tbd and b/tests/PATCHES/patchseven.tbd differ diff --git a/tests/PATCHES/patchsix.tbd b/tests/PATCHES/patchsix.tbd index e957a97..a5f0a75 100644 Binary files a/tests/PATCHES/patchsix.tbd and b/tests/PATCHES/patchsix.tbd differ diff --git a/tests/PATCHES/patchthree.tbd b/tests/PATCHES/patchthree.tbd index 9b80a66..3c326ab 100644 Binary files a/tests/PATCHES/patchthree.tbd and b/tests/PATCHES/patchthree.tbd differ diff --git a/tests/PATCHES/patchtwo.tbd b/tests/PATCHES/patchtwo.tbd index 3e2b5e6..49319d2 100644 Binary files a/tests/PATCHES/patchtwo.tbd and b/tests/PATCHES/patchtwo.tbd differ diff --git a/tests/cross_plat.sh b/tests/cross_plat.sh index 82937de..34aa789 100755 --- a/tests/cross_plat.sh +++ b/tests/cross_plat.sh @@ -10,26 +10,9 @@ # making the patch files different even though they're the same. By limiting # each patch to only one change, the patches will be identical. -# CURRENTLY BROKEN!! PATCHES ARE DIFFERENT DUE TO WHAT I SUSPECT IS A DIFF -# IN THE MTIME OF THE ORIGINAL PATCHES AND THE CREATED ONES. +# CURRENTLY BROKEN!! +# Patch seven seems to be failing the diff check for some reason. -# To clarify, these are two hexdumps of patch 1, which simply echos 1 into -# a file called a.txt. The first is the committed patch generated by gen.sh, -# and the second is a patch generated by cross_plat.sh. Hint: 4a!! -# -# 0000000 \0 022 \0 C o d e t h i n k : T B D -# 0000020 I F F v 0 005 \0 a . t x t * \0 \0 -# 0000040 \0 \0 \0 \0 \0 207 201 \0 \0 \0 \0 \0 \0 \0 \0 \0 -# 0000060 \0 002 \0 \0 \0 1 \n 001 -# 0000070 -# -# 0000000 \0 022 \0 C o d e t h i n k : T B D -# 0000020 I F F v 0 005 \0 a . t x t * \0 \0 -# 0000040 \0 \0 \0 \0 \0 207 201 \0 \0 350 003 \0 \0 350 003 \0 -# 0000060 \0 002 \0 \0 \0 1 \n 001 -# 0000070 -# -# if [ ! -f run_tests.sh ] then @@ -66,7 +49,7 @@ _TESTFOLDER=`pwd` #trap error ERR -echo -e "\n#### Running Cross-platform Test" +echo -e "#### Running Cross-platform Test" echo -e "\nPreparing Test Environment... " #mkdir foo @@ -97,7 +80,7 @@ done # Diff patches. Should be identical for ((i=1; i<8; i++)); do echo -en "Checking patch ${nums[$i]}... " - diff TESTPATCHES/primepatch${nums[$i]}.tbd $_TESTFOLDER/PATCHES/patch${nums[$i]}.tbd 2>/dev/null 1>&2 + diff TESTPATCHES/primepatch${nums[$i]}.tbd $_TESTFOLDER/PATCHES/patch${nums[$i]}.tbd 2>/dev/null #1>&2 if [ $? -eq 0 ]; then echo OK else diff --git a/tests/gen.sh b/tests/gen.sh index 652728f..4381384 100755 --- a/tests/gen.sh +++ b/tests/gen.sh @@ -53,7 +53,7 @@ for ((i=1; i<8; i++)); do insertfiles $i # for ((j=1; j<=$i; j++)); do # labelmeta ${files[$j]} - done +# done cd .. tbdiff-create PATCHES/patch${nums[$i]}.tbd ${nums[$(($i - 1))]} ${nums[$i]} done -- cgit v1.2.1