1*17f0f753SCy Schubert# -*- tcl -*- 2*17f0f753SCy Schubert# 3*17f0f753SCy Schubert# Unless this file is named _teaish.tester.tcl.in, you are probably 4*17f0f753SCy Schubert# looking at an automatically generated/filtered copy and should 5*17f0f753SCy Schubert# probably not edit it. 6*17f0f753SCy Schubert# 7*17f0f753SCy Schubert# This is the wrapper script invoked by teaish's "make test" recipe. 8*17f0f753SCy Schubert# It gets passed 3 args: 9*17f0f753SCy Schubert# 10*17f0f753SCy Schubert# $1 = the DLL name, or "" if the extension has no DLL 11*17f0f753SCy Schubert# 12*17f0f753SCy Schubert# $2 = the "load prefix" for Tcl's [load] or empty if $1 is empty 13*17f0f753SCy Schubert# 14*17f0f753SCy Schubert# $3 = the /path/to/teaish/tester.tcl (test utility code) 15*17f0f753SCy Schubert# 16*17f0f753SCy Schubert@if TEAISH_VSATISFIES_CODE 17*17f0f753SCy Schubert@TEAISH_VSATISFIES_CODE@ 18*17f0f753SCy Schubert@endif 19*17f0f753SCy Schubertif {[llength [lindex $::argv 0]] > 0} { 20*17f0f753SCy Schubert load [file normalize [lindex $::argv 0]] [lindex $::argv 1]; 21*17f0f753SCy Schubert # ----^^^^^^^ needed on Haiku when argv 0 is just a filename, else 22*17f0f753SCy Schubert # load cannot find the file. 23*17f0f753SCy Schubert} 24*17f0f753SCy Schubertsource -encoding utf-8 [lindex $::argv 2]; # teaish/tester.tcl 25*17f0f753SCy Schubert@if TEAISH_PKGINIT_TCL 26*17f0f753SCy Schubertapply {{file} { 27*17f0f753SCy Schubert set dir [file dirname $::argv0] 28*17f0f753SCy Schubert source -encoding utf-8 $file 29*17f0f753SCy Schubert}} [join {@TEAISH_PKGINIT_TCL@}] 30*17f0f753SCy Schubert@endif 31*17f0f753SCy Schubert@if TEAISH_TM_TCL 32*17f0f753SCy Schubertapply {{file} { 33*17f0f753SCy Schubert set dir [file dirname $::argv0] 34*17f0f753SCy Schubert source -encoding utf-8 $file 35*17f0f753SCy Schubert}} [join {@TEAISH_TM_TCL@}] 36*17f0f753SCy Schubert@endif 37*17f0f753SCy Schubert@if TEAISH_TEST_TCL 38*17f0f753SCy Schubertapply {{file} { 39*17f0f753SCy Schubert # Populate state for [tester.tcl::teaish-build-flag*] 40*17f0f753SCy Schubert array set ::teaish__BuildFlags @TEAISH__DEFINES_MAP@ 41*17f0f753SCy Schubert set dir [file normalize [file dirname $file]] 42*17f0f753SCy Schubert #test-fail "Just testing" 43*17f0f753SCy Schubert source -encoding utf-8 $file 44*17f0f753SCy Schubert}} [join {@TEAISH_TEST_TCL@}] 45*17f0f753SCy Schubert@else # TEAISH_TEST_TCL 46*17f0f753SCy Schubert# No $TEAISH_TEST_TCL provided, so here's a default test which simply 47*17f0f753SCy Schubert# loads the extension. 48*17f0f753SCy Schubertputs {Extension @TEAISH_NAME@ @TEAISH_VERSION@ successfully loaded from @TEAISH_TESTER_TCL@} 49*17f0f753SCy Schubert@endif 50