diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-10-15 10:24:35 +0200 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2015-10-15 10:24:35 +0200 |
commit | 1d3167b0da37a294298f570500901724fa72be06 (patch) | |
tree | 7de8d5d81f90061b8c3e3853ba1dd428836286b6 | |
parent | e2f833928d3784726a04cbaf1e2ea754f5635fe9 (diff) | |
download | supple-1d3167b0da37a294298f570500901724fa72be06.tar.gz |
Support debugging the simple example a bit more, and ensure we hit ram limits
-rw-r--r-- | example/simple-example.lua | 10 |
1 files 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 |