Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ok specs in rakefile?

  • Loading branch information...
commit e17306b4bfe40db1950e4043730fb216c1fb8aa3 1 parent 38ed6fe
@enebo enebo authored
Showing with 222 additions and 272 deletions.
  1. +48 −248 build.xml
  2. +1 −0  default.build.properties
  3. +12 −8 rakelib/git.rake
  4. +161 −16 rakelib/spec.rake
View
296 build.xml
@@ -445,8 +445,8 @@
<arg value="maybe_install_gems"/>
<arg value="${build.lib.dir}/${rspec.gem}"/>
<arg value="${build.lib.dir}/${rake.gem}"/>
- <arg value="${build.lib.dir}/${ruby-debug-base.gem}"/>
- <arg value="${build.lib.dir}/${ruby-debug.gem}"/>
+ <arg value="${build.lib.dir}/${ruby.debug.base.gem}"/>
+ <arg value="${build.lib.dir}/${ruby.debug.gem}"/>
<arg value="${build.lib.dir}/${columnize.gem}"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
@@ -541,8 +541,8 @@
<arg value="maybe_install_gems"/>
<arg value="${build.lib.dir}/${rspec.gem}"/>
<arg value="${build.lib.dir}/${rake.gem}"/>
- <arg value="${build.lib.dir}/${ruby-debug-base.gem}"/>
- <arg value="${build.lib.dir}/${ruby-debug.gem}"/>
+ <arg value="${build.lib.dir}/${ruby.debug.base.gem}"/>
+ <arg value="${build.lib.dir}/${ruby.debug.gem}"/>
<arg value="${build.lib.dir}/${columnize.gem}"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
@@ -916,12 +916,9 @@
</java>
</target>
+ <target name="test-rake-targets" depends="init"><rake task="test:rake_targets"/></target>
- <target name="test-rake-targets" depends="init">
- <run-rake rake.targets="test:rake_targets"/>
- </target>
-
- <macrodef name="run-rake">
+ <macrodef name="rake">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.max" default="-1"/>
@@ -930,12 +927,12 @@
<attribute name="reflection" default="false"/>
<attribute name="inproc" default="true"/>
<attribute name="jruby.args" default=""/>
- <attribute name="rake.targets"/>
+ <attribute name="task"/>
<attribute name="dir" default="${base.dir}"/>
<attribute name="jvm.args" default="-ea"/>
<sequential>
- <echo message="Running rake @{rake.targets}"/>
+ <echo message="Running rake @{task}"/>
<echo message="compile=@{compile.mode}, threshold=@{jit.threshold}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection}"/>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="@{dir}">
@@ -959,180 +956,52 @@
<sysproperty key="emma.coverage.out.merge" value="true" />
<sysproperty key="emma.verbosity.level" value="silent" />
- <arg line="@{jruby.args}"/>
- <arg line="-S rake"/>
- <arg line="@{rake.targets}"/>
+ <arg line="@{jruby.args} -S rake @{task}"/>
</java>
</sequential>
</macrodef>
- <target name="detect-stable-specs-need-update">
- <property file="${spec.dir}/rubyspecs.current.revision"/>
- <condition property="stable-specs-need-update">
- <or>
- <not> <available file="${rubyspec.dir}"/> </not>
- <not> <available file="${mspec.dir}"/> </not>
- <not>
- <equals
- arg1="${rubyspecs.revision}"
- arg2="${rubyspecs.current.revision}"/>
- </not>
- <not>
- <equals
- arg1="${mspec.revision}"
- arg2="${mspec.current.revision}"/>
- </not>
- </or>
- </condition>
+ <!-- Utilities to manage rubyspecs/mspec files -->
+ <target name="fetch-stable-specs" depends="init">
+ <rake task="spec:fetch_stable_specs"/>
</target>
-
- <target name="fetch-stable-specs" depends="fetch-specs, detect-stable-specs-need-update" if="stable-specs-need-update">
- <echo message="Rolling rubyspec to stable version"/>
- <exec dir="${rubyspec.dir}" executable="git">
- <arg line="checkout ${rubyspecs.revision}"/>
- </exec>
-
- <echo message="Rolling mspec to stable version"/>
- <exec dir="${mspec.dir}" executable="git">
- <arg line="checkout ${mspec.revision}"/>
- </exec>
-
- <!-- Write down the revision of downloaded specs -->
- <propertyfile file="${spec.dir}/rubyspecs.current.revision" comment="Revision of downloaded specs.">
- <entry key="rubyspecs.current.revision" value="${rubyspecs.revision}"/>
- <entry key="mspec.current.revision" value="${mspec.revision}"/>
- </propertyfile>
+ <target name="fetch-latest-specs" depends="init">
+ <rake task="spec:fetch_latest_specs"/>
</target>
- <!-- NOTE: There are two different rubyspecs versions: stable and unstable.
- Stable ones are in known good state, and all known JRuby failures are excluded.
- The idea is that the stable specs runs must be clean, no failures.
- Unstable specs are the very latest, and might have new failures.
-
- Stable specs are downloaded as a snapshot of particular revision.
- Unstable specs are downloaded as a git repo. -->
-
- <!-- stable specs -->
- <target name="spec" depends="fetch-stable-specs, run-specs"
- description="Runs known good version of rubyspecs."/>
- <target name="spec-short" depends="fetch-stable-specs, run-specs-short, run-specs-short-1.9"
- description="Runs known good version of rubyspecs, excluding unstable library specs."/>
- <target name="spec-short-1.9" depends="fetch-stable-specs, run-specs-short-1.9"
- description="Runs known good version of rubyspecs, excluding unstable library specs."/>
- <target name="spec-ci" depends="fetch-stable-specs, run-specs-ci"
- description="Runs known good version of rubyspecs interpreted, compiled, and precompile, excluding unstable library specs."/>
- <target name="spec-ci-1.9" depends="fetch-stable-specs, run-specs-ci-1.9"
- description="Runs known good version of rubyspecs interpreted, compiled, and precompile, excluding unstable library specs."/>
- <target name="spec-all" depends="fetch-stable-specs, run-specs-all"
- description="Runs known good version of rubyspecs without exclusions."/>
- <target name="spec-all-interpreted" depends="fetch-stable-specs, run-specs-all-interpreted"
- description="Runs known good version of rubyspecs without exclusions."/>
-
- <!-- latest, unstable specs -->
- <target name="spec-latest" depends="fetch-specs, run-specs" description="Runs the very latest rubyspecs."/>
- <target name="spec-latest-all" depends="fetch-specs, run-specs-all"
- description="Runs the very latest rubyspecs without exclusions."/>
-
- <target name="fetch-specs" depends="jar"><run-rake rake.targets="spec:fetch_specs"/></target>
-
- <target name="clear-specs">
- <delete dir="${rubyspec.dir}"/>
- <delete dir="${mspec.dir}"/>
- <delete file="${build.dir}/rubyspec.tgz"/>
- <delete file="${build.dir}/mspec.tgz"/>
- <delete file="${spec.dir}/rubyspecs.current.revision"/>
+ <!-- Main spec runs (See rakelib/spec.rake for definitions/descriptions) -->
+ <target name="spec:ci_18" depends="jar"><rake task="spec:ci_18"/></target>
+ <target name="spec:ci_19" depends="jar"><rake task="spec:ci_19"/></target>
+ <target name="spec:ci_interpreted_18_19" depends="jar">
+ <rake task="spec:ci_interpreted_18_19"/>
</target>
-
- <target name="run-specs" depends="run-specs-precompiled, run-specs-compiled, run-specs-interpreted">
- <condition property="spec.status.combined.OK">
- <and>
- <equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
- <equals arg1="${spec.status.COMPILED}" arg2="0"/>
- <equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
- </and>
- </condition>
- <fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
+ <target name="spec:ci_interpreted_18" depends="jar">
+ <rake task="spec:ci_interpreted_18"/>
</target>
-
- <target name="run-specs-short" depends="run-specs-interpreted-short">
- <condition property="spec.status.combined.OK">
- <and>
- <equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
- </and>
- </condition>
- <fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
+ <target name="spec:ci_interpreted_19" depends="jar">
+ <rake task="spec:ci_interpreted_19"/>
</target>
-
- <target name="run-specs-short-1.9" depends="run-specs-interpreted-short-1.9">
- <condition property="spec.status.combined.OK">
- <and>
- <equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
- </and>
- </condition>
- <fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
- </target>
-
- <target name="run-specs-ci" depends="run-specs-compiled-short, run-specs-interpreted-short, run-specs-precompiled-short">
- <condition property="spec.status.combined.OK">
- <and>
- <equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
- <equals arg1="${spec.status.COMPILED}" arg2="0"/>
- <equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
- </and>
- </condition>
- <fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
- </target>
-
- <target name="run-specs-ci-1.9" depends="run-specs-compiled-short-1.9, run-specs-interpreted-short-1.9, run-specs-precompiled-short-1.9">
- <condition property="spec.status.combined.OK">
- <and>
- <equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
- <equals arg1="${spec.status.COMPILED}" arg2="0"/>
- <equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
- </and>
- </condition>
- <fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
- </target>
-
- <target name="run-specs-all" depends="jar, run-specs-all-precompiled"/>
-
- <target name="run-specs-compiled" depends="jar">
- <_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
- </target>
- <target name="run-specs-precompiled" depends="jar">
- <_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
+ <target name="spec:ci_all_precompiled_18" depends="jar">
+ <rake task="spec:ci_all_precompiled_18"/>
</target>
- <target name="run-specs-interpreted" depends="jar">
- <_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.8.mspec"/>
+ <target name="spec:ci_all_interpreted_18" depends="jar">
+ <rake task="spec:ci_all_interpreted_18"/>
</target>
+ <target name="spec:ci_all" depends="jar"><rake task="spec:ci_all"/></target>
+ <target name="spec:ci_latest" depends="jar"><rake task="spec:ci_latest"/></target>
- <target name="run-specs-compiled-short" depends="jar">
- <_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
- </target>
- <target name="run-specs-precompiled-short" depends="jar">
- <_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
- </target>
- <target name="run-specs-interpreted-short" depends="jar">
- <_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.8.mspec"/>
- </target>
-
- <target name="run-specs-compiled-short-1.9" depends="jar">
- <_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
- </target>
- <target name="run-specs-precompiled-short-1.9" depends="jar">
- <_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
- </target>
- <target name="run-specs-interpreted-short-1.9" depends="jar">
- <_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
- </target>
-
- <target name="run-specs-all-interpreted">
- <_run_specs_all_internal mode.name="INTERPRETED" compile.mode="OFF"/>
- </target>
- <target name="run-specs-all-precompiled">
- <_run_specs_all_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0"/>
- </target>
+ <!-- Old compatibility targets which call to newer Rake-based ones -->
+ <target name="spec" depends="spec:ci_18"/>
+ <target name="spec-ci" depends="spec:ci_18"/>
+ <target name="spec-short" depends="spec:ci_interpreted_18_19"/>
+ <target name="spec-ci-1.9" depends="spec:ci_19"/>
+ <target name="spec-short-1.9" depends="spec:ci_interpreted_19"/>
+ <target name="spec-all" depends="spec:ci_all_precompiled_18"/>
+ <target name="spec-all-interpreted" depends="spec:ci_all_interpreted_18"/>
+ <!-- latest, unstable specs -->
+ <target name="spec-latest-all" depends="spec:ci_all"/>
+ <target name="spec-latest" depends="spec:ci_latest"/>
<target name="update-excludes">
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" dir="${spec.dir}">
@@ -1141,8 +1010,7 @@
<sysproperty key="jruby.launch.inproc" value="false"/>
<arg line="${mspec.dir}/bin/mspec tag"/>
- <arg line="--add fails --fail"/>
- <arg line="-B ${spec.dir}/default.mspec"/>
+ <arg line="--add fails --fail -B ${spec.dir}/default.mspec"/>
</java>
</target>
@@ -1156,65 +1024,6 @@
<spec-show-excludes spec.mode="1.9"/>
</target>
- <macrodef name="run-specs">
- <attribute name="compile.mode" default="OFF"/>
- <attribute name="jit.threshold" default="20"/>
- <attribute name="jit.max" default="-1"/>
- <attribute name="objectspace.enabled" default="true"/>
- <attribute name="thread.pooling" default="false"/>
- <attribute name="reflection" default="false"/>
- <attribute name="mode.name"/>
- <attribute name="spec.config"/>
- <attribute name="compat" default="RUBY1_8"/>
-
- <sequential>
- <echo message="compile=@{compile.mode}, threshold=@{jit.threshold}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection} compat=@{compat}"/>
-
- <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" resultproperty="spec.status.@{mode.name}" dir="${base.dir}">
- <classpath refid="test.class.path"/>
- <jvmarg line="-ea ${run.jvm.model}"/>
-
- <sysproperty key="jruby.home" value="${basedir}"/>
- <sysproperty key="jruby.launch.inproc" value="false"/>
- <sysproperty key="emma.verbosity.level" value="silent" />
-
- <env key="JAVA_OPTS" value="-Demma.verbosity.level=silent"/>
-
- <arg line="${mspec.dir}/bin/mspec ci"/>
- <arg line="-T -J-ea"/>
- <arg line="-T -J-Djruby.launch.inproc=false"/>
- <arg line="-T -J-Djruby.compile.mode=@{compile.mode}"/>
- <arg line="-T -J-Djruby.jit.threshold=@{jit.threshold}"/>
- <arg line="-T -J-Djruby.jit.max=@{jit.max}"/>
- <arg line="-T -J-Djruby.objectspace.enabled=@{objectspace.enabled}"/>
- <arg line="-T -J-Djruby.thread.pool.enabled=@{thread.pooling}"/>
- <arg line="-T -J-Djruby.reflection=@{reflection}"/>
- <arg line="-T -J-Djruby.compat.version=@{compat}"/>
- <arg line="-T -J-Demma.coverage.out.file=${test.results.dir}/coverage.emma"/>
- <arg line="-T -J-Demma.coverage.out.merge=true"/>
- <arg line="-T -J-Demma.verbosity.level=silent" />
- <arg line="${spec.jvm.model.option}" />
- <arg line="-f m"/>
- <arg line="-B @{spec.config}"/>
- </java>
- </sequential>
- </macrodef>
-
- <macrodef name="_run_specs_internal">
- <attribute name="compile.mode" default="OFF"/>
- <attribute name="jit.threshold" default="20"/>
- <attribute name="mode.name"/>
- <attribute name="spec.config"/>
- <attribute name="compat" default="RUBY1_8"/>
-
- <sequential>
- <echo message="Excludes: ${spec.tags.dir}"/>
- <run-specs mode.name="@{mode.name}"
- compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"
- spec.config="@{spec.config}" compat="@{compat}"/>
- </sequential>
- </macrodef>
-
<macrodef name="spec-show-excludes">
<attribute name="spec.mode" default="1.8"/>
@@ -1236,16 +1045,6 @@
</sequential>
</macrodef>
- <macrodef name="_run_specs_all_internal">
- <attribute name="compile.mode" default="OFF"/>
- <attribute name="jit.threshold" default="20"/>
- <attribute name="mode.name"/>
-
- <sequential>
- <run-specs mode.name="@{mode.name}" compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"/>
- </sequential>
- </macrodef>
-
<macrodef name="fixEOLs">
<attribute name="dist-stage-dir" default="${dist.stage.bin.dir}"/>
<sequential>
@@ -1375,7 +1174,7 @@
<mkdir dir="${dist.stage.bin.dir}/lib/native"/>
<unzip-native-libs destination.dir="${dist.stage.bin.dir}/lib/native"/>
<fixEOLs dist-stage-dir="${dist.stage.bin.dir}"/>
- <run-rake rake.targets="install_dist_gems"/>
+ <rake task="install_dist_gems"/>
<tar destfile="${dist.dir}/jruby-bin-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="${dist.stage.bin.dir}" mode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
@@ -1425,7 +1224,7 @@
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
- <run-rake rake.targets="install_dist_gems"/>
+ <rake task="install_dist_gems"/>
<fixEOLs dist-stage-dir="${dist.stage.src.dir}"/>
<tar destfile="${dist.dir}/jruby-src-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="${dist.stage.src.dir}" mode="755" prefix="jruby-${version.jruby}">
@@ -1517,7 +1316,8 @@
<antcall target="clean-ng"/>
</target>
- <target name="clean-all" depends="clean, clear-specs, dist-clean" description="Cleans everything, including dist files and specs">
+ <target name="clean-all" depends="clean, dist-clean" description="Cleans everything, including dist files and specs">
+ <rake task="spec:clean_specs"/>
<delete dir="${base.dir}/build.eclipse"/>
<delete dir="${base.dir}/lib/native"/>
</target>
@@ -1560,7 +1360,7 @@
<mkdir dir="${build.dir}/nailmain"/>
</target>
- <target name="test-rails-stable" depends="init"><run-rake rake.targets="test:rails"/></target>
- <target name="test-prawn" depends="init"><run-rake rake.targets="test:prawn"/></target>
- <target name="bench-language" depends="init"><run-rake rake.targets="bench:language"/></target>
+ <target name="test-rails-stable" depends="init"><rake task="test:rails"/></target>
+ <target name="test-prawn" depends="init"><rake task="test:prawn"/></target>
+ <target name="bench-language" depends="init"><rake task="bench:language"/></target>
</project>
View
1  default.build.properties
@@ -7,6 +7,7 @@ build.dir=${base.dir}/build
dest.lib.dir=${lib.dir}
spec.dir=${base.dir}/spec
ruby18.mspec.file=${spec.dir}/jruby.1.8.mspec
+ruby19.mspec.file=${spec.dir}/jruby.1.9.mspec
rubyspec.git.repo=git://github.com/rubyspec/rubyspec.git
rubyspec.dir=${spec.dir}/ruby
rubyspec.tar.file=${build.dir}/rubyspec.tgz
View
20 rakelib/git.rake
@@ -9,18 +9,22 @@ def git_shallow_clone(label, git_repository, local_directory)
Dir.chdir(local_directory) { yield } if block_given?
end
-def git_pull(label, local_directory)
- puts "#{label} repo found: pulling repo at #{local_directory}"
+def git_simple_command(command, label, local_directory)
+ puts "#{label} repo found: `git #{command}` repo at #{local_directory}"
Dir.chdir(local_directory) do
- sh "git pull"
+ sh "git #{command}"
yield if block_given?
end
end
+def git_pull(label, local_directory)
+ git_simple_command("pull", label, local_directory)
+end
+
def git_fetch(label, local_directory)
- puts "#{label} repo found: fetching repo at #{local_directory}"
- Dir.chdir(local_directory) do
- sh "git fetch"
- yield if block_given?
- end
+ git_simple_command("fetch", label, local_directory)
+end
+
+def git_checkout(label, tag, local_directory)
+ git_simple_command("checkout #{tag}", label, local_directory)
end
View
177 rakelib/spec.rake
@@ -1,35 +1,140 @@
+# Definitions:
+# MSPEC_FILE:
+# tagged - runs specs which a MSPEC_FILE
+# all - runs specs without specifying an MSPEC_FILE
+# !all,!tagged - runs specs with an MSPEC_FILE
+# RUNTIME:
+# interpreted - -X-C (or OFF)
+# compiled - JIT w/ threshold 0
+# precompiled - AOT (or FORCE)
+# RUBYSPEC:
+# latest - grab head of rubyspecs
+# stable - get saved blessed version (see ${rubyspecs.version})
+
+# FIXME: Make Rubyspecs FAILED message appear?
+
namespace :spec do
- desc "Run the rubyspecs expected to pass (version-frozen)"
- task :ci do
- ant "spec"
- end
+ # This set of tasks will run ci and retrieve the proper version of specs.
+ # The specs below this section will run specs, but they will not retrieve
+ # the specs they run against. This is so we can run the similiar mspec
+ # runs against a stable and head version of the rubyspecs.
+
+ desc "Run rubyspecs expected to pass (version-frozen)"
+ task :ci => ['spec:fetch_stable_specs', 'spec:tagged_18']
+ task :ci_18 => :ci
+
+ desc "Run rubyspecs expected to pass (version-frozen)"
+ task :ci_19 => ['spec:fetch_stable_specs', 'spec:tagged_19']
+
+ desc "Run rubyspecs expexted to pass in interpreted mode (version-frozem)"
+ task :ci_interpreted_18 => ['spec:fetch_stable_specs', 'spec:interpreted_18']
+
+ desc "Run rubyspecs expexted to pass in interpreted mode (version-frozem)"
+ task :ci_interpreted_19 => ['spec:fetch_stable_specs', 'spec:interpreted_19']
+
+ desc "Run rubyspecs expexted to pass in interpreted mode (version-frozem)"
+ task :ci_interpreted_18_19 => ['spec:fetch_stable_specs', 'spec:interpreted_18', 'spec:interpreted_19']
+
+ desc "Run all the specs including failures (version-frozen)"
+ task :ci_all => ['spec:fetch_stable_specs', 'spec:all_18']
desc "Run all the specs including failures (version-frozen)"
- task :all do
- ant "spec-all"
+ task :ci_all_19 => ['spec:fetch_stable_specs', 'spec:all_19']
+
+ desc "Run all the specs in precompiled mode (version-frozem)"
+ task :ci_all_precompiled_18 => ['spec:fetch_stable_specs', 'spec:all_precompiled_18']
+
+ desc "Run rubyspecs expected to pass (against latest rubyspec version)"
+ task :ci_latest => ['spec:fetch_latest_specs', 'spec:tagged_18']
+
+ # Note: For this point below it is your reponsibility to make sure specs
+ # are checked out.
+
+ desc "Run 1.8 tagged specs in interpreted, JIT, and pre-compiled modes"
+ task :tagged_18 => [:interpreted_18, :compiled_18, :precompiled_18] do
+ fail "One or more Ruby spec runs have failed" if spec_run_error
+ end
+
+ desc "Run all 1.8 specs in interpreted, JIT, and pre-compiled modes"
+ task :all_18 => [:all_interpreted_18, :all_compiled_18, :all_precompiled_18] do
+ fail "One or more Ruby spec runs have failed" if spec_run_error
end
- desc "Run all 1.8 tagged specs in interpreted, JIT, and pre-compiled modes"
- task :all_tagged_1_8 => [:interpreted_tagged_1_8, :compiled_tagged_1_8,
- :precompiled_tagged_1_8]
+ desc "Run 1.9 tagged specs in interpreted, JIT, and pre-compiled modes"
+ task :tagged_19 => [:interpreted_19, :compiled_19, :precompiled_19] do
+ fail "One or more Ruby spec runs have failed" if spec_run_error
+ end
+
+ desc "Run all 1.9 specs in interpreted, JIT, and pre-compiled modes"
+ task :all_19 => [:all_interpreted_19, :all_compiled_19, :all_precompiled_19] do
+ fail "One or more Ruby spec runs have failed" if spec_run_error
+ end
desc "Tagged 1.8 specs in interpreted mode only"
- task :interpreted_tagged_1_8 do
+ task :interpreted_18 do
mspec :compile_mode => "OFF", :spec_config => RUBY18_MSPEC_FILE
end
desc "Tagged 1.8 specs in JIT mode only (threshold=0)"
- task :compiled_tagged_1_8 do
+ task :compiled_18 do
mspec :compile_mode => "JIT", :spec_config => RUBY18_MSPEC_FILE,
:jit_threshold => 0
end
desc "Tagged 1.8 specs in AOT mode only"
- task :precompiled_tagged_1_8 do
+ task :precompiled_18 do
mspec :compile_mode => "FORCE", :spec_config => RUBY18_MSPEC_FILE,
:jit_threshold => 0
end
+ desc "All 1.8 specs in interpreted mode only"
+ task :all_interpreted_18 do
+ mspec :compile_mode => "OFF"
+ end
+
+ desc "All 1.8 specs in JIT mode only (threshold=0)"
+ task :all_compiled_18 do
+ mspec :compile_mode => "JIT", :jit_threshold => 0
+ end
+
+ desc "All 1.8 specs in AOT mode only"
+ task :all_precompiled_18 do
+ mspec :compile_mode => "FORCE", :jit_threshold => 0
+ end
+
+ desc "Tagged 1.9 specs in interpreted mode only"
+ task :interpreted_19 do
+ mspec :compile_mode => "OFF", :spec_config => RUBY19_MSPEC_FILE,
+ :compat => "RUBY1_9"
+ end
+
+ desc "Tagged 1.9 specs in JIT mode only (threshold=0)"
+ task :compiled_19 do
+ mspec :compile_mode => "JIT", :spec_config => RUBY19_MSPEC_FILE,
+ :jit_threshold => 0, :compat => "RUBY1_9"
+ end
+
+ desc "Tagged 1.9 specs in AOT mode only"
+ task :precompiled_19 do
+ mspec :compile_mode => "FORCE", :spec_config => RUBY19_MSPEC_FILE,
+ :jit_threshold => 0, :compat => "RUBY1_9"
+ end
+
+ desc "All 1.9 specs in interpreted mode only"
+ task :all_interpreted_19 do
+ mspec :compile_mode => "OFF", :compat => "RUBY1_9"
+ end
+
+ desc "All 1.9 specs in JIT mode only (threshold=0)"
+ task :all_compiled_19 do
+ mspec :compile_mode => "JIT", :jit_threshold => 0, :compat => "RUBY1_9"
+ end
+
+ desc "All 1.9 specs in AOT mode only"
+ task :all_precompiled_19 do
+ mspec :compile_mode => "FORCE", :jit_threshold => 0, :compat => "RUBY1_9"
+ end
+
gem 'rspec'
require 'spec/rake/spectask'
desc "Runs Java Integration Specs"
@@ -58,12 +163,31 @@ namespace :spec do
# Complimentary tasks for running specs
- task :fetch_specs => [:install_build_gems, :fetch_latest_rubyspec_repo, :fetch_latest_mspec_repo]
+ task :fetch_latest_specs => [:install_build_gems, :fetch_latest_rubyspec_repo, :fetch_latest_mspec_repo]
+
+ task :fetch_stable_specs => :fetch_latest_specs do
+ if stable_specs_changed?
+ rubyspecs_revision = ant.properties['rubyspecs.revision']
+ mspec_revision = ant.properties['mspec.revision']
+
+ puts "Rolling rubyspec to stable version"
+ git_checkout('rubyspec', rubyspecs_revision, RUBYSPEC_DIR)
+
+ puts "Rolling mspec to stable version"
+ git_checkout('mspec', mspec_revision, MSPEC_DIR)
+
+ ant.propertyfile(:file => "#{SPEC_DIR}/rubyspecs.current.revision",
+ :comment => "Revision of downloaded specs") do
+ entry :key => "rubyspecs.current.revision", :value => rubyspecs_revision
+ entry :key => "mspec.current.revision", :value => mspec_revision
+ end
+ end
+ end
desc "Retrieve latest tagged rubyspec git repository"
task :fetch_latest_rubyspec_repo do
unless git_repo_exists? RUBYSPEC_DIR
- clear_spec_dirs
+ clean_spec_dirs
git_shallow_clone('rubyspec', RUBYSPEC_GIT_REPO, RUBYSPEC_DIR)
else
git_fetch('rubyspec', RUBYSPEC_DIR)
@@ -79,11 +203,32 @@ namespace :spec do
end
end
- def clear_spec_dirs
- # rm_rf RUBYSPEC_DIR # Note: Already done by git_shallow_clone
+ desc "Clean up spec dirs"
+ task :clean_specs do
+ clean_spec_dirs(true)
+ end
+
+ def stable_specs_changed?
+ # FIXME: Should I conditionally load there property files?
+ ant.property :file => "rubyspecs.revision"
+ ant.property :file => "${SPEC_DIR}/rubyspecs.current.revision"
+ p = ant.properties
+
+ !File.exists?(RUBYSPEC_DIR) || !File.exists?(MSPEC_DIR) ||
+ p['rubyspecs.revision'] != p['rubyspecs.current.revision'] ||
+ p['mspec.revision'] != p['mspec.current.revision']
+ end
+
+ def clean_spec_dirs(wipe_spec_dir = false)
+ rm_rf RUBYSPEC_DIR if wipe_spec_dir
rm_rf MSPEC_DIR
rm_f RUBYSPEC_TAR_FILE
rm_f MSPEC_TAR_FILE
rm_f File.join(SPEC_DIR, "rubyspecs.current.revision")
end
+
+ def spec_run_error
+ # Obtuseriffic - If any previous spec runs were non-zero return we failed
+ ['OFF', 'JIT', 'FORCE'].any? {|n| ant.properties["spec.status.#{n}"] != "0"}
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.