diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2673b40..ba289fec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,6 +25,7 @@ on: env: LUA_VERSION: 5.4.7 LUAROCKS_VERSION: 3.9.0 + PT_VERSION: 0.5.0a jobs: lint: @@ -79,7 +80,7 @@ jobs: - name: Install Pallene Tracer run: | - git clone https://github.com/pallene-lang/pallene-tracer + git clone --depth 1 https://github.com/pallene-lang/pallene-tracer --branch ${{env.PT_VERSION}} cd pallene-tracer make LUA_PREFIX=/usr/local sudo make install diff --git a/spec/traceback_spec.lua b/spec/traceback_spec.lua index f0ce4366..316e66ef 100644 --- a/spec/traceback_spec.lua +++ b/spec/traceback_spec.lua @@ -19,25 +19,26 @@ local function assert_test(test, expected_traceback) end local luafile = util.shell_quote("spec/traceback/"..test.."/main.lua") - local ok, _, output_content, err_content = util.outputs_of_execute("pt-run "..luafile) + local ok, _, output_content, err_content = util.outputs_of_execute("pt-lua "..luafile) assert(not ok, output_content) assert.are.same(expected_traceback, err_content) end it("Rectangle", function() assert_test("rect", [[ -Runtime error: spec/traceback/rect/main.lua:8: file spec/traceback/rect/rect.pln: line 10: wrong type for downcasted value, expected float but found string -Stack traceback: +pt-lua: spec/traceback/rect/main.lua:8: file spec/traceback/rect/rect.pln: line 10: wrong type for downcasted value, expected float but found string +stack traceback: spec/traceback/rect/rect.pln:10: in function 'universal_calc_area' spec/traceback/rect/rect.pln:13: in function 'area' spec/traceback/rect/main.lua:8: in
+ C: in function '' ]]) end) it("Multi-module Lua", function() assert_test("module_lua", [[ -Runtime error: spec/traceback/module_lua/main.lua:25: Any normal error from Lua! -Stack traceback: +pt-lua: spec/traceback/module_lua/main.lua:25: Any normal error from Lua! +stack traceback: C: in function 'error' spec/traceback/module_lua/main.lua:25: in function 'lua_3' spec/traceback/module_lua/module_lua.pln:12: in function 'pallene_2' @@ -46,26 +47,28 @@ Stack traceback: spec/traceback/module_lua/main.lua:12: in function 'callback' ./spec/traceback/module_lua/another_module.lua:7: in function 'call_lua_callback' spec/traceback/module_lua/main.lua:28: in
+ C: in function '' ]]) end) it("Multi-module Pallene", function() assert_test("module_pallene", [[ -Runtime error: spec/traceback/module_pallene/main.lua:11: There's an error in everyday life. Alas! -Stack traceback: +pt-lua: spec/traceback/module_pallene/main.lua:11: There's an error in everyday life. Alas! +stack traceback: C: in function 'error' spec/traceback/module_pallene/main.lua:11: in function 'lua_2' spec/traceback/module_pallene/module_pallene_alt.pln:8: in function 'alternate_everyday_fn' spec/traceback/module_pallene/main.lua:16: in function 'lua_1' spec/traceback/module_pallene/module_pallene.pln:8: in function 'normal_everyday_fn' spec/traceback/module_pallene/main.lua:19: in
+ C: in function '' ]]) end) it("Depth recursion", function() assert_test("depth_recursion", [[ -Runtime error: spec/traceback/depth_recursion/main.lua:11: Depth reached 0! -Stack traceback: +pt-lua: spec/traceback/depth_recursion/main.lua:11: Depth reached 0! +stack traceback: C: in function 'error' spec/traceback/depth_recursion/main.lua:11: in function 'lua_fn' spec/traceback/depth_recursion/depth_recursion.pln:8: in function 'pallene_fn' @@ -79,13 +82,14 @@ Stack traceback: spec/traceback/depth_recursion/depth_recursion.pln:8: in function 'pallene_fn' spec/traceback/depth_recursion/main.lua:14: in function 'lua_fn' spec/traceback/depth_recursion/main.lua:17: in
+ C: in function '' ]]) end) it("Stack overflow", function() assert_test("stack_overflow", [[ -Runtime error: C stack overflow -Stack traceback: +pt-lua: C stack overflow +stack traceback: spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' spec/traceback/stack_overflow/main.lua:10: in function 'please_dont_overflow' spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' @@ -97,9 +101,8 @@ Stack traceback: spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' spec/traceback/stack_overflow/main.lua:10: in function 'please_dont_overflow' - ... (Skipped 380 frames) ... + ... (Skipped 379 frames) ... - spec/traceback/stack_overflow/main.lua:10: in function 'please_dont_overflow' spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' spec/traceback/stack_overflow/main.lua:10: in function 'please_dont_overflow' spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' @@ -109,16 +112,18 @@ Stack traceback: spec/traceback/stack_overflow/stack_overflow.pln:8: in function 'no_overflow' spec/traceback/stack_overflow/main.lua:10: in function 'please_dont_overflow' spec/traceback/stack_overflow/main.lua:13: in
+ C: in function '' ]]) end) it("Anonymous lua functions", function() assert_test("anon_lua", [[ -Runtime error: spec/traceback/anon_lua/main.lua:9: Error from an anonymous Lua fn! -Stack traceback: +pt-lua: spec/traceback/anon_lua/main.lua:9: Error from an anonymous Lua fn! +stack traceback: C: in function 'error' spec/traceback/anon_lua/main.lua:9: in function '' spec/traceback/anon_lua/anon_lua.pln:8: in function 'call_anon_lua_fn' spec/traceback/anon_lua/main.lua:8: in
+ C: in function '' ]]) end)