aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-08-15 18:16:37 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-08-15 18:16:37 -0700
commitea6f1cebc098aef798cfdb9dbd0097875b0a5aae (patch)
treee9e658e705b7bc746edea905e2f405974e525cce /tests/runner.py
parent10cfcfa316a13b94ac7cc1966809e01adafc5f45 (diff)
allow generateStructInfo to work at runtime with structMetadata
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 109bf42f..14493612 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -3164,6 +3164,8 @@ if 'benchmark' not in sys.argv:
# Way 2: use CppHeaderParser
+ global RUNTIME_TYPE_INFO; RUNTIME_TYPE_INFO = 1
+
header = '''
#include <stdio.h>
@@ -3339,13 +3341,16 @@ Child2:9
print('|' + Runtime.typeInfo.UserStruct.fields + '|' + Runtime.typeInfo.UserStruct.flatIndexes + '|');
var t = Runtime.generateStructInfo(['x', { us: ['x', 'y', 'z'] }, 'y'], 'Encloser')
print('|' + [t.x, t.us.x, t.us.y, t.us.z, t.y] + '|');
+ print('|' + JSON.stringify(Runtime.generateStructInfo(null, 'UserStruct')) + '|');
} else {
print('No type info.');
}
'''
)
open(filename, 'w').write(src)
- self.do_test(src, '*ok:5*\n|i32,i8,i16|0,4,6|\n|0,4,8,10,12|', post_build=post)
+ self.do_test(src,
+ '*ok:5*\n|i32,i8,i16|0,4,6|\n|0,4,8,10,12|\n|{"__size__":8,"x":0,"y":4,"z":6}|',
+ post_build=post)
# Make sure that without the setting, we don't spam the .js with the type info
RUNTIME_TYPE_INFO = 0