diff options
author | leaf corcoran <leafot@gmail.com> | 2019-09-22 09:57:50 -0700 |
---|---|---|
committer | leaf <leafot@gmail.com> | 2020-04-25 14:24:18 -0700 |
commit | 760db1bf7beac29f6fbf124e76d3eb630b544ce7 (patch) | |
tree | 3cf35d1fa97ab09a3bd36ef628a1b5656fe260ee | |
parent | 206cb297178ff46b4c5e5de38744cd648dac4f22 (diff) | |
download | lua-cjson-760db1bf7beac29f6fbf124e76d3eb630b544ce7.tar.gz lua-cjson-760db1bf7beac29f6fbf124e76d3eb630b544ce7.tar.bz2 lua-cjson-760db1bf7beac29f6fbf124e76d3eb630b544ce7.zip |
attempt to run openresty perl tests
-rw-r--r-- | .github/workflows/test.yml | 14 | ||||
-rw-r--r-- | 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: | |||
27 | 27 | ||
28 | - uses: leafo/gh-actions-luarocks@v2 | 28 | - uses: leafo/gh-actions-luarocks@v2 |
29 | 29 | ||
30 | - name: test | 30 | - name: runtests.sh |
31 | run: | | 31 | run: | |
32 | LUA_DIR=.lua ${{ matrix.runtestEnv }} ./runtests.sh PREFIX=.lua ${{ matrix.runtestArgs }} | 32 | LUA_DIR=.lua ${{ matrix.runtestEnv }} ./runtests.sh PREFIX=.lua ${{ matrix.runtestArgs }} |
33 | 33 | ||
34 | - name: setup prove | ||
35 | run: | | ||
36 | make PREFIX=.lua ${{ matrix.runtestArgs }} | ||
37 | sudo apt-get install valgrind libipc-run3-perl cppcheck cpanminus | ||
38 | sudo cpanm --notest Test::Base Test::LongString | ||
39 | |||
40 | - name: prove | ||
41 | run: LUA_BIN=lua prove -Itests tests | ||
42 | |||
43 | - name: prove (valgrind) | ||
44 | run: LUA_BIN=lua TEST_LUA_USE_VALGRIND=1 prove -Itests tests | ||
45 | |||
34 | - name: build | 46 | - name: build |
35 | run: | | 47 | run: | |
36 | luarocks make | 48 | 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 ($) { | |||
32 | my ($res, $err); | 32 | my ($res, $err); |
33 | 33 | ||
34 | my @cmd; | 34 | my @cmd; |
35 | my $lua_bin = $ENV{LUA_BIN} || "luajit"; | ||
35 | 36 | ||
36 | if ($ENV{TEST_LUA_USE_VALGRIND}) { | 37 | if ($ENV{TEST_LUA_USE_VALGRIND}) { |
37 | warn "$name\n"; | 38 | warn "$name\n"; |
38 | @cmd = ('valgrind', '-q', '--leak-check=full', 'luajit', 'test_case.lua'); | 39 | @cmd = ('valgrind', '-q', '--leak-check=full', $lua_bin, 'test_case.lua'); |
39 | } else { | 40 | } else { |
40 | @cmd = ('luajit', 'test_case.lua'); | 41 | @cmd = ($lua_bin, 'test_case.lua'); |
41 | } | 42 | } |
42 | 43 | ||
43 | run3 \@cmd, undef, \$res, \$err; | 44 | run3 \@cmd, undef, \$res, \$err; |