This removes the argument to the new_test_environment procedure.
# DejaGnu tool init file for GNU FTP upload handler tests
-# Copyright (C) 2021 Jacob Bachmeyer
+# Copyright (C) 2021, 2022 Jacob Bachmeyer
#
# This file is part of a testsuite for the GNU FTP upload system.
#
# Make sure to add a test in 03_triplet.exp whenever one of these is
# removed to confirm that it is considered invalid.
+set TEST_BASE [file join \
+ [file dirname [testsuite file -object -top]] test.tmp]
+set TENV_STEM [file join $TEST_BASE tenv]
+
# invoked by DejaGnu framework when a failure is recorded
proc upload_count_failures { args } {
global upload_failure_count
return $name
}
-proc new_test_environment { stem } {
- set name [new_work_area $stem]
+proc new_test_environment { } {
+ global TENV_STEM
+ set name [new_work_area $TENV_STEM]
global upload_failure_count
set upload_failure_count 0
proc upload_exit {} {
# clean up test environment tree
- catch {file delete -- test.tmp}
+ global TEST_BASE
+ catch {file delete -- $TEST_BASE}
}
proc upload_version {} {
global UPLOAD_TOOL
# Tests for processing with nothing to do
-# Copyright (C) 2021 Jacob Bachmeyer
+# Copyright (C) 2021, 2022 Jacob Bachmeyer
#
# This file is part of a testsuite for the GNU FTP upload system.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set tenv [new_test_environment [file join test.tmp tenv]]
+set tenv [new_test_environment]
start_test_services $tenv
run_upload_batch_test
# ----------------------------------------
-set tenv [new_test_environment [file join test.tmp tenv]]
+set tenv [new_test_environment]
# files which are to be found in the scan but not processed
put_file [file join $tenv incoming bogus1] "bogus file 1\n"
# ----------------------------------------
proc check_incomplete_upload { has_directive has_main has_signature } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
put_file [file join $tenv mocks] ":^ lsof -Fn .*\n? 1\n"
# ----------------------------------------
proc check_ongoing_upload { open_directive open_main open_signature } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
set msglist {
start "ftp-upload start message"
# ----------------------------------------
proc check_recent_upload { recent_directive recent_main recent_signature } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
set msglist {
start "ftp-upload start message"
# ----------------------------------------
proc check_oversize_part { oversize_directive oversize_signature } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
set msglist {
start "ftp-upload start message"
# Tests for processing standalone directives
-# Copyright (C) 2021 Jacob Bachmeyer
+# Copyright (C) 2021, 2022 Jacob Bachmeyer
#
# This file is part of a testsuite for the GNU FTP upload system.
#
# along with this program. If not, see <http://www.gnu.org/licenses/>.
proc check_loose_directive { desc case args } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
array set opt {
initial-files {} initial-symlinks {}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
proc check_triplet { desc args } {
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
array set data { setup {} upload {} check {} }
array set data $args
}
if { [llength $log] > 0 } { append log_items $log }
- set tenv [new_test_environment [file join test.tmp tenv]]
+ set tenv [new_test_environment]
register_test_packages $tenv {
foo {