summaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/tutorial/make_example.sh
diff options
context:
space:
mode:
Diffstat (limited to 'vespalib/src/tests/tutorial/make_example.sh')
-rwxr-xr-xvespalib/src/tests/tutorial/make_example.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/vespalib/src/tests/tutorial/make_example.sh b/vespalib/src/tests/tutorial/make_example.sh
new file mode 100755
index 00000000000..9b015c93e2b
--- /dev/null
+++ b/vespalib/src/tests/tutorial/make_example.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+dirname=`dirname $1`
+filename=`basename $1`
+unset MAKELEVEL
+unset MAKEFLAGS
+unset VALGRIND
+unset TEST_SUBSET
+
+echo "<div class=\"example\" id=\"$dirname\">"
+echo "<h2>$filename</h2>"
+echo "<pre class=\"prettyprint linenums\">"
+(cd $dirname && cat $filename) | ./vespalib_xml_escape_app
+echo "</pre>"
+echo "<pre class=\"output\">"
+(cd $dirname && make all > /dev/null 2>&1)
+(cd $dirname && make test 2>&1) | ./vespalib_xml_escape_app
+echo "</pre>"
+echo "</div>"