aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-19 18:39:03 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-19 18:40:56 -0700
commit759cfa2ee92cef2834d6cbf95bf69eef0bbe02b1 (patch)
tree334b116242de5814d738567b8886da32f7653507
parent635420dac1eae4970a506ab8805500d73f6266a2 (diff)
move lua binarytree args handling into lua script
-rw-r--r--tests/lua/binarytrees.lua17
-rwxr-xr-xtests/runner.py16
2 files changed, 17 insertions, 16 deletions
diff --git a/tests/lua/binarytrees.lua b/tests/lua/binarytrees.lua
index 2ae3dd69..58c0ce87 100644
--- a/tests/lua/binarytrees.lua
+++ b/tests/lua/binarytrees.lua
@@ -21,7 +21,22 @@ local function ItemCheck(tree)
end
end
-local N = tonumber(arg and arg[1]) or 0
+local N = tonumber(arg and arg[1]) or 4
+
+if N == 0 then
+ N = 0
+elseif N == 1 then
+ N = 9.5
+elseif N == 2 then
+ N = 11.99
+elseif N == 3 then
+ N = 12.85
+elseif N == 4 then
+ N = 14.72
+elseif N == 5 then
+ N = 15.82
+end
+
local mindepth = 4
local maxdepth = mindepth + 2
if maxdepth < N then maxdepth = N end
diff --git a/tests/runner.py b/tests/runner.py
index 610a39f6..8f084abf 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -13661,21 +13661,7 @@ elif 'benchmark' in str(sys.argv):
def test_zzz_lua_binarytrees(self):
# js version: ['binarytrees.lua', {0: 0, 1: 9.5, 2: 11.99, 3: 12.85, 4: 14.72, 5: 15.82}[arguments[0]]]
- def args_processor(args):
- arg = int(DEFAULT_ARG)
- if arg == 0:
- return args + ['0']
- elif arg == 1:
- return args + ['9.5']
- elif arg == 2:
- return args + ['11.99']
- elif arg == 3:
- return args + ['12.85']
- elif arg == 4:
- return args + ['14.72']
- elif arg == 5:
- return args + ['15.82']
- self.lua('binarytrees', 'long lived tree of depth', args_processor=args_processor)
+ self.lua('binarytrees', 'long lived tree of depth')
def test_zzz_zlib(self):
src = open(path_from_root('tests', 'zlib', 'benchmark.c'), 'r').read()