public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gfortran.dg test harness for gfortran
@ 2004-07-08 10:40 Billinghurst, David (CALCRTS)
  2004-07-08 13:25 ` Tobias.Schlueter
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Billinghurst, David (CALCRTS) @ 2004-07-08 10:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: fortran

Here is the minimal gfortran.dg test harness, adapted from g77.dg.
I have also christened it by copying one test from g77.dg

I propose that we delete g77.dg/strlen0.f and progressively move
the working tests from the g77 testsuite into the gfortran testsuite,
with the aim of eventually deleting the g77 testsuite.

Tested on i686-pc-cygwin

2004-07-08  David Billinghurst (David.Billinghurst@riotinto.com)

	* lib/gfortran-dg.exp: New file (adapted from g77-dg.exp)
	* gfortran.dg/dg.exp: New file (adapted from g77.dg/dg.exp)
	* gfortran.dg/strlen0.f:  Copied from g77.dg


--- /dev/null   2004-07-08 19:34:16.902000000 +1000
+++ lib/gfortran-dg.exp 2004-07-08 18:39:17.558297600 +1000
@@ -0,0 +1,46 @@
+#   Copyright (C) 1997, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+load_lib gcc-dg.exp
+
+# Define gfortran callbacks for dg.exp.
+
+proc gfortran-dg-test { prog do_what extra_tool_flags } {
+    set result \
+       [gcc-dg-test-1 gfortran_target_compile $prog $do_what $extra_tool_flags]
+    
+    set comp_output [lindex $result 0]
+    set output_file [lindex $result 1]
+
+    # Put the error message on the same line as the line number
+    # Remove the line of source code with the error and
+    # the "     ^" that points to error
+    regsub -all "\n\[^\n\]*\n *\\^\n" $comp_output "" comp_output 
+
+    return [list $comp_output $output_file]
+}
+
+proc gfortran-dg-prune { system text } {
+    return [gcc-dg-prune $system $text]
+}
+
+# Utility routines.
+
+# Modified dg-runtest that can cycle through a list of optimization options
+# as c-torture does.
+proc gfortran-dg-runtest { testcases default-extra-flags } {
+    return [gcc-dg-runtest $testcases ${default-extra-flags}]
+}


--- /dev/null   2004-07-08 19:35:16.317000000 +1000
+++ gfortran.dg/dg.exp  2004-07-08 18:37:34.530150400 +1000
@@ -0,0 +1,36 @@
+#   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gfortran-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_FFLAGS
+if ![info exists DEFAULT_FFLAGS] then {
+    set DEFAULT_FFLAGS " -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+gfortran-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.f* ]] \
+       $DEFAULT_FFLAGS
+
+# All done.
+dg-finish

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gfortran.dg test harness for gfortran
  2004-07-08 10:40 [PATCH] gfortran.dg test harness for gfortran Billinghurst, David (CALCRTS)
@ 2004-07-08 13:25 ` Tobias.Schlueter
  2004-07-08 15:00 ` Paul Brook
  2004-07-09  0:31 ` Phil Edwards
  2 siblings, 0 replies; 7+ messages in thread
From: Tobias.Schlueter @ 2004-07-08 13:25 UTC (permalink / raw)
  To: Billinghurst, David (CALCRTS); +Cc: gcc-patches, fortran

Quoting "Billinghurst, David (CALCRTS)"
<david.billinghurst@comalco.riotinto.com.au>:

> Here is the minimal gfortran.dg test harness, adapted from g77.dg.
> I have also christened it by copying one test from g77.dg
>
> I propose that we delete g77.dg/strlen0.f and progressively move
> the working tests from the g77 testsuite into the gfortran testsuite,
> with the aim of eventually deleting the g77 testsuite.
>
> Tested on i686-pc-cygwin
>

Great! Did you try this with a dg-error testcase? I'm curious, because I did the
same AFAICT without diving into the code, but for some reason the regular
expression didn't catch our multi-line error messages -- even after I had
adapted our error printing routines to print file and line like g77 (i.e.
without the leading " In file") -- and therefore those tests failed with
"excess errors".

