diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/tests/test_gdscript.cpp | 5 | ||||
-rw-r--r-- | main/tests/test_image.cpp | 69 | ||||
-rw-r--r-- | main/tests/test_image.h | 45 | ||||
-rw-r--r-- | main/tests/test_main.cpp | 8 | ||||
-rw-r--r-- | main/tests/test_math.cpp | 2 | ||||
-rw-r--r-- | main/tests/test_shader_lang.cpp | 4 |
6 files changed, 8 insertions, 125 deletions
diff --git a/main/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 60f9568fbd..27ff2addf3 100644 --- a/main/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -911,11 +911,14 @@ MainLoop *test(TestType p_type) { List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); if (cmdlargs.empty()) { - //try editor! return NULL; } String test = cmdlargs.back()->get(); + if (!test.ends_with(".gd") && !test.ends_with(".gdc")) { + print_line("This test expects a path to a GDScript file as its last parameter. Got: " + test); + return NULL; + } FileAccess *fa = FileAccess::open(test, FileAccess::READ); diff --git a/main/tests/test_image.cpp b/main/tests/test_image.cpp deleted file mode 100644 index ee4f43bae0..0000000000 --- a/main/tests/test_image.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************/ -/* test_image.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "test_image.h" - -#include "core/io/image_loader.h" -#include "core/math/math_funcs.h" -#include "core/os/main_loop.h" -#include "core/print_string.h" - -namespace TestImage { - -class TestMainLoop : public MainLoop { - - bool quit; - -public: - virtual void input_event(const Ref<InputEvent> &p_event) { - } - - virtual void init() { - - quit = false; - } - virtual bool iteration(float p_time) { - - return quit; - } - - virtual bool idle(float p_time) { - return quit; - } - - virtual void finish() { - } -}; - -MainLoop *test() { - - return memnew(TestMainLoop); -} -} // namespace TestImage diff --git a/main/tests/test_image.h b/main/tests/test_image.h deleted file mode 100644 index b9b3c0cb48..0000000000 --- a/main/tests/test_image.h +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************/ -/* test_image.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#ifndef TEST_IMAGE_H -#define TEST_IMAGE_H - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - -#include "core/os/main_loop.h" - -namespace TestImage { - -MainLoop *test(); -} - -#endif diff --git a/main/tests/test_main.cpp b/main/tests/test_main.cpp index 49f5cc5a18..22f1d7319f 100644 --- a/main/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -36,7 +36,6 @@ #include "test_astar.h" #include "test_gdscript.h" #include "test_gui.h" -#include "test_image.h" #include "test_math.h" #include "test_oa_hash_map.h" #include "test_ordered_hash_map.h" @@ -61,7 +60,6 @@ const char **tests_get_names() { "gd_parser", "gd_compiler", "gd_bytecode", - "image", "ordered_hash_map", "astar", NULL @@ -134,11 +132,6 @@ MainLoop *test_main(String p_test, const List<String> &p_args) { return TestGDScript::test(TestGDScript::TEST_BYTECODE); } - if (p_test == "image") { - - return TestImage::test(); - } - if (p_test == "ordered_hash_map") { return TestOrderedHashMap::test(); @@ -149,6 +142,7 @@ MainLoop *test_main(String p_test, const List<String> &p_args) { return TestAStar::test(); } + print_line("Unknown test: " + p_test); return NULL; } diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp index a082abcaba..f341159079 100644 --- a/main/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -30,9 +30,9 @@ #include "test_math.h" +#include "core/math/basis.h" #include "core/math/camera_matrix.h" #include "core/math/math_funcs.h" -#include "core/math/matrix3.h" #include "core/math/transform.h" #include "core/os/file_access.h" #include "core/os/keyboard.h" diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index ebaf7fd602..8441748cc0 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -110,7 +110,7 @@ static String dump_node_code(SL::Node *p_node, int p_level) { for (Map<StringName, SL::ShaderNode::Uniform>::Element *E = pnode->uniforms.front(); E; E = E->next()) { String ucode = "uniform "; - ucode += _prestr(E->get().precission); + ucode += _prestr(E->get().precision); ucode += _typestr(E->get().type); ucode += " " + String(E->key()); @@ -137,7 +137,7 @@ static String dump_node_code(SL::Node *p_node, int p_level) { for (Map<StringName, SL::ShaderNode::Varying>::Element *E = pnode->varyings.front(); E; E = E->next()) { String vcode = "varying "; - vcode += _prestr(E->get().precission); + vcode += _prestr(E->get().precision); vcode += _typestr(E->get().type); vcode += " " + String(E->key()); |