path: root/stress
diff options
Diffstat (limited to 'stress')
2 files changed, 81 insertions, 0 deletions
diff --git a/stress/README.txt b/stress/README.txt
new file mode 100644
index 0000000..40afeb2
--- /dev/null
+++ b/stress/README.txt
@@ -0,0 +1,13 @@
+Stress Tests for Board Stability
+This scripts are less helpful to develop LLVM, and more to make sure a
+particular platform is good enough to build LLVM on. When choosing machines
+to make buildbots or Jenkins slaves, it's important not just to get fast
+boxes, but stable and reliable.
+I've ran these scripts on a lot of different machines, local and remote and,
+providing you get all the necessary package requirements, they should be very
+independent of anything else. The kind of script you'd send to a hardware
+manufacturer so they can test their hardware before releasing (or at least
+before giving them to the toolchain team to use as builders).
diff --git a/stress/build-llvm-forever.sh b/stress/build-llvm-forever.sh
new file mode 100755
index 0000000..465a51f
--- /dev/null
+++ b/stress/build-llvm-forever.sh
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+# This script prepares and builds LLVM+Clang in a cycle
+# There are two purposes:
+# 1. Make sure the board can cope with sequential builds
+# for as long as you wish (at least 2 days non-stop)
+# 2. Make sure the builds take reasonably the same time
+# That's why the script has the following features:
+# * "set +e" to not fail even if the build fails, as a
+# subsequent commit can fix that, or even if the build
+# fails, we're still stressing the hardware, not the build
+# * `date` before each step, so that you can compare
+# multiple runs without having to find the `time` output
+# * Use -jCPUS, since we're not trying to get it faster, but
+# reliable, and that tells us more than -jCPUS+2, etc.
+# * Time builds and tests separately, since tests tend to be
+# more stable
+# * Don't use CCACHE, since that will defeat the purpose
+set +e
+CPUS=`grep -c proc /proc/cpuinfo`
+if ninja --version > /dev/null; then
+ LINK=`free -g | awk '/Mem/ {print $2}'`
+ NINJA="-G Ninja"
+mkdir -p build
+if [ ! -d src ]; then
+ git clone http://llvm.org/git/llvm.git src
+if [ ! -d src/tools/clang ]; then
+ cd src/tools
+ git clone http://llvm.org/git/clang.git
+cd $ROOT/build
+if [ ! -f Makefile ]; then
+ cmake ../src $NINJA \
+while /bin/true; do
+ echo -n "Updating sources at "
+ date
+ cd $ROOT/src
+ git fetch origin; git pull
+ cd tools/clang
+ git fetch origin; git pull
+ cd $ROOT/build
+ echo -n "Cleaning at "
+ date
+ make -j$CPUS clean
+ echo -n "Building at "
+ date
+ make -j$CPUS
+ echo -n "Testing at "
+ date
+ make -j$CPUS check-all