[PATCH] Allow parallel execution of bprob testcases

Ulrich Weigand Ulrich.Weigand@de.ibm.com
Wed Oct 16 14:45:00 GMT 2002


Hello,

I'm still seeing spurious testcase failures of the bprob testcases
when executing multiple test suites in parallel.

This is because:
 - there are tests with the same base name causing .da files with the
   same name to overwrite each other
 - the profopt.exp library removes '*.da' as cleanup, causing files
   of other test suites running in parallel to be deleted

The following patch fixes this by renaming the g++ / g77 bprob cases
by prefixing them with g++- or g77- respectively, and by changing the
profopt.exp library and its callers to only selectively remove those
*.da files that the current test case produces.

Tested on s390-ibm-linux and s390x-ibm-linux, verified by inspection
of the logs that all bprob cases are still executed and pass.

OK to apply?

ChangeLog:

      * lib/profopt.exp (profopt-cleanup): New argument TESTCASE.
      Remove only files with the same base name as the test case.
      (profopt-perf-value): Pass TESTCASE to profopt-cleanup.
      (profopt-execute): Likewise.  Also, remove old profiling
      and performance data files before running the tests.

      * gcc.misc-tests/bprob.exp: Remove profopt-cleanup calls.
      * g++.dg/bprob/bprob.exp: Likewise.
      * g77.dg/bprob/bprob.exp: Likewise.  Also, relax regexp
      to allow more general test case names.

      * g++.dg/bprob/bprob-1.C: Rename to ...
      * g++.dg/bprob/g++-bprob-1.C: ... this.

      * g77.dg/bprob/bprob-1.f: Rename to ...
      * g77.dg/bprob/g77-bprob-1.f: ... this.


Index: gcc/testsuite/g++.dg/bprob/bprob.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g++.dg/bprob/bprob.exp,v
retrieving revision 1.2
diff -c -p -r1.2 bprob.exp
*** gcc/testsuite/g++.dg/bprob/bprob.exp  3 Apr 2002 02:01:29 -0000     1.2
--- gcc/testsuite/g++.dg/bprob/bprob.exp  16 Oct 2002 20:03:57 -0000
*************** if $tracelevel then {
*** 51,59 ****
  # Load support procs.
  load_lib profopt.exp

- # Clean up existing .da files.
- profopt-cleanup da
-
  # Main loop.
  foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.C]] {
      # If we're only testing specific files and this isn't one of them,
skip it.
--- 51,56 ----
Index: gcc/testsuite/g77.dg/bprob/bprob.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/g77.dg/bprob/bprob.exp,v
retrieving revision 1.2
diff -c -p -r1.2 bprob.exp
*** gcc/testsuite/g77.dg/bprob/bprob.exp  3 Apr 2002 02:01:28 -0000     1.2
--- gcc/testsuite/g77.dg/bprob/bprob.exp  16 Oct 2002 20:04:00 -0000
*************** if $tracelevel then {
*** 48,58 ****
  # Load support procs.
  load_lib profopt.exp

! # Clean up existing .da and .tim files.
! profopt-cleanup da
! profopt-cleanup tim
!
! foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.f]] {
      # If we're only testing specific files and this isn't one of them,
skip it.
      if ![runtest_file_p $runtests $src] then {
      continue
--- 48,54 ----
  # Load support procs.
  load_lib profopt.exp

! foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.f]] {
      # If we're only testing specific files and this isn't one of them,
skip it.
      if ![runtest_file_p $runtests $src] then {
      continue
Index: gcc/testsuite/gcc.misc-tests/bprob.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.misc-tests/bprob.exp,v
retrieving revision 1.2
diff -c -p -r1.2 bprob.exp
*** gcc/testsuite/gcc.misc-tests/bprob.exp      3 Apr 2002 02:01:31 -0000
1.2
--- gcc/testsuite/gcc.misc-tests/bprob.exp      16 Oct 2002 20:04:02 -0000
*************** if $tracelevel then {
*** 48,57 ****
  # Load support procs.
  load_lib profopt.exp

- # Clean up existing .da and .tim files.
- profopt-cleanup da
- profopt-cleanup tim
-
  foreach src [lsort [glob -nocomplain $srcdir/$subdir/bprob-*.c]] {
      # If we're only testing specific files and this isn't one of them,
skip it.
      if ![runtest_file_p $runtests $src] then {
--- 48,53 ----
Index: gcc/testsuite/lib/profopt.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/profopt.exp,v
retrieving revision 1.2
diff -c -p -r1.2 profopt.exp
*** gcc/testsuite/lib/profopt.exp   16 Sep 2002 13:29:51 -0000    1.2
--- gcc/testsuite/lib/profopt.exp   16 Oct 2002 20:04:02 -0000
*************** set option_list $PROFOPT_OPTIONS
*** 71,80 ****
  #
  # profopt-cleanup -- remove profiling or performance results files.
  #
! # EXT is the extension of files to remove
  #
! proc profopt-cleanup { ext } {
!     set files [glob -nocomplain *.$ext]
      if { $files != "" } {
      eval "remote_file build delete $files"
      }
--- 71,83 ----
  #
  # profopt-cleanup -- remove profiling or performance results files.
  #
! # TESTCASE is the name of the test
! # EXT is the extension of file to remove
  #
! proc profopt-cleanup { testcase ext } {
!     set basename [file tail $testcase]
!     set base [file rootname $basename]
!     set files [glob -nocomplain $base.$ext]
      if { $files != "" } {
      eval "remote_file build delete $files"
      }
*************** proc profopt-perf-value { testcase perf_
*** 112,118 ****
      fail "$testcase perf check: file $base.$perf_ext has wrong format,
$optstr"
      }
      close $fd
!     profopt-cleanup $perf_ext
      return $val
  }

--- 115,121 ----
      fail "$testcase perf check: file $base.$perf_ext has wrong format,
$optstr"
      }
      close $fd
!     profopt-cleanup $testcase $perf_ext
      return $val
  }

*************** proc profopt-execute { src } {
*** 150,155 ****
--- 153,164 ----
      remote_file build delete $execname3
      verbose "Testing $testcase, $option" 1

+     # Remove old profiling and performance data files.
+     profopt-cleanup $testcase $prof_ext
+     if [info exists perf_ext] {
+         profopt-cleanup $testcase $perf_ext
+     }
+
      # Compile for profiling.

      set options ""
*************** proc profopt-execute { src } {
*** 210,216 ****
      }

      # Remove the profiling data files.
!     profopt-cleanup $prof_ext

      # If the test is not expected to produce performance data then
      # we're done now.
--- 219,225 ----
      }

      # Remove the profiling data files.
!     profopt-cleanup $testcase $prof_ext

      # If the test is not expected to produce performance data then
      # we're done now.


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list