summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
Commit message (Collapse)AuthorAgeFilesLines
* GDScript: Add lambdas to the type analyzerGeorge Marques2021-04-281-0/+12
| | | | | - Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated.
* GDScript: Add lambda syntax parsingGeorge Marques2021-04-281-1/+1
| | | | | | | | | | | Lambda syntax is the same as a the function syntax (using the same `func` keyword) except that the name is optional and it can be embedded anywhere an expression is expected. E.g.: func _ready(): var my_lambda = func(x): print(x) my_lambda.call("hello")
* Remove uses of `auto` for better readability and online code reviewsHugo Locurcio2021-04-261-2/+2
| | | | | | | | The current code style guidelines forbid the use of `auto`. Some uses of `auto` are still present, such as in UWP code (which can't be currently tested) and macros (where removing `auto` isn't easy).
* Add runner for GDScript testingGeorge Marques2021-04-0831-74/+870
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant for testing the GDScript implementation, not for testing user scripts nor testing the engine using scripts. Tests consists in a GDScript file and a .out file with the expected output. The .out file format is: expected status (based on the enum GDScriptTest::TestStatus) on the first line, followed by either an error message or the resulting output. Warnings are added after the first line, before the output (or compiler errors) if the parser pass without any error. The test script must have a function called `test()` which takes no argument. Such function will be called by the test runner. The test should not have any dependency unless it's part of the test too. Global classes (using `class_name`) are registered before the runner starts, so those should work if needed. Use the command `godot --gdscript-generate-tests godot-source/modules/gdscript/tests/scripts` to update the .out files with the current output (make sure the output are the expected values before committing). The tests themselves are part of the doctest suite so those can be executed with `godot --test`. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
* Add unit tests for export templatesGordon MacPherson2021-03-221-3/+4
|
* Update copyright statements to 2021Rémi Verschelde2021-01-012-4/+4
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-1/+1
|
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-162-2/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-2/+2
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* GDScript: Add initialization for the language before debug testsGeorge Marques2020-10-201-0/+76
| | | | | This ensures that the tests will use a full environment with correct settings so global classes and autoloads can be properly found.
* Register GDScript test tools as test commands to run via command-lineAndrii Doroshenko (Xrayez)2020-09-022-26/+6
|
* Move GDScript tests to respective folder under modulesAndrii Doroshenko (Xrayez)2020-09-022-0/+298