summaryrefslogtreecommitdiff
path: root/bindisttest/checkBinaries.sh
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-12-10 16:12:18 +0000
committerIan Lynagh <igloo@earth.li>2010-12-10 16:12:18 +0000
commit8224f948f403886d76b98b1c91924485c9318388 (patch)
tree28863e30b7b97fd92bf1e4ac7ddd282d7815dd63 /bindisttest/checkBinaries.sh
parent7836349556deef66f1b1d06fe8e9c7c0b841f0d0 (diff)
downloadhaskell-8224f948f403886d76b98b1c91924485c9318388.tar.gz
Add a test that all programs in the bindist were built with the right GHC
They should use the GHC from the build tree, not the bootstrapping compiler.
Diffstat (limited to 'bindisttest/checkBinaries.sh')
-rw-r--r--bindisttest/checkBinaries.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/bindisttest/checkBinaries.sh b/bindisttest/checkBinaries.sh
new file mode 100644
index 0000000000..3c62198311
--- /dev/null
+++ b/bindisttest/checkBinaries.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+echo "1 is $1 done"
+EXPECTED_VERSION="$1"
+
+# Our shared libraries are currently executable (is that a bug?), so
+# we exclude anything that looks like a shared library
+for f in `find bindisttest/a/b/c -type f -executable ! -name '*.so' ! -name '*.dynlib' ! -name '*.dll'`
+do
+ if grep -q '("GHC RTS", "YES")' "$f"
+ then
+ # Looks like a GHC executable. Is it for the right version?
+ THIS_VERSION=`./$f +RTS --info | grep '"GHC version"' | sed -e 's/^ ,("GHC version", "//' -e 's/")$//'`
+ if [ "$THIS_VERSION" != "$EXPECTED_VERSION" ]
+ then
+ echo "Bad GHC version '$THIS_VERSION' for '$f'" >&2
+ exit 1
+ fi
+ fi
+done