xref: /freebsd/contrib/sqlite3/tea/_teaish.tester.tcl.in (revision 17f0f75308f287efea825457364e2a4de2e107d4)
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
19if {[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}
24source -encoding utf-8 [lindex $::argv 2]; # teaish/tester.tcl
25@if TEAISH_PKGINIT_TCL
26apply {{file} {
27  set dir [file dirname $::argv0]
28  source -encoding utf-8 $file
29}} [join {@TEAISH_PKGINIT_TCL@}]
30@endif
31@if TEAISH_TM_TCL
32apply {{file} {
33  set dir [file dirname $::argv0]
34  source -encoding utf-8 $file
35}} [join {@TEAISH_TM_TCL@}]
36@endif
37@if TEAISH_TEST_TCL
38apply {{file} {
39  # Populate state for [tester.tcl::teaish-build-flag*]
40  array set ::teaish__BuildFlags @TEAISH__DEFINES_MAP@
41  set dir [file normalize [file dirname $file]]
42  #test-fail "Just testing"
43  source -encoding utf-8 $file
44}} [join {@TEAISH_TEST_TCL@}]
45@else # TEAISH_TEST_TCL
46# No $TEAISH_TEST_TCL provided, so here's a default test which simply
47# loads the extension.
48puts {Extension @TEAISH_NAME@ @TEAISH_VERSION@ successfully loaded from @TEAISH_TESTER_TCL@}
49@endif
50