<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -215,11 +215,15 @@ if [ &quot;$VERIFY_JRUBY&quot; != &quot;&quot; ]; then
     &quot;-Djruby.shell=$JRUBY_SHELL&quot; \
     org.jruby.Main $JRUBY_OPTS &quot;$@&quot;
 
+  # Record the exit status immediately, or it will be overridden.
+  JRUBY_STATUS=$?
+
   if [ &quot;$PROFILE_ARGS&quot; != &quot;&quot; ]; then
       echo &quot;Profiling results:&quot;
-
       cat profile.txt
   fi
+
+  exit $JRUBY_STATUS
 else
   exec &quot;$JAVA_CMD&quot; $JAVA_OPTS &quot;${java_args[@]}&quot; -Xbootclasspath/a:&quot;$JRUBY_CP&quot; -classpath &quot;$CP$CP_DELIMETER$CLASSPATH&quot; \
     &quot;-Djruby.home=$JRUBY_HOME&quot; \
@@ -227,3 +231,6 @@ else
     &quot;-Djruby.shell=$JRUBY_SHELL&quot; \
     org.jruby.Main $JRUBY_OPTS &quot;$@&quot;
 fi
+
+# Be careful adding code down here, you might override the exit
+# status of the jruby invocation.</diff>
      <filename>bin/jruby</filename>
    </modified>
    <modified>
      <diff>@@ -777,18 +777,29 @@
       &lt;delete file=&quot;${build.dir}/mspec.tgz&quot;/&gt;
       &lt;delete file=&quot;${spec.dir}/rubyspecs.current.revision&quot;/&gt;
   &lt;/target&gt;
-  
-  &lt;target name=&quot;run-specs&quot; depends=&quot;jar&quot;&gt;
-      &lt;antcall target=&quot;run-specs-precompiled&quot;/&gt;
-      &lt;antcall target=&quot;run-specs-compiled&quot;/&gt;
-      &lt;antcall target=&quot;run-specs-interpreted&quot;/&gt;
+
+  &lt;target name=&quot;run-specs&quot; depends=&quot;run-specs-precompiled, run-specs-compiled, run-specs-interpreted, jar&quot;&gt;
+    &lt;condition property=&quot;spec.status.combined.OK&quot;&gt;
+      &lt;and&gt;
+        &lt;equals arg1=&quot;${spec.status.PRECOMPILED}&quot; arg2=&quot;0&quot;/&gt;
+        &lt;equals arg1=&quot;${spec.status.COMPILED}&quot;    arg2=&quot;0&quot;/&gt;
+        &lt;equals arg1=&quot;${spec.status.INTERPRETED}&quot; arg2=&quot;0&quot;/&gt;
+      &lt;/and&gt;
+    &lt;/condition&gt;
+    &lt;fail message=&quot;RubySpecs FAILED&quot; unless=&quot;spec.status.combined.OK&quot;/&gt;
   &lt;/target&gt;
 
   &lt;target name=&quot;run-specs-all&quot; depends=&quot;jar&quot;&gt;&lt;antcall target=&quot;run-specs-all-precompiled&quot;/&gt;&lt;/target&gt;
 
-  &lt;target name=&quot;run-specs-compiled&quot;&gt;&lt;_run_specs_internal compile.mode=&quot;JIT&quot; jit.threshold=&quot;0&quot;/&gt;&lt;/target&gt;
-  &lt;target name=&quot;run-specs-precompiled&quot;&gt;&lt;_run_specs_internal compile.mode=&quot;FORCE&quot; jit.threshold=&quot;0&quot;/&gt;&lt;/target&gt;
-  &lt;target name=&quot;run-specs-interpreted&quot;&gt;&lt;_run_specs_internal/&gt;&lt;/target&gt;
+  &lt;target name=&quot;run-specs-compiled&quot; depends=&quot;jar&quot;&gt;
+    &lt;_run_specs_internal mode.name=&quot;COMPILED&quot; compile.mode=&quot;JIT&quot; jit.threshold=&quot;0&quot;/&gt;
+  &lt;/target&gt;
+  &lt;target name=&quot;run-specs-precompiled&quot; depends=&quot;jar&quot;&gt;
+    &lt;_run_specs_internal mode.name=&quot;PRECOMPILED&quot; compile.mode=&quot;FORCE&quot; jit.threshold=&quot;0&quot;/&gt;
+  &lt;/target&gt;
+  &lt;target name=&quot;run-specs-interpreted&quot; depends=&quot;jar&quot;&gt;
+    &lt;_run_specs_internal mode.name=&quot;INTERPRETED&quot; compile.mode=&quot;OFF&quot;/&gt;
+  &lt;/target&gt;
 
   &lt;target name=&quot;run-specs-all-interpreted&quot;&gt;&lt;_run_specs_all_internal compile.mode=&quot;OFF&quot;/&gt;&lt;/target&gt;
   &lt;target name=&quot;run-specs-all-precompiled&quot;&gt;&lt;_run_specs_all_internal compile.mode=&quot;FORCE&quot; jit.threshold=&quot;0&quot;/&gt;&lt;/target&gt;
