Index: openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 29 Jun 2018 10:34:28 -0000 1.14 +++ openacs-4/packages/acs-tcl/tcl/test/file-test-procs.tcl 29 Jun 2018 10:47:36 -0000 1.15 @@ -11,34 +11,31 @@ @author Jeff Davis davis@xarg.net } { - set good 0 - set nfiles 0 - # couple of local helper procs - proc ::tcl_p {file} { - return [expr {[string match {*.tcl} $file] || [file isdirectory $file]}] - } - # if startdir is not $::acs::rootdir/packages, then somebody checked in the wrong thing by accident set startdir $::acs::rootdir/packages - aa_log "Checks starting from $startdir" + aa_log "Checks starting from $startdir" - #inspect every Tcl file in the directory tree starting with $startdir - foreach file [ad_find_all_files -check_file_func ::tcl_p $startdir] { - incr nfiles + # get tcl files from installed packages + set files [list] + apm_get_installed_versions -array installed_versions + foreach {package_key version} [array get installed_versions] { + lappend files {*}[lmap f [apm_get_package_files \ + -package_key $package_key] { + if {[file extension $f] ne ".tcl"} continue + set f $startdir/$package_key/$f + }] + } + #inspect every Tcl file in the directory tree starting with $startdir + foreach file $files { set fp [open $file "r"] set data [read $fp] close $fp # Check that the file parses - if {! [info complete $data] } { - aa_log_result fail "$file parses successfully" - } else { - incr good - } + aa_true "$file parses successfully" [info complete $data] } - aa_log "$good good of $nfiles checked" } aa_register_case -cats {smoke production_safe} -error_level error files__tcl_file_common_errors {