summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-06 16:02:26 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-09 11:03:08 -0800
commit960f9848897f2511a08d2a5908078a348dfb1716 (patch)
treee0ff67a77bd172f0c199394567d089377a6da91f /tools
parent5483861d2e37e3045c7f4966d51f9fb27ef020dd (diff)
downloadscala-960f9848897f2511a08d2a5908078a348dfb1716.tar.gz
scala-960f9848897f2511a08d2a5908078a348dfb1716.tar.bz2
scala-960f9848897f2511a08d2a5908078a348dfb1716.zip
Bring some sanity to the stability test.
There is no reason to be stability testing every piece of bytecode we've ever encountered. If the compilation products are unstable, then testing 20,000 classfiles will reveal it. Or it won't; either way, we can stop there. So I cut a gordian knot and focused the stability test solely on the contents of: library reflect compiler Next I cut the "custom ant task" cord. There's a tool for diffing files, it's decades old, it's called diff. It does the entire job we need. If it doesn't work on windows, it doesn't matter. The stability test is not something which needs to run in every environment. Either the classfiles are stable or they aren't. Generated the ant xml for building quick.{lib,reflect,comp} and strap.{lib,reflect,comp} so they are identical modulo the compiler used to build them, probably for the first time ever. I'm sure they won't stay that way, but it's a step.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/stability-test.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/stability-test.sh b/tools/stability-test.sh
new file mode 100755
index 0000000000..f017ac0842
--- /dev/null
+++ b/tools/stability-test.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+#
+
+declare failed
+
+echo "Comparing build/quick/classes and build/strap/classes"
+for dir in library reflect compiler; do
+ # feel free to replace by a more elegant approach -- don't know how
+ if diff -rw -x '*.css' \
+ -x '*.custom' \
+ -x '*.gif' \
+ -x '*.js' \
+ -x '*.layout' \
+ -x '*.png' \
+ -x '*.properties' \
+ -x '*.tmpl' \
+ -x '*.tooltip' \
+ -x '*.txt' \
+ -x '*.xml' \
+ build/{quick,strap}/classes/$dir
+ then
+ classes=$(find build/quick/classes/$dir -name '*.class' | wc -l)
+ printf "%8s: %5d classfiles verified identical\n" $dir $classes
+ else
+ failed=true
+ fi
+done
+
+[[ -z $failed ]] || exit 127