summaryrefslogtreecommitdiff
path: root/tests/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-07 23:05:42 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2016-11-07 23:05:42 +0000
commit862997ec70c49b644de04639f6f68bc8309e3d56 (patch)
treec435450cfefe8a8d4afcf3f9ce3a4d6b36e80b7b /tests/tests
parent37a0cb653704a1c0ded4750946915e5ce4718125 (diff)
Test suite: import-nonnative: Check that .orig contents match imported trees
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/tests')
-rwxr-xr-xtests/tests/import-nonnative16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tests/import-nonnative b/tests/tests/import-nonnative
index d709ab5..a1884e7 100755
--- a/tests/tests/import-nonnative
+++ b/tests/tests/import-nonnative
@@ -55,6 +55,19 @@ chk2() {
t-ref-same refs/heads/first-2nd-import
for orig in ../${p}_${v%-*}.orig*.tar.*; do
+ tar -atf $orig | LC_ALL=C sort >../files.o
+ pfx=$(perl <../files.o -ne '
+ while (<>) {
+ m#^([^/]+/)# or exit 0;
+ $x //= $1;
+ $x eq $1 or exit 0;
+ }
+ print "$x\n";
+ ')
+ perl -i~ -pe '
+ s#^\Q'"$pfx"'\E##;
+ $_="" if m/^$/ || m#/$#;
+ ' ../files.o
orig=${orig#../}
pat="^Import ${orig//./\\.}\$"
t-refs-same-start
@@ -65,6 +78,9 @@ chk2() {
imp=$(cat ../t.imp)
t-ref-same-val "$orig $start" "$imp"
done
+ git ls-tree -r --name-only "$t_ref_val:" \
+ | sort >../files.g
+ diff ../files.{o,g}
done
cd ..
}