aboutsummaryrefslogtreecommitdiffstats
path: root/test.sh
blob: 41d867a4261b8e1b989b62063876b5cba98eb8cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e

# Alpine Wall test script
# Copyright (C) 2012-2017 Kaarle Ritvanen
# See LICENSE file for license details


cd "$(dirname "$0")"

export LUA_PATH="./?.lua;;"
LUA=lua${LUA_VERSION}

for cls in mandatory optional private; do
    eval "export AWALL_PATH_$(echo $cls | tr a-z A-Z)=test/$cls"
    mkdir -p test/$cls
    for script in test/$cls/*.lua; do
        [ -f "$script" ] && $LUA "$script" > "${script%.lua}.json"
    done
done

exec $LUA ./awall-cli ${1:-diff} -o test/output