Commit Graph

99 Commits

Author SHA1 Message Date
Yuri Sizov 6320a0fc18 Add ThemeDB, expose previously static Theme methods 2022-08-26 19:23:05 +03:00
Hendrik Brucker 36061c5dca Vector4/Vector4i: Add missing methods, tests and fix change of sign operator 2022-08-07 12:25:05 +02:00
jtorre39 667faa68e9 Add unit tests for all public methods in the SpriteFrames class 2022-08-04 14:27:14 +02:00
Rémi Verschelde 426240f18a
Merge pull request #50907 from codepatzer/quaternion_ut 2022-08-04 14:26:46 +02:00
Rémi Verschelde 29afda3fd5
Merge pull request #60736 from StrawbDev/audio-stream-sample-unit-test 2022-08-04 13:56:53 +02:00
codepatzer d0cb0ff248 Add tests file for Quaternion unit tests, with initial UTs
- Test constructors and quaternion product.
- Add test case for Axis-Angle construction about Y-axis.
- Add test case for xform of i-, j-, & k-unit vectors.
- Add test case for construction from Basis.
- Add test case for xform of arbitrary vector.
- Add stress test case: many Quaternions xform many vectors.
- Make comments consistent with style guide.
2022-08-04 13:56:04 +02:00
StrawbDev 3c252d5c6d Add test cases for AudioStreamWAV 2022-08-04 13:24:33 +02:00
Timon Bestebreur 997f18f686 Add Unit Tests for InputEventKey 2022-08-04 12:59:13 +02:00
Rémi Verschelde 255e0770c4
Merge pull request #54325 from skimmedsquare/test-add-rid 2022-08-04 12:51:53 +02:00
Timon Bestebreur 92b392e3db Add unit tests for Shortcut
Next to that, add entry for the test file in test_main.cpp.

These test cases test the basic functionality of the shortcut module.
2022-08-04 12:18:36 +02:00
Sean Kim 4706b975b6 Add unit tests for RID class. 2022-08-04 12:05:25 +02:00
Fabian Keller f242f9c738 Fix consistency of translated/scaled/rotated in Transform2D and Transform3D 2022-08-02 23:38:14 +02:00
Juan Linietsky 0dd65378e7 Add support for command-line user arguments.
Implements the standard Unix double dash (--) commandline argument:
* Arguments after a double dash (--) are ignored by Godot and stored for the user.
* User can access them via `OS.get_cmdline_user_args()`

Example:

`godot.exe scene_to_run.tscn --fullscreen -- --start-level 2`
2022-08-01 00:56:59 +02:00
Hugo Locurcio 208435fb90
Add a test suite for OS 2022-07-29 01:55:43 +02:00
Hugo Locurcio 4b42379c8f
Rename RenderingServer global shader uniform methods to be more explicit
The `global_shader_uniform` name is longer, but it makes it much
easier to find the methods when searching in the class reference.
2022-07-28 18:46:59 +02:00
reduz 67a260d63f Implement a Worker ThreadPool
This PR implements a worked thread pool. It uses a fixed amount of threads in a pool and allows scheduling tasks
that can be run on threads (and then waited for). It satisfies the following use cases:

* HTML5 thread count is fixed (and similar restrictions are known in consoles) so we need to reuse threads.
* Thread spawning is slow in general, so reusing threads is faster anyway.
* This implementation supports recursive waiting for tasks, making it less prone to deadlocks if threads from the pool also run tasks.

After this is approved and merged, subsequent PRs will be needed to replace the ThreadWorkPool usage by this class.
2022-07-22 11:46:48 +02:00
cabinboy1031 7730001390 Implemented tests for Plane getters and setters.
Added tests for intersection and plane-point methods.
2022-07-05 12:55:05 +02:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
reduz 8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Rémi Verschelde 5c52b30471
Merge pull request #60529 from timothyqiu/theme-validation 2022-05-02 10:49:14 +02:00
Aaron Franke 0ae00a07d6
Rename variable names for some singletons 2022-04-26 22:53:50 -05:00
Rémi Verschelde e9e2aaf812
Merge pull request #60513 from Calinou/default-font-add-msdf-mipmap
Add MSDF and mipmap generation project settings for the default font
2022-04-26 22:39:55 +02:00
Haoyu Qiu d8c04cda3a Validate theme type/item names 2022-04-26 19:54:43 +08:00
Hugo Locurcio 43c34bf611
Add MSDF and mipmap generation project settings for the default font
This can be used to improve Label3D and scaled Control appearance
in prototypes.
2022-04-25 16:47:44 +02:00
Paulb23 c1d445f1e5 Add inital TextEdit UnitTests 2022-04-22 21:09:48 +01:00
Paulb23 5e4e4967fe Use Input::push_input for tests plus extra mouse testing 2022-04-22 17:39:12 +01:00
Rémi Verschelde c99a1af0fb Remove unused legacy tests
They haven't been updated for years and still use the old MainLoop
basic framework instead of the new doctest one.

