aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrubo77 <github@r.z11.de>2017-07-02 14:08:10 +0200
committerrubo77 <github@r.z11.de>2017-07-02 14:09:21 +0200
commitba42471699b94240d0bbbb5abcd981cfe4ed4a2b (patch)
tree31d909aad2beb9b4d36cd6261f12a46137f65e47 /tests
parenta49664483aa282a19b7ecfd0526fff07c4ca247f (diff)
Tracis-CI check auf Validit├Ąt der site.conf
Diffstat (limited to 'tests')
-rw-r--r--tests/site_config.lua9
-rw-r--r--tests/validate_site.sh6
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/site_config.lua b/tests/site_config.lua
new file mode 100644
index 0000000..d7bdc1f
--- /dev/null
+++ b/tests/site_config.lua
@@ -0,0 +1,9 @@
+local config = os.getenv('GLUON_SITEDIR')
+
+local function loader()
+ coroutine.yield('return ')
+ coroutine.yield(io.open(config .. '/site.conf'):read('*a'))
+end
+
+-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
+return setfenv(assert(load(coroutine.wrap(loader), 'site.conf')), {})()
diff --git a/tests/validate_site.sh b/tests/validate_site.sh
new file mode 100644
index 0000000..34a4a3f
--- /dev/null
+++ b/tests/validate_site.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+# validate_site.sh checks if the site.conf is valid json
+
+GLUON_SITEDIR="." lua5.1 tests/site_config.lua
+