chiark / gitweb /
test-common: Framework for compatibility tests
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 6 Dec 2019 23:00:53 +0000 (23:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 21:53:43 +0000 (21:53 +0000)
Now normal tests must start with a letter.  Ones starting with C
require OLD_SECNET_DIR.  (Right now that must be both source and build
dir because it's tedious to have to distinguish them and pass both.)

Update comprehensive-test to (i) notice if the user forgot to set
this (ii) make it into an absolute path.  Note that comprehensive-test
therefore has a different default to `make check': If OLD_SECNET_DIR
is not set, `make check' will do none of those tests, but
comprehensive-test will complain (and wants "" to disable those
tests).

We do not need to print this variable in our debugging output about
how we are running secnet (or how the user who specifies _DIVERT_=i
should run it).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
comprehensive-test
stest/common.tcl
test-common.sd.mk

index d8cf07d20ccebaa3366cd0c87d230669f028dc6d..cf01c7b0d736931a5aeaa6b08f28e2896cc23f4b 100755 (executable)
@@ -15,6 +15,19 @@ for arg in "$@"; do
     esac
 done
 
+case "${OLD_SECNET_DIR:?must be set, perhaps to the empty string}" in
+    ''|/*)
+        ;;
+    ../*)
+       OLD_SECNET_DIR="${PWD%/*}/${OLD_SECNET_DIR#../}"
+       echo >&2 "x OLD_SECNET_DIR=$OLD_SECNET_DIR"
+       ;;
+    *)
+       echo >&2 "relative non-.. OLD_SECNET_DIR $OLD_SECNET_DIR !";
+       exit 1
+       ;;
+esac
+
 x () { echo >&2 "x $*"; "$@"; }
 
 srcdir=$(pwd)
index cbf8fc1fae8902a7c60bc945bddfd30d31d3441c..89045a5147b5fb46206385be1c0afb8ab25bff91 100644 (file)
@@ -159,7 +159,7 @@ proc spawn-secnet {location site} {
     foreach k [array names env] {
        switch -glob $k {
            SECNET_STEST_DIVERT_* -
-           SECNET_TEST_BUILDDIR { }
+           SECNET_TEST_BUILDDIR - OLD_SECNET_DIR { }
            *SECNET* -
            *PRELOAD* { puts -nonewline " $k=$env($k)" }
        }
index 0d6cebfa3bd1e18ceab7289f1d4738fe0c6b8441..17e8366f6512c15607664c0a9a87303bf102385d 100644 (file)
@@ -1,7 +1,11 @@
 
 include common.make
 
-&TESTSCRIPTS ?= $(wildcard &^/t-*[0-9a-z])
+&TESTSCRIPTS ?= $(wildcard &^/t-[a-z]*[0-9a-z])
+ifneq ($(OLD_SECNET_DIR),)
+&TESTSCRIPTS += $(wildcard &^/t-C*[0-9a-z])
+endif
+
 &TESTNAMES := $(patsubst t-%,%,$(notdir $(&TESTSCRIPTS)))
 
 &DEPS += $(src)/test-common.tcl