chiark / gitweb /
changelog: start 0.6.8
[secnet.git] / test-common.tcl
index 45bddcea9dbf325f183c837b60252a6619633ed7..98465113dc989dff6cbfbdf7bf977e288e8943c2 100644 (file)
@@ -1,3 +1,7 @@
+# This file is part of secnet.
+# See LICENCE and this file CREDITS for full list of copyright holders.
+# SPDX-License-Identifier: GPL-3.0-or-later
+# There is NO WARRANTY.
 
 proc prefix_some_path {pathvar entry} {
     global env
@@ -7,6 +11,11 @@ proc prefix_some_path {pathvar entry} {
     set env($pathvar) [join $l :]
 }
 
+proc prexec {args} {
+    puts "exec $args"
+    eval exec $args
+}
+
 if {![catch {
     set builddir $env(SECNET_TEST_BUILDDIR)
 }]} {} else {
@@ -17,7 +26,7 @@ if {![catch {
     set tmp $env(AUTOPKGTEST_ARTIACTS)
 }]} {} elseif {![catch {
     set tmp $env(AUTOPKGTEST_TMP)
-}]} {} elseif {[regsub {^([sm]test)/t-} $argv0 {\1/d-} tmp]} {
+}]} {} elseif {[regsub {^(?:\./)?([sm]test)/t-} $argv0 {\1/d-} tmp]} {
     set tmp $builddir/$tmp
     file mkdir $tmp
 }