They're of dubious quality and best redone from scratch using the
new framework.
2022-04-07 00:38:44 +02:00
bruvzg 29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Hugo Locurcio a6e8cdae66
Add a unit test suite for Animation 2022-02-06 21:33:22 +01:00
Rémi Verschelde 5f56d385b0
Core: Move Rect2i to its own `rect2i.h` header
And take the opportunity to improve interdependencies a bit with forward
declares where possible.
2022-02-04 14:17:30 +01:00
Hugo Locurcio 84a69d7429 Improve the default project theme
The new default project theme uses StyleBoxFlat extensively for
a more modern design and better scalability to multiple resolutions.

SVG icons are now used in place of PNG icons. While this does not
allow for true vector-based icon drawing (icons are still rasterized
at load-time), this makes the design work easier for contributors
and opens the door to vector drawing in the future (e.g. with polygons
or SDFs).

Like for editor icons, the SVG header file is now built automatically
when a SVG file is changed. This removing the need for running
`make_header.py` manually (TODO).

The "Use Hidpi" project setting has been removed in favor of a
"Default Theme Scale" project setting, which allows creating the
default theme at a higher/lower scale than the default.
This can be used when designing GUIs with a high base resolution
to ensure crisp visuals.

Co-authored-by: Yuri Sizov <yuris@humnom.net>
2022-01-19 18:46:01 +03:00
Aaron Franke d9506cade1
Add tests for Vector2/Vector2i/Vector3/Vector3i 2022-01-14 01:59:55 -06:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Aaron Franke 99a282f631
Move and organize tests into subfolders 2021-11-07 00:43:31 -06:00
bruvzg 0c0b5c84b0 Implement TextServer GDExtension interface, remove TextServer GDNative interface. 2021-10-01 15:13:29 +03:00
Paulb23 ce064348fa Add CodeEdit breakpoint unit tests 2021-09-01 16:46:04 +01:00
Paulb23 55a20129d6 Create framework for testing Signals 2021-09-01 16:46:04 +01:00
Paulb23 427d3d7207 Allow unit testing SceneTree Ojects 2021-09-01 16:46:04 +01:00
Aaron Franke f64fea1b23
Add Time singleton 2021-06-11 09:32:39 -04:00
jfons f8e34209af Fix some warnings raised by GCC-11.1 2021-05-25 17:23:53 +02:00
Hugo Locurcio 114d556a42
Add a test suite for Vector
This test suite is based on the LocalVector test suite with significant
changes made.
2021-05-19 16:37:39 +02:00
Hugo Locurcio dd51fc77b5
Add a test suite for Translation 2021-05-17 02:02:17 +02:00
Hugo Locurcio 217f1f891b
Add a test suite for Dictionary
Co-authored-by: Sarav Noor Singh <saravnoorsingh@Saravs-MBP.T-mobile.com>
2021-03-31 01:14:18 +02:00
Daniel Kříž f07552ba92 add tests for path3d 2021-03-29 10:13:53 +02:00
Maximilian Mayer f12d205c1f Add unit tests for HashingContext 2021-03-07 20:33:08 +01:00
James Gordon a26d4b1727 Added test file and test cases 2021-02-27 13:16:04 +00:00
Rémi Verschelde 5a10f52ee8
Merge pull request #45914 from HenryWConklin/45841-xml-entities
Add support for numeric XML entities to XMLParser
2021-02-24 13:03:46 +01:00
Hugo Locurcio efd122a99a
Add a test suite for Resource 2021-02-20 19:47:20 +01:00