File: test-common.tcl

package info (click to toggle)
secnet 0.6.8
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,956 kB
  • sloc: ansic: 15,234; python: 1,057; perl: 966; sh: 596; tcl: 484; java: 231; asm: 114; yacc: 89; php: 64; makefile: 48; awk: 40
file content (32 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# 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
    set l {}
    catch { set l [split $env($pathvar) :] }
    set l [concat [list $entry] $l]
    set env($pathvar) [join $l :]
}

proc prexec {args} {
    puts "exec $args"
    eval exec $args
}

if {![catch {
    set builddir $env(SECNET_TEST_BUILDDIR)
}]} {} else {
    set builddir .
}

if {![catch {
    set tmp $env(AUTOPKGTEST_ARTIACTS)
}]} {} elseif {![catch {
    set tmp $env(AUTOPKGTEST_TMP)
}]} {} elseif {[regsub {^(?:\./)?([sm]test)/t-} $argv0 {\1/d-} tmp]} {
    set tmp $builddir/$tmp
    file mkdir $tmp
}