modernc.org/cc@v1.0.1/v2/testdata/_sqlite/ext/lsm1/test/lsm1_common.tcl (about)

     1  # 2014 Dec 19
     2  #
     3  # The author disclaims copyright to this source code.  In place of
     4  # a legal notice, here is a blessing:
     5  #
     6  #    May you do good and not evil.
     7  #    May you find forgiveness for yourself and forgive others.
     8  #    May you share freely, never taking more than you give.
     9  #
    10  #***********************************************************************
    11  #
    12  
    13  if {![info exists testdir]} {
    14    set testdir [file join [file dirname [info script]] .. .. .. test]
    15  }
    16  source $testdir/tester.tcl
    17  
    18  # Check if the lsm1 extension has been compiled.
    19  if {$::tcl_platform(platform) == "windows"} {
    20    set lsm1 lsm.dll
    21  } else {
    22    set lsm1 lsm.so
    23  }
    24  
    25  if {[file exists [file join .. $lsm1]]} {
    26    proc return_if_no_lsm1 {} {}
    27  } else {
    28    proc return_if_no_lsm1 {} {
    29      finish_test
    30      return -code return
    31    }
    32    return
    33  }
    34  
    35  proc load_lsm1_vtab {db} {
    36    db enable_load_extension 1
    37    db eval {SELECT load_extension('../lsm')}
    38  }