diff options
author | Danny Abukalam <dannyabukalam@codethink.co.uk> | 2012-01-27 15:40:04 +0000 |
---|---|---|
committer | Danny Abukalam <dannyabukalam@codethink.co.uk> | 2012-01-27 15:40:04 +0000 |
commit | ad74a519d62d85f14da8497f8da3b3a32f834ebb (patch) | |
tree | be930cf671327f7297c5cc52d6ce643c48a89443 | |
parent | fc62c87a2ccf0fdaee705350b26650b4370b95a9 (diff) | |
download | tbdiff-ad74a519d62d85f14da8497f8da3b3a32f834ebb.tar.gz |
Patch problem fixed! Still a problem with patch 7.
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README.testing | 15 | ||||
-rw-r--r-- | tests/PATCHES/patchfive.tbd | bin | 77 -> 77 bytes | |||
-rw-r--r-- | tests/PATCHES/patchfour.tbd | bin | 71 -> 71 bytes | |||
-rw-r--r-- | tests/PATCHES/patchone.tbd | bin | 56 -> 4409 bytes | |||
-rw-r--r-- | tests/PATCHES/patchseven.tbd | bin | 75 -> 75 bytes | |||
-rw-r--r-- | tests/PATCHES/patchsix.tbd | bin | 74 -> 74 bytes | |||
-rw-r--r-- | tests/PATCHES/patchthree.tbd | bin | 69 -> 69 bytes | |||
-rw-r--r-- | tests/PATCHES/patchtwo.tbd | bin | 575 -> 581 bytes | |||
-rwxr-xr-x | tests/cross_plat.sh | 25 | ||||
-rwxr-xr-x | tests/gen.sh | 2 |
11 files changed, 21 insertions, 25 deletions
@@ -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 Binary files differindex e1fea2f..6bed2fe 100644 --- a/tests/PATCHES/patchfive.tbd +++ b/tests/PATCHES/patchfive.tbd diff --git a/tests/PATCHES/patchfour.tbd b/tests/PATCHES/patchfour.tbd Binary files differindex 95bc2a3..e22eeb9 100644 --- a/tests/PATCHES/patchfour.tbd +++ b/tests/PATCHES/patchfour.tbd diff --git a/tests/PATCHES/patchone.tbd b/tests/PATCHES/patchone.tbd Binary files differindex 45de964..ef83ac8 100644 --- a/tests/PATCHES/patchone.tbd +++ b/tests/PATCHES/patchone.tbd diff --git a/tests/PATCHES/patchseven.tbd b/tests/PATCHES/patchseven.tbd Binary files differindex cb0733e..afe674e 100644 --- a/tests/PATCHES/patchseven.tbd +++ b/tests/PATCHES/patchseven.tbd diff --git a/tests/PATCHES/patchsix.tbd b/tests/PATCHES/patchsix.tbd Binary files differindex e957a97..a5f0a75 100644 --- a/tests/PATCHES/patchsix.tbd +++ b/tests/PATCHES/patchsix.tbd diff --git a/tests/PATCHES/patchthree.tbd b/tests/PATCHES/patchthree.tbd Binary files differindex 9b80a66..3c326ab 100644 --- a/tests/PATCHES/patchthree.tbd +++ b/tests/PATCHES/patchthree.tbd diff --git a/tests/PATCHES/patchtwo.tbd b/tests/PATCHES/patchtwo.tbd Binary files differindex 3e2b5e6..49319d2 100644 --- a/tests/PATCHES/patchtwo.tbd +++ b/tests/PATCHES/patchtwo.tbd 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 |