From 1d3167b0da37a294298f570500901724fa72be06 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 15 Oct 2015 10:24:35 +0200 Subject: Support debugging the simple example a bit more, and ensure we hit ram limits --- example/simple-example.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/example/simple-example.lua b/example/simple-example.lua index 6f35400..c80564c 100644 --- a/example/simple-example.lua +++ b/example/simple-example.lua @@ -10,6 +10,7 @@ -- supple = require'supple' +luxio = require'luxio' -- Code string to run in the untrusted environment subcode = [[ @@ -121,7 +122,7 @@ lprint_fail(supple.host.run(errsrc, "@error-code", loopback)) local long_run = [[ local s = "" - for i = 1, 10000 do + for i = 1, 100000 do s = s .. "FISHFISHFISHFISHFISH" end return #s @@ -209,7 +210,12 @@ local update_code = [[ ]] for i = 1, 1000 do - lprint_ok(supple.host.run(update_code, "@update-hook", "REPO", updates)) + supple.track.start() + local ok, res = pcall(supple.host.run, update_code, "@update-hook", "REPO", updates) + if not ok then print(res) print(supple.track.stop()) end + lprint_ok(ok) + lprint_ok(res) + supple.track.stop() if passed ~= tests then os.exit(1) end -- cgit v1.2.1