set all_flags $DEFAULT_COBFLAGS
+# Recursively find files in $dir and subdirs, do not walk into subdirs
+# that contain their own .exp file.
+proc find-cob-tests { dir suffix } {
+ set tests [lsort [glob -nocomplain -directory $dir "*.$suffix" ]]
+ foreach subdir [lsort [glob -nocomplain -type d -directory $dir *]] {
+ if { [glob -nocomplain -directory $subdir *.exp] eq "" } {
+ eval lappend tests [find-cob-tests $subdir $suffix]
+ }
+ }
+ return $tests
+}
+
+set tests [find-cob-tests $srcdir/$subdir {cob}]
+
# Main loop.
if [check_effective_target_cobol] {
- cobol-dg-runtest [lsort \
- [glob -nocomplain $srcdir/$subdir/*.cob ] ] "" $all_flags
+ cobol-dg-runtest $tests "" $all_flags
}
# All done.
--- /dev/null
+*> { dg-do run }
+*> { dg-output {Testing the testing(\n|\r|\r\n)} }
+*> { dg-output {\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|(\n|\r|\r\n)} }
+*> { dg-output {"\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|"} }
+ identification division.
+ program-id. escape.
+ procedure division.
+ display "Testing the testing"
+ display ".^$*+-?()[]{}\|"
+ display '".^$*+-?()[]{}\|"' .
+ end program escape.