Index: openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl,v diff -u -r1.79.2.73 -r1.79.2.74 --- openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 15 Jul 2024 12:04:48 -0000 1.79.2.73 +++ openacs-4/packages/acs-automated-testing/tcl/aa-test-procs.tcl 18 Jul 2024 08:44:52 -0000 1.79.2.74 @@ -9,9 +9,6 @@ ad_library { Procs to support the acs-automated-testing package. - NOTE: There's a hack in packages/acs-bootstrap-installer/bootstrap.tcl to load - this file on server startup before the *-procs.tcl files of other packages. - @author Peter Harper (peter.harper@open-msg.com) @creation-date 21 June 2001 @@ -667,9 +664,9 @@ # Run each testcase # foreach testcase_id $testcase_ids { - ns_log notice "========================================= start $testcase_id" + ns_log notice "========================================= start $testcase_id (Errors: [dict get [ns_logctl stats] Error])" aa_run_testcase $testcase_id - ns_log notice "========================================= end $testcase_id" + ns_log notice "========================================= end $testcase_id (Errors: [dict get [ns_logctl stats] Error])" } # @@ -852,6 +849,32 @@ ns_log notice "--------- aa_section" $log_notes } +ad_proc -public aa_test_running_p {} { + + Check, if the regression test is currently running. + + @return boolean value indicating state +} { + return [info exists ::__aa_testing_mode] +} + +ad_proc -public aa_test_start {} { + + Set the start flag of the regression test case. +} { + return [set ::__aa_testing_mode 1] +} + +ad_proc -public aa_test_end {} { + + Clear the flag indicating that a regressoin test is running. It + is not always necessary to call this procedurfe explicitly, since + the server cleanup clears this flag automatically. + +} { + unset -nocomplain ::__aa_testing_mode 1 +} + ad_proc -public aa_log { args } { Writes a log message to the testcase log. Call this function within a testcase, stub or component. @@ -1595,7 +1618,7 @@ set d [::acs::test::form_reply -user_id 0 -form $form] acs::test::reply_has_status_code $d 302 - set ::__aa_testing_mode 1 + aa_test_start return $d } @@ -1609,7 +1632,7 @@ } { set d [acs::test::http -last_request $last_request /register/logout] acs::test::reply_has_status_code $d 302 - unset -nocomplain ::__aa_testing_mode 1 + aa_test_end return $d } Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v diff -u -r1.126.2.106 -r1.126.2.107 --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl 15 Jul 2024 12:04:49 -0000 1.126.2.106 +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl 18 Jul 2024 08:44:53 -0000 1.126.2.107 @@ -146,10 +146,10 @@ #ad_conn -set session_id [sec_allocate_session] set auth_level ok set untrusted_user_id $user_id - set ::__aa_testing_mode 1 + aa_test_start } } - if {![info exists ::__aa_testing_mode]} { + if {![aa_test_running_p]} { sec_login_handler }