Thanks,
- Tobi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gfortran.dg test harness for gfortran
  2004-07-08 10:40 [PATCH] gfortran.dg test harness for gfortran Billinghurst, David (CALCRTS)
  2004-07-08 13:25 ` Tobias.Schlueter
@ 2004-07-08 15:00 ` Paul Brook
  2004-07-09  0:31 ` Phil Edwards
  2 siblings, 0 replies; 7+ messages in thread
From: Paul Brook @ 2004-07-08 15:00 UTC (permalink / raw)
  To: fortran; +Cc: Billinghurst, David (CALCRTS), gcc-patches

On Thursday 08 July 2004 10:39, Billinghurst, David (CALCRTS) wrote:
> 2004-07-08  David Billinghurst (David.Billinghurst@riotinto.com)
>
> 	* lib/gfortran-dg.exp: New file (adapted from g77-dg.exp)
> 	* gfortran.dg/dg.exp: New file (adapted from g77.dg/dg.exp)
> 	* gfortran.dg/strlen0.f:  Copied from g77.dg

Recycled g77 testcase should probably go in gfortran.dg/g77.
Copyright notice should just say 2004 (these are new files).

OK with those changes.

Paul

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gfortran.dg test harness for gfortran
  2004-07-08 10:40 [PATCH] gfortran.dg test harness for gfortran Billinghurst, David (CALCRTS)
  2004-07-08 13:25 ` Tobias.Schlueter
  2004-07-08 15:00 ` Paul Brook
@ 2004-07-09  0:31 ` Phil Edwards
  2 siblings, 0 replies; 7+ messages in thread
From: Phil Edwards @ 2004-07-09  0:31 UTC (permalink / raw)
  To: Billinghurst, David (CALCRTS); +Cc: gcc-patches, fortran

On Thu, Jul 08, 2004 at 07:39:30PM +1000, Billinghurst, David (CALCRTS) wrote:
> +
> +proc gfortran-dg-test { prog do_what extra_tool_flags } {
> +    set result \
> +       [gcc-dg-test-1 gfortran_target_compile $prog $do_what $extra_tool_flags]
> +    
> +    set comp_output [lindex $result 0]
> +    set output_file [lindex $result 1]
> +
> +    # Put the error message on the same line as the line number
> +    # Remove the line of source code with the error and
> +    # the "     ^" that points to error
> +    regsub -all "\n\[^\n\]*\n *\\^\n" $comp_output "" comp_output 
> +
> +    return [list $comp_output $output_file]
> +}

I realize you're copying from existing code, but you can probably just
return $result, rather than taking it apart, using only one half of it,
and then putting it back together.  Bit of a teensy speedup, next time
you're editing that file.

-- 
"This release is mostly intended to mop up the minor and trivial bug fixes
in the list and clear out the documentation changes.  As such, it should be
treated with even more suspicion than is normal."
    - dpkg 1.10.22 release note

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] gfortran.dg test harness for gfortran
@ 2004-07-09  0:55 Billinghurst, David (CALCRTS)
  0 siblings, 0 replies; 7+ messages in thread
From: Billinghurst, David (CALCRTS) @ 2004-07-09  0:55 UTC (permalink / raw)
  To: Paul Brook, fortran; +Cc: gcc-patches

>From: Paul Brook 
>
>On Thursday 08 July 2004 10:39, Billinghurst, David (CALCRTS) wrote:
>> 2004-07-08  David Billinghurst (David.Billinghurst@riotinto.com)
>>
>> 	* lib/gfortran-dg.exp: New file (adapted from g77-dg.exp)
>> 	* gfortran.dg/dg.exp: New file (adapted from g77.dg/dg.exp)
>> 	* gfortran.dg/strlen0.f:  Copied from g77.dg
>
> Recycled g77 testcase should probably go in gfortran.dg/g77.
> Copyright notice should just say 2004 (these are new files).
>
> OK with those changes.
>
> Paul

Done.  Need to tweak gfortran.dg/dg.exp to allow for the subdirectory.
I have also taken this as approval to copy across some of the existing
g77.dg tests.  This is what I did.  As discussed, the failures have been 
XFAILed and I have opened PRs for them.

2004-07-09  David Billinghurst (David.Billinghurst@riotinto.com)

	* gfortran.dg/g77/f77-edit-i-in.f: Copy from g77.dg and
	change X to 1X in format.
	* gfortran.dg/g77/20010216-1.f:  Copy from g77.dg and
	add data statements to conform to standard.

