From 760db1bf7beac29f6fbf124e76d3eb630b544ce7 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sun, 22 Sep 2019 09:57:50 -0700 Subject: attempt to run openresty perl tests --- .github/workflows/test.yml | 14 +++++++++++++- tests/TestLua.pm | 5 +++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c0fd8ee..4c3f64c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,10 +27,22 @@ jobs: - uses: leafo/gh-actions-luarocks@v2 - - name: test + - name: runtests.sh run: | LUA_DIR=.lua ${{ matrix.runtestEnv }} ./runtests.sh PREFIX=.lua ${{ matrix.runtestArgs }} + - name: setup prove + run: | + make PREFIX=.lua ${{ matrix.runtestArgs }} + sudo apt-get install valgrind libipc-run3-perl cppcheck cpanminus + sudo cpanm --notest Test::Base Test::LongString + + - name: prove + run: LUA_BIN=lua prove -Itests tests + + - name: prove (valgrind) + run: LUA_BIN=lua TEST_LUA_USE_VALGRIND=1 prove -Itests tests + - name: build run: | luarocks make diff --git a/tests/TestLua.pm b/tests/TestLua.pm index 64372ad..e13bfd3 100644 --- a/tests/TestLua.pm +++ b/tests/TestLua.pm @@ -32,12 +32,13 @@ sub run_test ($) { my ($res, $err); my @cmd; + my $lua_bin = $ENV{LUA_BIN} || "luajit"; if ($ENV{TEST_LUA_USE_VALGRIND}) { warn "$name\n"; - @cmd = ('valgrind', '-q', '--leak-check=full', 'luajit', 'test_case.lua'); + @cmd = ('valgrind', '-q', '--leak-check=full', $lua_bin, 'test_case.lua'); } else { - @cmd = ('luajit', 'test_case.lua'); + @cmd = ($lua_bin, 'test_case.lua'); } run3 \@cmd, undef, \$res, \$err; -- cgit v1.2.3-55-g6feb