chiark / gitweb /
tests/intree: Make copy and break out from tests/example
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Dec 2019 12:59:14 +0000 (12:59 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 29 Dec 2019 16:04:44 +0000 (16:04 +0000)
We introduce make_copy, which makes a copy of tests/example
suitable for testing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/build-common
tests/check
tests/example/check
tests/intree/.gitignore [new file with mode: 0644]
tests/intree/check [new file with mode: 0755]

index 01ed839..84f9597 100644 (file)
@@ -2,3 +2,12 @@
 SUBDIRMK_REGEN_NDEBUG=''
 export SUBDIRMK_REGEN_NDEBUG
 
+make_copy () {
+       rm -rf tests/$1/example
+       mkdir tests/$1/example
+       git ls-files -z example \
+       | xargs -0 \
+       sh -xec 'rsync -R -l "$@" tests/'$1'/' x
+       rm tests/$1/example/subdirmk
+       ln -sf ../../.. tests/$1/example/subdirmk
+}
index 784fc60..3bd0f89 100755 (executable)
@@ -2,4 +2,5 @@
 set -ex
 
 tests/filter/check
+tests/intree/check
 tests/example/check
index d492068..003bf81 100755 (executable)
@@ -5,14 +5,6 @@ set -ex
 
 cd example
 
-: ----- in-tree build -----
-
-git clean -xdff
-./autogen.sh && ./configure
-make -j4 all check
-make -j4 clean
-make -j4 all check
-
 : ----- out of tree build -----
 
 git clean -xdff
diff --git a/tests/intree/.gitignore b/tests/intree/.gitignore
new file mode 100644 (file)
index 0000000..33a9488
--- /dev/null
@@ -0,0 +1 @@
+example
diff --git a/tests/intree/check b/tests/intree/check
new file mode 100755 (executable)
index 0000000..78725ac
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -ex
+
+. tests/build-common
+
+make_copy intree
+
+cd tests/intree/example
+
+./autogen.sh && ./configure
+make -j4 all check
+make -j4 clean
+make -j4 all check
+
+echo ok.