System.Data.SQLite
Check-in [4bfb250998]
Not logged in

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

Overview
Comment:Modify test basic-1.2 to allow it to pass multiple times without having to manually re-copy the test database to the build directory.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4bfb250998b08c6bef5a43c04a26c31d45c090c0
User & Date: mistachkin 2011-07-08 11:45:38
Context
2011-07-08
12:11
Make the assembly attributes for all projects consistent. Also, properly set the assembly configuration attributes based on the actual build configuration. check-in: f9d4491161 user: mistachkin tags: trunk
11:45
Modify test basic-1.2 to allow it to pass multiple times without having to manually re-copy the test database to the build directory. check-in: 4bfb250998 user: mistachkin tags: trunk
10:27
Removing copying of assembly files from unit tests as they are now copied in the common prologue. check-in: bbc7c21748 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/basic.eagle.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
64
65
66
67
68
69
70







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

#
# NOTE: Setup the variables that refer to the various files required by the
#       tests in this file.
#
set testExeFile [getBuildFileName test.exe]
set testLinqExeFile [getBuildFileName testlinq.exe]
set northwindEfDbFile [getBuildFileName northwindEF.db]
set testLinqOutFile [file nativename [file join $path testlinq.out]]

#
# NOTE: Setup the test constraints specific to the tests in this file.
#
if {![haveConstraint file_[file tail $testExeFile]]} then {
  checkForFile $test_channel $testExeFile
................................................................................
}

###############################################################################

runTest {test basic-1.1 {unit tests from the 'test' project} -body {
  set code [catch {
    testExec $testExeFile [list -eventflags Wait -directory \
    [file dirname $northwindEfDbFile] -stdout output -success 0] -autoRun
  } error]

  tlog "---- BEGIN STDOUT OUTPUT\n"
  tlog $output
  tlog "\n---- END STDOUT OUTPUT\n"

  list $code [expr {$code == 0 ? "" : $error}]
................................................................................
} -cleanup {
  unset -nocomplain code output error
} -constraints {eagle file_test.exe} -result {0 {}}}

###############################################################################

runTest {test basic-1.2 {unit tests from the 'testlinq' project} -setup {







  #
  # NOTE: We need to make 100% sure that the console output encoding is the
  #       same as when the 'testlinq.out' file was created.
  #
  set savedEncoding [object invoke Console OutputEncoding]
  set encoding [object invoke System.Text.Encoding GetEncoding Windows-1252]

  object invoke Console OutputEncoding $encoding
} -body {
  set code [catch {
    testExec $testLinqExeFile [list -eventflags Wait -directory \
    [file dirname $northwindEfDbFile] -stdout output -success 0] -autoRun
  } error]

  tlog "---- BEGIN STDOUT OUTPUT\n"
  tlog $output
  tlog "\n---- END STDOUT OUTPUT\n"

  list $code [string equal $output [readFile $testLinqOutFile]] \







|







 







|







 







>
>
>
>
>
>
>











|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
..
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

#
# NOTE: Setup the variables that refer to the various files required by the
#       tests in this file.
#
set testExeFile [getBuildFileName test.exe]
set testLinqExeFile [getBuildFileName testlinq.exe]
set northwindEfDbFile [file join [file dirname $path] testlinq northwindEF.db]
set testLinqOutFile [file nativename [file join $path testlinq.out]]

#
# NOTE: Setup the test constraints specific to the tests in this file.
#
if {![haveConstraint file_[file tail $testExeFile]]} then {
  checkForFile $test_channel $testExeFile
................................................................................
}

###############################################################################

runTest {test basic-1.1 {unit tests from the 'test' project} -body {
  set code [catch {
    testExec $testExeFile [list -eventflags Wait -directory \
    [file dirname $testExeFile] -stdout output -success 0] -autoRun
  } error]

  tlog "---- BEGIN STDOUT OUTPUT\n"
  tlog $output
  tlog "\n---- END STDOUT OUTPUT\n"

  list $code [expr {$code == 0 ? "" : $error}]
................................................................................
} -cleanup {
  unset -nocomplain code output error
} -constraints {eagle file_test.exe} -result {0 {}}}

###############################################################################

runTest {test basic-1.2 {unit tests from the 'testlinq' project} -setup {
  #
  # NOTE: Re-copy the reference database file used for this unit test to the
  #       build directory in case it has been changed by a previous test run.
  #
  file copy -force $northwindEfDbFile \
      [file join [getBuildDirectory] [file tail $northwindEfDbFile]]

  #
  # NOTE: We need to make 100% sure that the console output encoding is the
  #       same as when the 'testlinq.out' file was created.
  #
  set savedEncoding [object invoke Console OutputEncoding]
  set encoding [object invoke System.Text.Encoding GetEncoding Windows-1252]

  object invoke Console OutputEncoding $encoding
} -body {
  set code [catch {
    testExec $testLinqExeFile [list -eventflags Wait -directory \
    [file dirname $testLinqExeFile] -stdout output -success 0] -autoRun
  } error]

  tlog "---- BEGIN STDOUT OUTPUT\n"
  tlog $output
  tlog "\n---- END STDOUT OUTPUT\n"

  list $code [string equal $output [readFile $testLinqOutFile]] \