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