summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Abukalam <dannyabukalam@codethink.co.uk>2012-01-27 15:40:04 +0000
committerDanny Abukalam <dannyabukalam@codethink.co.uk>2012-01-27 15:40:04 +0000
commitad74a519d62d85f14da8497f8da3b3a32f834ebb (patch)
treebe930cf671327f7297c5cc52d6ce643c48a89443
parentfc62c87a2ccf0fdaee705350b26650b4370b95a9 (diff)
downloadtbdiff-ad74a519d62d85f14da8497f8da3b3a32f834ebb.tar.gz
Patch problem fixed! Still a problem with patch 7.
-rw-r--r--Makefile4
-rw-r--r--README.testing15
-rw-r--r--tests/PATCHES/patchfive.tbdbin77 -> 77 bytes
-rw-r--r--tests/PATCHES/patchfour.tbdbin71 -> 71 bytes
-rw-r--r--tests/PATCHES/patchone.tbdbin56 -> 4409 bytes
-rw-r--r--tests/PATCHES/patchseven.tbdbin75 -> 75 bytes
-rw-r--r--tests/PATCHES/patchsix.tbdbin74 -> 74 bytes
-rw-r--r--tests/PATCHES/patchthree.tbdbin69 -> 69 bytes
-rw-r--r--tests/PATCHES/patchtwo.tbdbin575 -> 581 bytes
-rwxr-xr-xtests/cross_plat.sh25
-rwxr-xr-xtests/gen.sh2
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
--- a/tests/PATCHES/patchfive.tbd
+++ b/tests/PATCHES/patchfive.tbd
Binary files differ
diff --git a/tests/PATCHES/patchfour.tbd b/tests/PATCHES/patchfour.tbd
index 95bc2a3..e22eeb9 100644
--- a/tests/PATCHES/patchfour.tbd
+++ b/tests/PATCHES/patchfour.tbd
Binary files differ
diff --git a/tests/PATCHES/patchone.tbd b/tests/PATCHES/patchone.tbd
index 45de964..ef83ac8 100644
--- a/tests/PATCHES/patchone.tbd
+++ b/tests/PATCHES/patchone.tbd
Binary files differ
diff --git a/tests/PATCHES/patchseven.tbd b/tests/PATCHES/patchseven.tbd
index cb0733e..afe674e 100644
--- a/tests/PATCHES/patchseven.tbd
+++ b/tests/PATCHES/patchseven.tbd
Binary files differ
diff --git a/tests/PATCHES/patchsix.tbd b/tests/PATCHES/patchsix.tbd
index e957a97..a5f0a75 100644
--- a/tests/PATCHES/patchsix.tbd
+++ b/tests/PATCHES/patchsix.tbd
Binary files differ
diff --git a/tests/PATCHES/patchthree.tbd b/tests/PATCHES/patchthree.tbd
index 9b80a66..3c326ab 100644
--- a/tests/PATCHES/patchthree.tbd
+++ b/tests/PATCHES/patchthree.tbd
Binary files differ
diff --git a/tests/PATCHES/patchtwo.tbd b/tests/PATCHES/patchtwo.tbd
index 3e2b5e6..49319d2 100644
--- a/tests/PATCHES/patchtwo.tbd
+++ b/tests/PATCHES/patchtwo.tbd
Binary files 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