Fossil

Check-in [c2e42166]
Login

Check-in [c2e42166]

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

Overview
Comment:Add '-quiet' command line option to the test suite.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c2e42166ef4504c0cd3d49ab34fe5a63d9b33c5b
User & Date: mistachkin 2016-01-06 17:18:53
Context
2016-01-06
19:49
Do not set the directory permission bit on empty files when creating a ZIP archive. ... (check-in: 3d5cf48b user: mistachkin tags: trunk)
19:44
Do not set the directory permission bit on empty files when creating a ZIP archive. ... (Closed-Leaf check-in: 18607775 user: mistachkin tags: pending-review)
17:18
Add '-quiet' command line option to the test suite. ... (check-in: c2e42166 user: mistachkin tags: trunk)
11:13
Update the built-in SQLite to version 3.10.0 final. ... (check-in: 52ee83c7 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/tester.tcl.
47
48
49
50
51
52
53








54
55
56
57
58
59
60
set i [lsearch $argv -verbose]
if {$i>=0} {
  set VERBOSE 1
  set argv [lreplace $argv $i $i]
} else {
  set VERBOSE 0
}









if {[llength $argv]==0} {
  foreach f [lsort [glob $testdir/*.test]] {
    set base [file root [file tail $f]]
    lappend argv $base
  }
}







>
>
>
>
>
>
>
>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
set i [lsearch $argv -verbose]
if {$i>=0} {
  set VERBOSE 1
  set argv [lreplace $argv $i $i]
} else {
  set VERBOSE 0
}

set i [lsearch $argv -quiet]
if {$i>=0} {
  set QUIET 1
  set argv [lreplace $argv $i $i]
} else {
  set QUIET 0
}

if {[llength $argv]==0} {
  foreach f [lsort [glob $testdir/*.test]] {
    set base [file root [file tail $f]]
    lappend argv $base
  }
}
68
69
70
71
72
73
74
75

76

77
78
79
80
81
82
83
    puts $out "starting tests with: $cmd"
    close $out
  }
}

# write protocol
#
proc protOut {msg} {

  puts stdout $msg

  if {$::PROT} {
    set out [open [file join $::testrundir prot] a]
    fconfigure $out -translation platform
    puts $out $msg
    close $out
  }
}







|
>
|
>







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    puts $out "starting tests with: $cmd"
    close $out
  }
}

# write protocol
#
proc protOut {msg {noQuiet 0}} {
  if {$noQuiet || !$::QUIET} {
    puts stdout $msg
  }
  if {$::PROT} {
    set out [open [file join $::testrundir prot] a]
    fconfigure $out -translation platform
    puts $out $msg
    close $out
  }
}
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
    file delete $prompt_file
  } else {
    set rc [catch {eval exec $cmd} result]
  }
  global RESULT CODE
  set CODE $rc
  if {$rc} {
    protOut "ERROR: $result"
  } elseif {$::VERBOSE} {
    protOut "RESULT: $result"
  }
  set RESULT $result
}

# Read a file into memory.







|







127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
    file delete $prompt_file
  } else {
    set rc [catch {eval exec $cmd} result]
  }
  global RESULT CODE
  set CODE $rc
  if {$rc} {
    protOut "ERROR: $result" 1
  } elseif {$::VERBOSE} {
    protOut "RESULT: $result"
  }
  set RESULT $result
}

# Read a file into memory.
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#
proc test_status_list {name result expected} {
  set expected [normalize_status_list $expected]
  set result [normalize_status_list $result]
  if {$result eq $expected} {
    test $name 1
  } else {
    protOut "  Expected:\n    [join $expected "\n    "]"
    protOut "  Got:\n    [join $result "\n    "]"
    test $name 0
  }
}

# Append all arguments into a single value and then returns it.
#
proc appendArgs {args} {







|
|







208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#
proc test_status_list {name result expected} {
  set expected [normalize_status_list $expected]
  set result [normalize_status_list $result]
  if {$result eq $expected} {
    test $name 1
  } else {
    protOut "  Expected:\n    [join $expected "\n    "]" 1
    protOut "  Got:\n    [join $result "\n    "]" 1
    test $name 0
  }
}

# Append all arguments into a single value and then returns it.
#
proc appendArgs {args} {
273
274
275
276
277
278
279
280
281
282
283
284
285
286

287
288
289
290
291
292
293
  }
}

# Perform a test
#
set test_count 0
proc test {name expr} {
  global bad_test test_count
  incr test_count
  set r [uplevel 1 [list expr $expr]]
  if {$r} {
    protOut "test $name OK"
  } else {
    protOut "test $name FAILED!"

    lappend bad_test $name
    if {$::HALT} exit
  }
}
set bad_test {}

# Return a random string N characters long.







|





|
>







283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
  }
}

# Perform a test
#
set test_count 0
proc test {name expr} {
  global bad_test test_count RESULT
  incr test_count
  set r [uplevel 1 [list expr $expr]]
  if {$r} {
    protOut "test $name OK"
  } else {
    protOut "test $name FAILED!" 1
    if {$::QUIET} {protOut "RESULT: $RESULT" 1}
    lappend bad_test $name
    if {$::HALT} exit
  }
}
set bad_test {}

# Return a random string N characters long.
437
438
439
440
441
442
443

444

445
446
447
  cd $dir
  protOut "***** $testfile ******"
  source $testdir/$testfile.test
  protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
  cd $origwd
}
set nErr [llength $bad_test]

protOut "***** Final result: $nErr errors out of $test_count tests"

if {$nErr>0} {
  protOut "***** Failures: $bad_test"
}







>
|
>

|

448
449
450
451
452
453
454
455
456
457
458
459
460
  cd $dir
  protOut "***** $testfile ******"
  source $testdir/$testfile.test
  protOut "***** End of $testfile: [llength $bad_test] errors so far ******"
  cd $origwd
}
set nErr [llength $bad_test]
if {$nErr>0 || !$::QUIET} {
  protOut "***** Final result: $nErr errors out of $test_count tests" 1
}
if {$nErr>0} {
  protOut "***** Failures: $bad_test" 1
}