System.Data.SQLite

Check-in [ca79d5ba6d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further enhancements to the automated WinCE deployment and test tool.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ca79d5ba6df51cb23590128a0e03cfced028de9a
User & Date: mistachkin 2018-09-09 00:36:05.778
Context
2018-09-25
01:03
Modify the NuGet packages to better handle what .NET Core seems to expect. Candidate fix for [d292f2e23d8a74e0]. check-in: aec1b8f7dd user: mistachkin tags: trunk
2018-09-09
00:36
Further enhancements to the automated WinCE deployment and test tool. check-in: ca79d5ba6d user: mistachkin tags: trunk
2018-09-08
06:55
When testing on WinCE, make it possible to fetch output produced by the remote process. check-in: 7573c439f5 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Setup/deployAndTestCe200x.eagle.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

proc usage { error } {
  if {[string length $error] > 0} then {puts stdout $error}

  puts stdout "usage:\
[file tail [info nameofexecutable]]\
[file tail [info script]] \[year\] \[platform\] \[configuration\]\
\[culture\] \[platformId\] \[deviceId\] \[quiet\]"

  #
  # NOTE: Indicate to the caller, if any, that we have failed.
  #
  exit 1
}








|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

proc usage { error } {
  if {[string length $error] > 0} then {puts stdout $error}

  puts stdout "usage:\
[file tail [info nameofexecutable]]\
[file tail [info script]] \[year\] \[platform\] \[configuration\]\
\[culture\] \[platformId\] \[deviceId\] \[mode\] \[quiet\]"

  #
  # NOTE: Indicate to the caller, if any, that we have failed.
  #
  exit 1
}

97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
  }

  return -1
}

set argc [llength $argv]

if {$argc >= 0 && $argc <= 7} then {
  #
  # NOTE: Setup the default values for all command line options.
  #
  array set default {
            year 2008
        platform {Pocket PC 2003 (ARMV4)}
   configuration Release
         culture en-US
      platformId 3c41c503-53ef-4c2a-8dd4-a8217cad115e
        deviceId {}

           quiet false
  }

  #
  # NOTE: Process all the command line options.  If a command line option
  #       is not present, use the default value.
  #
  set names [list \
      year platform configuration culture platformId deviceId quiet]

  for {set index 0} {$index < [llength $names]} {incr index} {
    set name [lindex $names $index]; set value ""

    if {$argc > $index} then {
      set value [string trim [lindex $argv $index]]
    }







|










>








|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
  }

  return -1
}

set argc [llength $argv]

