summaryrefslogtreecommitdiff
path: root/modules/gdscript/tests
AgeCommit message (Collapse)Author
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-11Rename Reference to RefCountedPedro J. Estébanez
2021-06-11Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde
File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
2021-05-26Merge pull request #49114 from vnen/gdscript-fix-self-function-type-checkRémi Verschelde
GDScript: Fix function signature check for self calls
2021-05-26GDScript: Fix function signature check for self callsGeorge Marques
2021-05-25Rename File::get_len() get_length()Marcel Admiraal
2021-05-24Make Callable not crash on call when the object has been freedGeorge Marques
Also add a GDScript test for this case.
2021-05-24GDScript: Fix error handler for testsGeorge Marques
This changes the error message to be more clear on the output files and also fixes an issue with the relative path of the offending file that was not trimmed correctly.
2021-05-19Merge pull request #48657 from Calinou/test-add-gdscriptRémi Verschelde
Add a unit test suite for GDScript
2021-05-17Make all file access 64-bit (uint64_t)Pedro J. Estébanez
This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-05-12Add a unit test suite for GDScriptHugo Locurcio
This tests run-time script loading.
2021-05-03Merge pull request #47958 from Xrayez/gdscript-rename-test-scriptsRémi Verschelde
Rename GDScript test script filenames to use `snake_case`
2021-04-28GDScript: Add lambdas to the type analyzerGeorge Marques
- Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated.
2021-04-28GDScript: Add lambda syntax parsingGeorge Marques
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")
2021-04-26Remove uses of `auto` for better readability and online code reviewsHugo Locurcio
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).
2021-04-16Rename GDScript test script filenames to use `snake_case`Andrii Doroshenko (Xrayez)
2021-04-08Add runner for GDScript testingGeorge Marques
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>
2021-03-22Add unit tests for export templatesGordon MacPherson
2021-01-01Update copyright statements to 2021Rémi Verschelde
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 🎆
2020-12-28Rename empty() to is_empty()Marcel Admiraal
2020-11-16Remove empty lines around braces with the formatting scriptAaron Franke
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-10-20GDScript: Add initialization for the language before debug testsGeorge Marques
This ensures that the tests will use a full environment with correct settings so global classes and autoloads can be properly found.
2020-09-02Register GDScript test tools as test commands to run via command-lineAndrii Doroshenko (Xrayez)
2020-09-02Move GDScript tests to respective folder under modulesAndrii Doroshenko (Xrayez)