2004-07-09  David Billinghurst (David.Billinghurst@riotinto.com)

	* gfortran.dg/g77/f77-edit-s-out.f: Copy from g77.dg. XFAIL 
	* gfortran.dg/g77/f77-edit-t-in.f: Likewise
	* gfortran.dg/g77/f77-edit-x-out.f: Likewise

2004-07-09  David Billinghurst (David.Billinghurst@riotinto.com)

	* gfortran.dg/g77/7388.f: Copy from g77.dg
	* gfortran.dg/g77/f77-edit-i-out.f: Likewise
	* gfortran.dg/g77/f77-edit-apostrophe-out.f: Likewise  
	* gfortran.dg/g77/f77-edit-slash-out.f: Likewise
	* gfortran.dg/g77/f77-edit-colon-out.f: Likewise
	* gfortran.dg/g77/f77-edit-t-out.f: Likewise
	* gfortran.dg/g77/f77-edit-h-out.f: Likewise
	* gfortran.dg/g77/strlen0.f: Likewise

2004-07-09   David Billinghurst (David.Billinghurst@riotinto.com)

 	* lib/gfortran-dg.exp: New file (adapted from lib/g77-dg.exp)
 	* gfortran.dg/dg.exp: New file (adapted from g77.dg/dg.exp)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] gfortran.dg test harness for gfortran
@ 2004-07-09  0:31 Billinghurst, David (CALCRTS)
  0 siblings, 0 replies; 7+ messages in thread
From: Billinghurst, David (CALCRTS) @ 2004-07-09  0:31 UTC (permalink / raw)
  To: gcc-patches, fortran

> From: Phil Edwards [mailto:phil@codesourcery.com]
> On Thu, Jul 08, 2004 at 07:39:30PM +1000, Billinghurst, David (CALCRTS) wrote:
>> +
>> +proc gfortran-dg-test { prog do_what extra_tool_flags } {
>> +    set result \
>> +       [gcc-dg-test-1 gfortran_target_compile $prog $do_what $extra_tool_flags]
>> +    
>> +    set comp_output [lindex $result 0]
>> +    set output_file [lindex $result 1]
>> +
>> +    # Put the error message on the same line as the line number
>> +    # Remove the line of source code with the error and
>> +    # the "     ^" that points to error
>> +    regsub -all "\n\[^\n\]*\n *\\^\n" $comp_output "" comp_output 
>> +
>> +    return [list $comp_output $output_file]
>> +}
>
> I realize you're copying from existing code, but you can probably just
> return $result, rather than taking it apart, using only one half of it,
> and then putting it back together.  Bit of a teensy speedup, next time
> you're editing that file.

Thanks.  I'll look at this as I tweak the harness.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH] gfortran.dg test harness for gfortran
@ 2004-07-08 13:27 Billinghurst, David (CALCRTS)
  0 siblings, 0 replies; 7+ messages in thread
From: Billinghurst, David (CALCRTS) @ 2004-07-08 13:27 UTC (permalink / raw)
  To: Tobias.Schlueter; +Cc: gcc-patches, fortran

> From: Tobias.Schlueter@Physik.Uni-Muenchen.DE
>
> Great! Did you try this with a dg-error testcase? 

Yes I did.  It doesn't work (yet).  One step at a time.

There is a TCL regular expression that needs tweaking.  
I may even have fixed the g77 driver.  Let's see - yes:

2002-02-07  David Billinghurst <David.Billinghurst@riotinto.com>

	* lib/prune.exp: Remove "In (program|subroutine"block-data)"
	message from g77
	* lib/g77-dg.exp: Trim g77 error messages so that they are
	recognized by dg.exp.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-07-08 23:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-08 10:40 [PATCH] gfortran.dg test harness for gfortran Billinghurst, David (CALCRTS)
2004-07-08 13:25 ` Tobias.Schlueter
2004-07-08 15:00 ` Paul Brook
2004-07-09  0:31 ` Phil Edwards
2004-07-08 13:27 Billinghurst, David (CALCRTS)
2004-07-09  0:31 Billinghurst, David (CALCRTS)
2004-07-09  0:55 Billinghurst, David (CALCRTS)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).