Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 13 Jan 2003 22:55:55 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 14 Jan 2003 12:17:05 -0000 1.13 @@ -260,7 +260,7 @@ } ad_proc -private apm_files_load { - {-force_reload_p 0} + {-force_reload:boolean 0} {-callback apm_dummy_callback} files } { @@ -269,7 +269,6 @@ @param -force_reload Indicates if the file should be loaded even if it \ is already loaded in the interpreter. } { - # This will be the first time loading for each of these files (since if a # file has already been loaded, we just skip it in the loop below). global apm_first_time_loading_p Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 13 Jan 2003 22:55:55 -0000 1.21 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 14 Jan 2003 12:17:05 -0000 1.22 @@ -503,7 +503,7 @@ " return 0 } - if {![string compare $package_type "apm_service"] && ![string compare $singleton_p "t"]} { + if { [string equal $package_type "apm_service"] && [string equal $singleton_p "t"]} { # This is a singleton package. Instantiate it automatically. if {[catch { db_exec_plsql package_instantiate_mount { @@ -525,8 +525,8 @@ } } - # Load Tcl libraries and xql queries so that restart is not necessary - apm_load_package -force_reload_p 1 $package_key + # Load Tcl libraries and xql queries so that restart is not necessary + apm_load_package -force_reload -load_tests=[apm_load_tests_p] $package_key return $version_id } Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 13 Jan 2003 22:55:55 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 14 Jan 2003 12:17:05 -0000 1.32 @@ -250,7 +250,7 @@ } ad_proc -private apm_load_libraries { - {-force_reload_p 0} + {-force_reload:boolean 0} {-packages {}} {-callback apm_dummy_callback} {-procs:boolean} @@ -318,35 +318,46 @@ # Release all outstanding database handles (since the file we're sourcing # might be using the ns_db database API as opposed to the new db_* API). db_release_unused_handles - apm_files_load -force_reload_p $force_reload_p -callback $callback $files + apm_files_load -force_reload=$force_reload_p -callback $callback $files } +ad_proc -public apm_load_tests_p {} { + Determine whether to load acs-automated-testing tests + for packages. + + @return 1 if tests should be loaded and 0 otherwise + + @author Peter Marklund +} { + return [apm_package_enabled_p "acs-automated-testing"] +} + ad_proc -public apm_load_package { - {-force_reload_p 0} - {-load_tests_p 0} + {-force_reload:boolean 0} + {-load_tests:boolean 0} package_key } { Load libraries and queries for the package with given key. @author Peter Marklund } { # Load *-procs.tcl and *-init.tcl files for enabled packages. - apm_load_libraries -force_reload_p $force_reload_p -packages $package_key -procs + apm_load_libraries -force_reload=$force_reload_p -packages $package_key -procs # Load up the Queries (OpenACS, ben@mit.edu) apm_load_queries -packages $package_key # Load up the Automated Tests and associated Queries if necessary if {$load_tests_p} { - apm_load_libraries -force_reload_p $force_reload_p -packages $package_key -test_procs + apm_load_libraries -force_reload=$force_reload_p -packages $package_key -test_procs apm_load_queries -packages $package_key -test_queries } - apm_load_libraries -packages $package_key -init + apm_load_libraries -init -packages $package_key # Load up the Automated Tests initialisation scripts is necessary if {$load_tests_p} { - apm_load_libraries -force_reload_p $force_reload_p -packages $package_key -test_init + apm_load_libraries -force_reload=$force_reload_p -packages $package_key -test_init } }