]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
jit: add a way to preserve testsuite executables
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2017 20:40:10 +0000 (20:40 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Oct 2017 20:40:10 +0000 (20:40 +0000)
gcc/jit/ChangeLog:
* docs/internals/index.rst (Running the test suite): Document
PRESERVE_EXECUTABLES.
(Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
* docs/_build/texinfo/libgccjit.texi: Regenerate.

gcc/testsuite/ChangeLog:
* jit.dg/jit.exp (jit-dg-test): If PRESERVE_EXECUTABLES is set in
the environment, don't delete the generated executable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254282 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/jit/ChangeLog
gcc/jit/docs/_build/texinfo/libgccjit.texi
gcc/jit/docs/internals/index.rst
gcc/testsuite/ChangeLog
gcc/testsuite/jit.dg/jit.exp

index 24df99057a0a62fe3ed806f254b09e51d09665f9..87b5473922abc2c6aa54ad30d688014278c567a9 100644 (file)
@@ -1,3 +1,10 @@
+2017-10-31  David Malcolm  <dmalcolm@redhat.com>
+
+       * docs/internals/index.rst (Running the test suite): Document
+       PRESERVE_EXECUTABLES.
+       (Running under valgrind): Add markup to RUN_UNDER_VALGRIND.
+       * docs/_build/texinfo/libgccjit.texi: Regenerate.
+
 2017-10-04  David Malcolm  <dmalcolm@redhat.com>
 
        * docs/cp/topics/expressions.rst (Vector expressions): New
index 344c93e4ccf7404a80b5100f1ea4648f7272c514..a3b206f2dd4ee40f4467068bd8455ab0655f304b 100644 (file)
@@ -19,7 +19,7 @@
 
 @copying
 @quotation
-libgccjit 8.0.0 (experimental 20171004), October 04, 2017
+libgccjit 8.0.0 (experimental 20171031), October 31, 2017
 
 David Malcolm
 
@@ -15016,7 +15016,12 @@ jit/build/gcc/testsuite/jit/jit.log
 
 @noindent
 
-The test executables can be seen as:
+The test executables are normally deleted after each test is run.  For
+debugging, they can be preserved by setting 
+@geindex PRESERVE_EXECUTABLES
+@geindex environment variable; PRESERVE_EXECUTABLES
+@code{PRESERVE_EXECUTABLES}
+in the environment.  If so, they can then be seen as:
 
 @example
 jit/build/gcc/testsuite/jit/*.exe
@@ -15029,7 +15034,9 @@ which can be run independently.
 You can compile and run individual tests by passing "jit.exp=TESTNAME" to RUNTESTFLAGS e.g.:
 
 @example
-[gcc] $ make check-jit RUNTESTFLAGS="-v -v -v jit.exp=test-factorial.c"
+[gcc] $ PRESERVE_EXECUTABLES= \
+          make check-jit \
+            RUNTESTFLAGS="-v -v -v jit.exp=test-factorial.c"
 @end example
 
 @noindent
@@ -15056,7 +15063,10 @@ and once a test has been compiled, you can debug it directly:
 @subsection Running under valgrind
 
 
-The jit testsuite detects if RUN_UNDER_VALGRIND is present in the
+The jit testsuite detects if 
+@geindex RUN_UNDER_VALGRIND
+@geindex environment variable; RUN_UNDER_VALGRIND
+@code{RUN_UNDER_VALGRIND} is present in the
 environment (with any value).  If it is present, it runs the test client
 code under valgrind@footnote{http://valgrind.org},
 specifcally, the default
index cadf36283ef4f4e38864be296686a27ca366303b..4ad7f61f77491a250c616f5e71698e209cfca815 100644 (file)
@@ -103,7 +103,9 @@ and detailed logs in:
 
   jit/build/gcc/testsuite/jit/jit.log
 
-The test executables can be seen as:
+The test executables are normally deleted after each test is run.  For
+debugging, they can be preserved by setting :envvar:`PRESERVE_EXECUTABLES`
+in the environment.  If so, they can then be seen as:
 
 .. code-block:: console
 
@@ -115,7 +117,9 @@ You can compile and run individual tests by passing "jit.exp=TESTNAME" to RUNTES
 
 .. code-block:: console
 
-   [gcc] $ make check-jit RUNTESTFLAGS="-v -v -v jit.exp=test-factorial.c"
+   [gcc] $ PRESERVE_EXECUTABLES= \
+             make check-jit \
+               RUNTESTFLAGS="-v -v -v jit.exp=test-factorial.c"
 
 and once a test has been compiled, you can debug it directly:
 
@@ -130,7 +134,7 @@ and once a test has been compiled, you can debug it directly:
 Running under valgrind
 **********************
 
-The jit testsuite detects if RUN_UNDER_VALGRIND is present in the
+The jit testsuite detects if :envvar:`RUN_UNDER_VALGRIND` is present in the
 environment (with any value).  If it is present, it runs the test client
 code under `valgrind <http://valgrind.org>`_,
 specifcally, the default
index 196c7a1f4f29a5be4eb3035099a2e7233771afce..1af4fd2da432fad840e2e82baf4a44b3e9887e3c 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-31  David Malcolm  <dmalcolm@redhat.com>
+
+       * jit.dg/jit.exp (jit-dg-test): If PRESERVE_EXECUTABLES is set in
+       the environment, don't delete the generated executable.
+
 2017-10-31  David Malcolm  <dmalcolm@redhat.com>
 
        * g++.dg/cpp0x/auto21.C: Update dg-error to reflect addition of
index 39e37c2da826d19dd7a86766d53954fc0a513b16..869d9f693a0145632dc21c8e5b23a96b6eac8e6b 100644 (file)
@@ -580,6 +580,15 @@ proc jit-dg-test { prog do_what extra_tool_flags } {
        verbose "$name is not meant to generate a reproducer"
     }
 
+    # Normally we would return $comp_output and $output_file to the
+    # caller, which would delete $output_file, the generated executable.
+    # If we need to debug, it's handy to be able to suppress this behavior,
+    # keeping the executable around.
+    set preserve_executables [info exists env(PRESERVE_EXECUTABLES)]
+    if $preserve_executables {
+       set output_file ""
+    }
+    
     return [list $comp_output $output_file]
 }