summaryrefslogtreecommitdiff
path: root/bin/tests
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-02-25 09:31:47 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-02-25 09:31:47 -0300
commitb2ce682f6ed9493423be257a5b2e87126692a94f (patch)
tree705a351239b0f87c0e7166c5948716a054ca98d8 /bin/tests
parent06e358199f0c038e781753001d9292349f2040ad (diff)
-scripts are converted to bytecode on export
-fix bug in doc where touchscreen events were not documented
Diffstat (limited to 'bin/tests')
-rw-r--r--bin/tests/test_gdscript.cpp10
-rw-r--r--bin/tests/test_gdscript.h3
-rw-r--r--bin/tests/test_main.cpp5
3 files changed, 16 insertions, 2 deletions
diff --git a/bin/tests/test_gdscript.cpp b/bin/tests/test_gdscript.cpp
index 847be39fb4..9670e6af6e 100644
--- a/bin/tests/test_gdscript.cpp
+++ b/bin/tests/test_gdscript.cpp
@@ -864,7 +864,7 @@ MainLoop* test(TestType p_test) {
if (p_test==TEST_TOKENIZER) {
- GDTokenizer tk;
+ GDTokenizerText tk;
tk.set_code(code);
int line=-1;
while(tk.get_token()!=GDTokenizer::TK_EOF) {
@@ -969,8 +969,16 @@ MainLoop* test(TestType p_test) {
+ } else if (p_test==TEST_BYTECODE) {
+
+ Vector<uint8_t> buf = GDTokenizerBuffer::parse_code_string(code);
+ String dst = test.basename()+".gdc";
+ FileAccess *fw = FileAccess::open(dst,FileAccess::WRITE);
+ fw->store_buffer(buf.ptr(),buf.size());
+ memdelete(fw);
}
+
#if 0
Parser parser;
Error err = parser.parse(code);
diff --git a/bin/tests/test_gdscript.h b/bin/tests/test_gdscript.h
index c3869abb8e..1659880c2a 100644
--- a/bin/tests/test_gdscript.h
+++ b/bin/tests/test_gdscript.h
@@ -36,7 +36,8 @@ namespace TestGDScript {
enum TestType {
TEST_TOKENIZER,
TEST_PARSER,
- TEST_COMPILER
+ TEST_COMPILER,
+ TEST_BYTECODE,
};
MainLoop* test(TestType p_type);
diff --git a/bin/tests/test_main.cpp b/bin/tests/test_main.cpp
index eb63a7af84..5d66f35f24 100644
--- a/bin/tests/test_main.cpp
+++ b/bin/tests/test_main.cpp
@@ -152,6 +152,11 @@ MainLoop* test_main(String p_test,const List<String>& p_args) {
return TestGDScript::test(TestGDScript::TEST_COMPILER);
}
+ if (p_test=="gd_bytecode") {
+
+ return TestGDScript::test(TestGDScript::TEST_BYTECODE);
+ }
+
if (p_test=="image") {
return TestImage::test();