if {$argc >= 0 && $argc <= 8} then {
  #
  # NOTE: Setup the default values for all command line options.
  #
  array set default {
            year 2008
        platform {Pocket PC 2003 (ARMV4)}
   configuration Release
         culture en-US
      platformId 3c41c503-53ef-4c2a-8dd4-a8217cad115e
        deviceId {}
            mode test
           quiet false
  }

  #
  # NOTE: Process all the command line options.  If a command line option
  #       is not present, use the default value.
  #
  set names [list \
      year platform configuration culture platformId deviceId mode quiet]

  for {set index 0} {$index < [llength $names]} {incr index} {
    set name [lindex $names $index]; set value ""

    if {$argc > $index} then {
      set value [string trim [lindex $argv $index]]
    }
203
204
205
206
207
208
209

210

211
212
213
214
215
216

217
218

219
220
221
222
223
224

225
226





















227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256

257
258
259
260
261
262
263
  #
  set path [file dirname [info script]]

  #
  # NOTE: The base path should be the project root directory, which should
  #       be one level above the one containing this script.
  #

  set base_path [file dirname $path]


  #
  # NOTE: The managed binaries to be deployed to the target device should
  #       be located in the "<base>\bin\<year>\<configuration>Compact\bin"
  #       directory.
  #

  set managed_directory [file join \
      $base_path bin $year [appendArgs $configuration Compact] bin]


  #
  # NOTE: The native binaries to be deployed to the target device should
  #       be located in the "<base>\bin\<year>\<platform>\<configuration>"
  #       directory.
  #

  set native_directory [file join \
      $base_path bin $year $platform $configuration]






















  #
  # NOTE: Build the list of all application files that need to be deployed to
  #       the target device, including all the native and managed binaries.
  #
  if {![info exists fileNames]} then {
    #
    # NOTE: Grab the assembly name instance based on the primary managed
    #       assembly file name.  This is needed because the build portion of
    #       the assembly version is used when building the default list of
    #       application files to be deployed to the target device.
    #
    set assemblyName [object invoke -alias System.Reflection.AssemblyName \
        GetAssemblyName [file join $managed_directory System.Data.SQLite.dll]]

    #
    # NOTE: The default list of application files includes the test application
    #       itself, the System.Data.SQLite managed assembly, the SQLite interop
    #       assembly, and the test application configuration file.
    #
    set fileNames [list [file join $managed_directory testce.exe] [file \
        join $managed_directory System.Data.SQLite.dll] [file join \
        $native_directory [appendArgs SQLite.Interop. [format %03d \
        [$assemblyName Version.Build]] .dll]] [file join $managed_directory \
        test.cfg] [file join $managed_directory test.sql]]
  }

  #
  # NOTE: Setup the directory on the target device where the application files
  #       should be deployed to.

  #
  if {![info exists device_directory]} then {
    set device_directory "\\Program Files\\testce\\"
  }

  #
  # NOTE: Load the managed assembly that allows us to communicate with the







>
|
>






>
|
|
>






>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




















|
|


|




|
>







204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
  #
  set path [file dirname [info script]]

  #
  # NOTE: The base path should be the project root directory, which should
  #       be one level above the one containing this script.
  #
  if {![info exists base_path]} then {
    set base_path [file dirname $path]
  }

  #
  # NOTE: The managed binaries to be deployed to the target device should
  #       be located in the "<base>\bin\<year>\<configuration>Compact\bin"
  #       directory.
  #
  if {![info exists managed_directory]} then {
    set managed_directory [file join \
        $base_path bin $year [appendArgs $configuration Compact] bin]
  }

  #
  # NOTE: The native binaries to be deployed to the target device should
  #       be located in the "<base>\bin\<year>\<platform>\<configuration>"
  #       directory.
  #
  if {![info exists native_directory]} then {
    set native_directory [file join \
        $base_path bin $year $platform $configuration]
  }

  #
  # NOTE: Figure out the main test file names based on the mode argument from
  #       the caller.
  #
  switch -exact -nocase -- $mode {
    test {
      set testFileNameOnly testce.exe
      set cfgFileNameOnly test.cfg
      set sqlFileNameOnly test.sql
    }
    shell {
      set testFileNameOnly shellce.exe
      set cfgFileNameOnly shell.cfg
      set sqlFileNameOnly shell.sql
    }
    default {
      error [appendArgs "unsupported mode \"" $mode \"]
    }
  }

  #
  # NOTE: Build the list of all application files that need to be deployed to
  #       the target device, including all the native and managed binaries.
  #
  if {![info exists fileNames]} then {
    #
    # NOTE: Grab the assembly name instance based on the primary managed
    #       assembly file name.  This is needed because the build portion of
    #       the assembly version is used when building the default list of
    #       application files to be deployed to the target device.
    #
    set assemblyName [object invoke -alias System.Reflection.AssemblyName \
        GetAssemblyName [file join $managed_directory System.Data.SQLite.dll]]

    #
    # NOTE: The default list of application files includes the test application
    #       itself, the System.Data.SQLite managed assembly, the SQLite interop
    #       assembly, and the test application configuration file.
    #
    set fileNames [list [file join $managed_directory $testFileNameOnly] \
        [file join $managed_directory System.Data.SQLite.dll] [file join \
        $native_directory [appendArgs SQLite.Interop. [format %03d \
        [$assemblyName Version.Build]] .dll]] [file join $managed_directory \
        $cfgFileNameOnly] [file join $managed_directory $sqlFileNameOnly]]
  }

  #
  # NOTE: Setup the directory on the target device where the application files
  #       should be deployed to.  It should be noted that this directory value
  #       does not vary based on the mode.
  #
  if {![info exists device_directory]} then {
    set device_directory "\\Program Files\\testce\\"
  }

  #
  # NOTE: Load the managed assembly that allows us to communicate with the
345
346
347
348
349
350
351
352

353
354
355
356
357
358
359
360
361
362

  #
  # NOTE: Run the test application on the target device in "automatic" mode
  #       (i.e. no user interaction is required) and capture the exit code.
  #       The exit code will be zero upon success (i.e. all tests passed) or
  #       non-zero otherwise.
  #
  set testFileName [file nativename [file join $device_directory testce.exe]]


  #
  # NOTE: The first (and only) argument passed to "testce.exe" on the device
  #       is the auto-close flag.  When non-zero, it will close automatically
  #       upon completion.  Setting this to zero is sometimes useful in order
  #       to more carefully examine the detailed results.
  #
  set exitCode [startRemoteProcess $device $testFileName true]

  #







|
>


|







373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391

  #
  # NOTE: Run the test application on the target device in "automatic" mode
  #       (i.e. no user interaction is required) and capture the exit code.
  #       The exit code will be zero upon success (i.e. all tests passed) or
  #       non-zero otherwise.
  #
  set testFileName [file nativename \
      [file join $device_directory $testFileNameOnly]]

  #
  # NOTE: The first (and only) argument passed to main test EXE on the device
  #       is the auto-close flag.  When non-zero, it will close automatically
  #       upon completion.  Setting this to zero is sometimes useful in order
  #       to more carefully examine the detailed results.
  #
  set exitCode [startRemoteProcess $device $testFileName true]

  #