load_lib mockgpg.exp
+# invoked by DejaGnu framework when a failure is recorded
+proc mock_count_failures { args } {
+ global mock_total_failure_count mock_local_failure_count
+ incr mock_total_failure_count
+ incr mock_local_failure_count
+}
+set local_record_procs(fail) mock_count_failures
+set mock_total_failure_count 0
+set mock_local_failure_count 0
+proc mock_total_failures {} {
+ global mock_total_failure_count
+ return $mock_total_failure_count
+}
+proc mock_local_failures {} {
+ global mock_local_failure_count
+ return $mock_local_failure_count
+}
+proc mock_reset_local_failures {} {
+ global mock_local_failure_count
+ set mock_local_failure_count 0
+}
+
proc put_file { file string } {
set chan [open $file w]
puts -nonewline $chan $string
eval $cmd $args
}
-# invoked by DejaGnu framework when a failure is recorded
-proc gpgv_count_failures {args } {
- global gpgv_total_failure_count gpgv_local_failure_count
- incr gpgv_total_failure_count
- incr gpgv_local_failure_count
-}
-set local_record_procs(fail) gpgv_count_failures
-set gpgv_total_failure_count 0
-set gpgv_local_failure_count 0
-
# InitialCapital variable names may be used in the $expect block.
# The "test_dir" variable is also set for the $init block.
proc run_gpgv_test { Name stem keyrings exitCode init phases assess expect } {
[file dirname [testsuite file -object -top]] test.tmp]
file mkdir $test_dir
- global gpgv_local_failure_count
- set gpgv_local_failure_count 0
+ mock_reset_local_failures
eval $init
}
}
- if { $gpgv_local_failure_count == 0 } {
+ if { [mock_local_failures] == 0 } {
foreach scratchfile [list "${stem}" "${stem}.asc" "${stem}.sig"] {
file delete -- [file join $test_dir $scratchfile]
}
#
-if { $gpgv_total_failure_count == 0 } {
+if { [mock_total_failures] == 0 } {
file delete -force $GNUPGHOME
}