public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] gdb/testsuite: Use -J option when compiling Fortran tests
Date: Thu, 05 Dec 2019 03:21:00 -0000	[thread overview]
Message-ID: <8d70a9f0938b9e9efc4fd2eee80cf806b5e97a4a@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 8d70a9f0938b9e9efc4fd2eee80cf806b5e97a4a ***

commit 8d70a9f0938b9e9efc4fd2eee80cf806b5e97a4a
Author:     Andrew Burgess <andrew.burgess@embecosm.com>
AuthorDate: Wed Nov 27 21:51:35 2019 +0000
Commit:     Andrew Burgess <andrew.burgess@embecosm.com>
CommitDate: Wed Dec 4 20:33:36 2019 +0000

    gdb/testsuite: Use -J option when compiling Fortran tests
    
    When compiling Fortran tests (e.g. gdb.fortran/info-modules.exp), the
    Fotran compile produces .mod files.  These files contain details of
    compiled modules that are then consumed by the compiler when compiling
    other files that USE a module.
    
    Currently the compiler writes the .mod files into its current
    directory, so for us this turns out to be 'build/gdb/testsuite/'.
    This means that .mod files can be shared between tests, which seems
    against the spirit of the GDB testsuite; source files should be
    compiled fresh for each test.
    
    This commit adds the -J option to the compiler flags whenever we
    compile a Fortran file, this option tells the compiler where to write,
    and look for, .mod files.
    
    After this commit there was one Fortran test that needed fixing, with
    that fix in place all of the Fortran tests pass again, but now the
    .mod files are now produced in the per-test output directories.
    
    gdb/testsuite/ChangeLog:
    
            * lib/gdb.exp (gdb_compile): Add -J compiler option when building
            Fortran tests.
            * gdb.mi/mi-fortran-modules.exp: Compile source files in correct
            order.
    
    Change-Id: I99444cf22d80e320093d3f3ed9abb8825f378e0b

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 8df282c6b8..173e82d596 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2019-12-04  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+	* lib/gdb.exp (gdb_compile): Add -J compiler option when building
+	Fortran tests.
+	* gdb.mi/mi-fortran-modules.exp: Compile source files in correct
+	order.
+
 2019-12-04  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* gdb.fortran/type-kinds.exp (test_cast_1_to_type_kind): Handle
diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
index 12a81a6869..df48324784 100644
--- a/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
+++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.exp
@@ -22,7 +22,7 @@ set MIFLAGS "-i=mi"
 standard_testfile "mi-fortran-modules.f90" "mi-fortran-modules-2.f90"
 
 if {[prepare_for_testing "failed to prepare" ${testfile} \
-	 [list $srcfile $srcfile2] {debug f90}]} {
+	 [list $srcfile2 $srcfile] {debug f90}]} {
     return -1
 }
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 4682f5d2f8..aa774462d2 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -3719,6 +3719,16 @@ proc gdb_compile {source dest type options} {
     } else {
 	set new_options [universal_compile_options]
     }
+
+    # Place (and look for) Fortran `.mod` files in the output
+    # directory for this specific test.
+    if {[lsearch -exact $options f77] != -1 \
+	    || [lsearch -exact $options f90] != -1 } {
+	# Fortran compile.
+	set mod_path [standard_output_file ""]
+	lappend new_options "additional_flags=-J${mod_path}"
+    }
+
     set shlib_found 0
     set shlib_load 0
     set getting_compiler_info 0


             reply	other threads:[~2019-12-05  3:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  3:21 gdb-buildbot [this message]
2019-12-05  3:04 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master gdb-buildbot
2019-12-05 11:07 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-05 11:44 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-05 11:46 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2019-12-05 12:00 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8d70a9f0938b9e9efc4fd2eee80cf806b5e97a4a@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).