@@ -834,12 +845,13 @@
     &lt;attribute name=&quot;objectspace.enabled&quot; default=&quot;true&quot;/&gt;
     &lt;attribute name=&quot;thread.pooling&quot; default=&quot;false&quot;/&gt;
     &lt;attribute name=&quot;reflection&quot; default=&quot;false&quot;/&gt;
+    &lt;attribute name=&quot;mode.name&quot;/&gt;
     &lt;element name=&quot;extra-args&quot; optional=&quot;true&quot;/&gt;
 
     &lt;sequential&gt;
       &lt;echo message=&quot;compile=@{compile.mode}, threshold=@{jit.threshold}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection}&quot;/&gt;
     
-      &lt;java classname=&quot;org.jruby.Main&quot; fork=&quot;true&quot; maxmemory=&quot;${jruby.launch.memory}&quot; failonerror=&quot;true&quot; dir=&quot;${base.dir}&quot;&gt;
+      &lt;java classname=&quot;org.jruby.Main&quot; fork=&quot;true&quot; maxmemory=&quot;${jruby.launch.memory}&quot; failonerror=&quot;false&quot; resultproperty=&quot;spec.status.@{mode.name}&quot; dir=&quot;${base.dir}&quot;&gt;
 	&lt;classpath refid=&quot;build.classpath&quot;/&gt;
 	&lt;classpath path=&quot;${jruby.classes.dir}&quot;/&gt;
 
@@ -875,10 +887,12 @@
   &lt;macrodef name=&quot;_run_specs_internal&quot;&gt;
     &lt;attribute name=&quot;compile.mode&quot; default=&quot;OFF&quot;/&gt;
     &lt;attribute name=&quot;jit.threshold&quot; default=&quot;20&quot;/&gt;
+    &lt;attribute name=&quot;mode.name&quot;/&gt;
 
     &lt;sequential&gt;
       &lt;echo message=&quot;Excludes: ${spec.tags.dir}&quot;/&gt;
-      &lt;run-specs compile.mode=&quot;@{compile.mode}&quot; jit.threshold=&quot;@{jit.threshold}&quot;/&gt;
+      &lt;run-specs mode.name=&quot;@{mode.name}&quot;
+        compile.mode=&quot;@{compile.mode}&quot; jit.threshold=&quot;@{jit.threshold}&quot;/&gt;
     &lt;/sequential&gt;
   &lt;/macrodef&gt;
 </diff>
      <filename>build.xml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f276ccf1b9f179b0eeb11c7d481c66fa3cb93c88</id>
    </parent>
  </parents>
  <author>
    <name>vvs</name>
    <email>vvs@961051c9-f516-0410-bf72-c9f7e237a7b7</email>
  </author>
  <url>http://github.com/bobmcwhirter/jruby/commit/e0b37f9708da67078c70c5c32be8b2c039cf8861</url>
  <id>e0b37f9708da67078c70c5c32be8b2c039cf8861</id>
  <committed-date>2008-08-04T14:30:05-07:00</committed-date>
  <authored-date>2008-08-04T14:30:05-07:00</authored-date>
  <message>JRUBY-2894: When spec runs fail, Ant is not terminating with a failure message.

* The reason why mspec invocation didn't return failed status is due to
  JRuby launcher bash script overwriting the exit status when -J-ea was set.

* Also, make Ant run RubySpecs in all three modes even if some of them
  fail, and then return the combined result.

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@7375 961051c9-f516-0410-bf72-c9f7e237a7b7</message>
  <tree>b1afc6474db477ffa0738d0edb5e4ded2b8f7b34</tree>
  <committer>
    <name>vvs</name>
    <email>vvs@961051c9-f516-0410-bf72-c9f7e237a7b7</email>
  </committer>
</commit>
