tests: scripts to build/run against old versions
authorDavid Schleef <ds@schleef.org>
Tue, 15 Jun 2010 01:22:14 +0000 (18:22 -0700)
committerDavid Schleef <ds@schleef.org>
Tue, 15 Jun 2010 01:24:55 +0000 (18:24 -0700)
testsuite/compatibility/build_compat_libs [new file with mode: 0755]
testsuite/compatibility/check [new file with mode: 0755]

diff --git a/testsuite/compatibility/build_compat_libs b/testsuite/compatibility/build_compat_libs
new file mode 100755 (executable)
index 0000000..ab64539
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+set -x
+
+topdir=`pwd`
+builddir=${topdir}/build
+installdir=${topdir}/install
+
+#rm -rf ${builddir} ${installdir}
+mkdir -p ${builddir}
+mkdir -p ${installdir}
+
+for version in 0.4.0 0.4.1 0.4.2 0.4.3 0.4.4 0.4.5
+do
+
+  test -f orc-${version}.tar.gz || \
+    wget http://code.entropywave.com/download/orc/orc-${version}.tar.gz
+
+  tar -xzf orc-${version}.tar.gz --directory ${builddir}
+
+  cd ${builddir}/orc-${version}
+  ./configure --prefix=${topdir}/install/${version}
+  make
+  make install
+  cd ${topdir}
+
+done
+
+rm -rf ${builddir}
+
diff --git a/testsuite/compatibility/check b/testsuite/compatibility/check
new file mode 100755 (executable)
index 0000000..462ff73
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+topdir=`pwd`
+installdir=${topdir}/install
+
+testfile=../test.orc
+#testfile=../floatparam.orc
+
+../../tools/orcc -o impl.c --implementation ${testfile}
+../../tools/orcc -o test.c --test ${testfile}
+
+echo "          compile     run"
+echo "        impl   test   test"
+for version in 0.4.0 0.4.1 0.4.2 0.4.3 0.4.4 0.4.5
+do
+  gcc -Wall -Werror -I${installdir}/${version}/include/orc-0.4/ -c -o impl.o impl.c &>/dev/null
+  res=$?
+  if [ "$res" = "0" ] ; then
+    result_impl="yes"
+  else
+    result_impl=" no"
+  fi
+
+  rm -f test
+  gcc -Wall -Werror -I${installdir}/${version}/include/orc-0.4/ -L${installdir}/${version}/lib -lorc-0.4 -lorc-test-0.4 -o test test.c &>/dev/null
+  res=$?
+  if [ "$res" = "0" ] ; then
+    result_test_compile="yes"
+  else
+    result_test_compile=" no"
+  fi
+
+  LD_LIBRARY_PATH=${installdir}/${version}/lib \
+  test -f ./test && ./test &>/dev/null
+  res=$?
+  if [ "$res" = "0" ] ; then
+    result_test_run="yes"
+  else
+    result_test_run=" no"
+  fi
+
+  echo "$version    $result_impl    $result_test_compile    $result_test_run"
+done
+
+