From e3967012a3db04c11bd7c62f09d5c231e6aa7fca Mon Sep 17 00:00:00 2001 From: Christian Flach Date: Thu, 5 Apr 2018 22:57:03 +0200 Subject: [PATCH] Move everything back to where it was before, but "export-ignore" unwanted files --- .gitattributes | 18 ++++++++++ CHANGES.md | 6 ++-- README.md | 30 ++++++++-------- .../default_env.tres => default_env.tres | 0 gut_tests_and_examples/icon.png => icon.png | Bin project.godot | 6 +++- .../scenes => scenes}/main.tscn | 8 +++-- .../scripts => scripts}/global.gd | 0 .../scripts => scripts}/main.gd | 24 ++++++------- .../templates => templates}/test_.gd | 0 .../test_sample_all_passed_integration.gd | 0 ..._has_a_really_long_name_to_test_display.gd | 0 .../samples/test_readme_examples.gd | 0 .../samples/test_sample_all_passed.gd | 0 .../test => test}/samples/test_sample_one.gd | 0 .../test => test}/samples/test_sample_two.gd | 0 .../samples/two_pass_pending_fail.gd | 0 .../test => test}/test_dir_load/bad_prefix.gd | 0 .../test_dir_load/test_bad_extension.txt | 0 .../test_dir_load/test_samples.gd | 0 .../test_dir_load/test_samples2.gd | 0 .../test_dir_load/test_samples3.gd | 0 .../unit/test_command_line_auto_load.gd | 0 .../test => test}/unit/test_gut.gd | 34 +++++++++--------- .../test => test}/unit/test_gut_yielding.gd | 0 .../test => test}/unit/test_moved_methods.gd | 0 .../test => test}/unit/test_print.gd | 0 .../test => test}/unit/test_signal_watcher.gd | 0 .../test => test}/unit/test_summary.gd | 0 .../test => test}/unit/test_test.gd | 0 .../unit/verify_signal_watches_are_cleared.gd | 0 31 files changed, 75 insertions(+), 51 deletions(-) create mode 100644 .gitattributes rename gut_tests_and_examples/default_env.tres => default_env.tres (100%) rename gut_tests_and_examples/icon.png => icon.png (100%) rename {gut_tests_and_examples/scenes => scenes}/main.tscn (89%) rename {gut_tests_and_examples/scripts => scripts}/global.gd (100%) rename {gut_tests_and_examples/scripts => scripts}/main.gd (83%) rename {gut_tests_and_examples/templates => templates}/test_.gd (100%) rename {gut_tests_and_examples/test => test}/integration/test_sample_all_passed_integration.gd (100%) rename {gut_tests_and_examples/test => test}/integration/test_this_scirpt_has_a_really_long_name_to_test_display.gd (100%) rename {gut_tests_and_examples/test => test}/samples/test_readme_examples.gd (100%) rename {gut_tests_and_examples/test => test}/samples/test_sample_all_passed.gd (100%) rename {gut_tests_and_examples/test => test}/samples/test_sample_one.gd (100%) rename {gut_tests_and_examples/test => test}/samples/test_sample_two.gd (100%) rename {gut_tests_and_examples/test => test}/samples/two_pass_pending_fail.gd (100%) rename {gut_tests_and_examples/test => test}/test_dir_load/bad_prefix.gd (100%) rename {gut_tests_and_examples/test => test}/test_dir_load/test_bad_extension.txt (100%) rename {gut_tests_and_examples/test => test}/test_dir_load/test_samples.gd (100%) rename {gut_tests_and_examples/test => test}/test_dir_load/test_samples2.gd (100%) rename {gut_tests_and_examples/test => test}/test_dir_load/test_samples3.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_command_line_auto_load.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_gut.gd (88%) rename {gut_tests_and_examples/test => test}/unit/test_gut_yielding.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_moved_methods.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_print.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_signal_watcher.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_summary.gd (100%) rename {gut_tests_and_examples/test => test}/unit/test_test.gd (100%) rename {gut_tests_and_examples/test => test}/unit/verify_signal_watches_are_cleared.gd (100%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..167b3f4d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# Exclude all top-level files and directories +# (except addons) from zip downloads. +# This makes installing Gut through the AssetLib +# easier, because no files and folders need to +# be unchecked. + +/.gitattributes export-ignore +/.gitignore export-ignore +/CHANGES.md export-ignore +/default_env.tres export-ignore +/icon.png export-ignore +/project.godot export-ignore +/README.md export-ignore + +/scenes export-ignore +/scripts export-ignore +/templates export-ignore +/test export-ignore diff --git a/CHANGES.md b/CHANGES.md index 84b84e5a..40d529f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,12 +10,12 @@ This project adheres to [Semantic Versioning](http://semver.org/). * Missed changing `simulate` to call `_physics_process` instead of `_fixed_process` in the 3.0 conversion. Fixed that. * Improved summary. It now lists all failures and pendings instead of just listing the scripts that have failures or pending tests. * Fixed issue where the `signal_watcher` could try to disconnect from a freed object. -* Added `yield_to` which allows you to `yield` to a signal or a maximum amount of time. This keeps your tests moving along if you yield to a signal that never gets emitted. Now the test will fail after an amount of time instead of sitting in limbo forever. This will also watch the signals on the object so you can make asserts about signals after the `yield` and you can save a line of code. +* Added `yield_to` which allows you to `yield` to a signal or a maximum amount of time. This keeps your tests moving along if you yield to a signal that never gets emitted. Now the test will fail after an amount of time instead of sitting in limbo forever. This will also watch the signals on the object so you can make asserts about signals after the `yield` and you can save a line of code. Example: ``` python # wait for my_object to emit the signal 'my_signal' # or 5 seconds, whichever comes first. -yield(yield_to(my_object, 'my_signal', 5), YIELD) +yield(yield_to(my_object, 'my_signal', 5), YIELD) assert_signal_emitted(my_object, 'my_signal', \ 'Maybe it did, maybe it didnt, but we still got here.') ``` @@ -44,7 +44,7 @@ Due to the restructuring I've completely moved the various `asserts` out of the - New Methdos - `assert_extends` Asserts that an instance of an object inherits from the class passed. -- Some changes to the log output. +- Some changes to the log output. - Quick summary about each test script is included at the end of the run. - Scripts that had a failing assert are listed together in the quick summary. - Changed the GUI to have a fixed width font. It makes formatting the output easier and I like it more. Future changes should make customizing the GUI possible, so if you aren't fond of it you'll be able to change it sometime soon. diff --git a/README.md b/README.md index c1fdb53f..3a02df86 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ GUT (Godot Unit Test) is a utility for writing tests for your Godot Engine game. Version 6.0.0 is Godot 3.0 compatible. These changes are not compatible with any of the 2.x versions of Godot. The godot_2x branch has been created to hold the old version of Gut that works with Godot 2.x. Barring any severe issues, there will not be any more development for Godot 2.x. # License -Gut is provided under the MIT license. [The license is distributed with Gut so it is in the `addons/gut` folder](addons/gut/LICENSE.md). I also didn't want the Gut license to accidentally be copied into another project's root directory when installed through the Godot Asset Library. +Gut is provided under the MIT license. # Method Links @@ -61,7 +61,7 @@ Gut is provided under the MIT license. [The license is distributed with Gut so # Install ## Installing from Download -Download and extract the zip from the [releases](https://github.com/bitwes/gut/releases) or from the [Godot Asset Library](https://godotengine.org/asset-library/asset/54). +Download and extract the zip from the [releases](https://github.com/bitwes/gut/releases) or from the [Godot Asset Library](https://godotengine.org/asset-library/asset/54). Extract the zip and place the `gut` directory into your `addons` directory in your project. If you don't have an `addons` folder at the root of your project, then make one and THEN put the `gut` directory in there. @@ -107,7 +107,7 @@ The following settings are accessible in the Editor under "Script Variables" * Disable Strict Datatype Checks: Disables the verifying of datatypes before comparisons are done. You can disable this if you want. See the section on datatype checks for more details. * Test Prefix: The prefix used on all test functions. This prefixed will be used by Gut to find tests inside your test scripts. * File Prefix: The prefix used on all test files. This is used in conjunction with the Directory settings to find tests. -* File Extension: This is the suffix it will use to find test files. +* File Extension: This is the suffix it will use to find test files. * Directory(1-6): The path to the directories where your test scripts are located. Subdirectories are not included. If you need more than six directories you can use the `add_directory` method to add more. # Making Tests @@ -163,7 +163,7 @@ Each test should perform at least one assert or call `pending` to indicate the t # Test Related Methods -These methods should be used in tests to make assertions. These methods are available to anything that inherits from the Test class (`extends "res://addons/gut/test.gd"`). All sample code listed for the methods can be found here in [test_readme_examples.gd](gut_tests_and_examples/test/samples/test_readme_examples.gd) +These methods should be used in tests to make assertions. These methods are available to anything that inherits from the Test class (`extends "res://addons/gut/test.gd"`). All sample code listed for the methods can be found here in [test_readme_examples.gd](test/samples/test_readme_examples.gd) #### pending(text="") flag a test as pending, the optional message is printed in the GUI ``` python @@ -507,7 +507,7 @@ func test_assert_file_exists(): gut.p('-- failing --') assert_file_exists('user://file_does_not.exist') # FAIL - assert_file_exists('res://some_dir/another_dir/file_does_not.exist') # FAIL + assert_file_exists('res://some_dir/another_dir/file_does_not.exist') # FAIL ``` #### assert_file_does_not_exist(file_path) asserts a file does not exist at the specified path @@ -611,7 +611,7 @@ func test_assert_get_set_methods(): gut.p('-- failing --') # 1 FAILING, 3 PASSING - assert_get_set_methods(some_class, 'count', 'not_default', 20) + assert_get_set_methods(some_class, 'count', 'not_default', 20) # 2 FAILING, 2 PASSING assert_get_set_methods(some_class, 'nothing', 'hello', 22) # 2 FAILING @@ -700,7 +700,7 @@ func test_illustrate_end_test(): end_test() ``` ## Methods for Configuring the Execution of Tests -These methods would be used inside the scene you created at `res://test/tests.tcn`. These methods can be called against the Gut node you created. Most of these are not necessary anymore since you can configure Gut in the editor but they are here if you want to use them. Simply put `get_node('Gut').` in front of any of them. +These methods would be used inside the scene you created at `res://test/tests.tcn`. These methods can be called against the Gut node you created. Most of these are not necessary anymore since you can configure Gut in the editor but they are here if you want to use them. Simply put `get_node('Gut').` in front of any of them. __**__ indicates the option can be set via the editor * `add_script(script, select_this_one=false)` add a script to be tetsted with test_scripts @@ -746,7 +746,7 @@ The level of detail that is printed to the screen can be changed using the slide * LOG_LEVEL_ALL_ASSERTS (2) ## Printing info -The `gut.p` method allows you to print information out indented under the test output. It has an optional 2nd parameter that sets which log level to display it at. Use one of the constants in the section above to set it. The default is `LOG_LEVEL_FAIL_ONLY` which means the output will always be visible. +The `gut.p` method allows you to print information out indented under the test output. It has an optional 2nd parameter that sets which log level to display it at. Use one of the constants in the section above to set it. The default is `LOG_LEVEL_FAIL_ONLY` which means the output will always be visible. # Advanced Testing @@ -841,7 +841,7 @@ Sometimes you need to wait for a signal to be emitted, but you can never really ``` python # wait for my_object to emit the signal 'my_signal' # or 5 seconds, whichever comes first. -yield(yield_to(my_object, 'my_signal', 5), YIELD) +yield(yield_to(my_object, 'my_signal', 5), YIELD) assert_signal_emitted(my_object, 'my_signal', \ 'Maybe it did, maybe it didnt, but we still got here.') ``` @@ -882,16 +882,16 @@ The -d option tells Godot to run in debug mode which is helpful. The -s option ### Options _Output from the command line help (-gh)_ ``` ---------------------------------------------------------- +--------------------------------------------------------- This is the command line interface for the unit testing tool Gut. With this interface you can run one or more test scripts from the command line. In order for the Gut options to not clash with any other Godot options, each option starts with a "g". Also, any option that requires a value will take the form of "-g=". There cannot be any spaces between the option, the "=", or -inside a specified value or Godot will think you are trying to run a scene. +inside a specified value or Godot will think you are trying to run a scene. -Options -------- +Options +------- -gtest Comma delimited list of tests to run -gdir Comma delimited list of directories to add tests from. -gprefix Prefix used to find tests when specifying -gdir. Default @@ -909,7 +909,7 @@ Options -gutloc Full path (including name) of the gut script. Default res://addons/gut/gut.gd -gh Print this help ---------------------------------------------------------- +--------------------------------------------------------- ``` ### Examples @@ -943,7 +943,7 @@ I got this one when I accidentally put a space instead of an "=" after -gselect. # Contributing This testing tool has tests of course. All Gut related tests are found in the `test/unit` and `test/integration` directories. Any enhancements or bug fixes should have a corresponding pull request with new tests. -The bulk of the tests for Gut are in [test_gut.gd](gut_tests_and_examples/test/unit/test_gut.gd) and [test_test.gd](gut_tests_and_examples/test/unit/test_test.gd). [test_signal_watcher.gd](gut_tests_and_examples/test/unit/test_signal_watcher.gd) tests the class used to track the emitting of signals. The other test scripts in `unit` and `integration` should be run and their output spot checked since they test other parts of Gut that aren't easily testabled. +The bulk of the tests for Gut are in [test_gut.gd](test/unit/test_gut.gd) and [test_test.gd](test/unit/test_test.gd). [test_signal_watcher.gd](test/unit/test_signal_watcher.gd) tests the class used to track the emitting of signals. The other test scripts in `unit` and `integration` should be run and their output spot checked since they test other parts of Gut that aren't easily testabled. For convenience, the `main.tscn` includes a handy "Run Gut Unit Tests" button that will kick off all the essential test scripts. diff --git a/gut_tests_and_examples/default_env.tres b/default_env.tres similarity index 100% rename from gut_tests_and_examples/default_env.tres rename to default_env.tres diff --git a/gut_tests_and_examples/icon.png b/icon.png similarity index 100% rename from gut_tests_and_examples/icon.png rename to icon.png diff --git a/project.godot b/project.godot index a37af309..41a1c353 100644 --- a/project.godot +++ b/project.godot @@ -15,8 +15,12 @@ config/icon="res://icon.png" [autoload] -global="*res://gut_tests_and_examples/scripts/global.gd" +global="*res://scripts/global.gd" [editor_plugins] enabled=PoolStringArray( "gut" ) + +[rendering] + +environment/default_environment="res://default_env.tres" diff --git a/gut_tests_and_examples/scenes/main.tscn b/scenes/main.tscn similarity index 89% rename from gut_tests_and_examples/scenes/main.tscn rename to scenes/main.tscn index d6e5bf34..69fc815c 100644 --- a/gut_tests_and_examples/scenes/main.tscn +++ b/scenes/main.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://gut_tests_and_examples/scripts/main.gd" type="Script" id=1] +[ext_resource path="res://scripts/main.gd" type="Script" id=1] [ext_resource path="res://addons/gut/gut.gd" type="Script" id=2] [ext_resource path="res://addons/gut/icon.png" type="Texture" id=3] @@ -21,6 +21,7 @@ anchor_bottom = 0.0 margin_right = 48.0 margin_bottom = 40.0 rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false mouse_filter = 0 mouse_default_cursor_shape = 0 size_flags_horizontal = 1 @@ -42,8 +43,8 @@ _disable_strict_datatype_checks = false _test_prefix = "test_" _file_prefix = "test_" _file_extension = ".gd" -_directory1 = "res://gut_tests_and_examples/test/unit" -_directory2 = "res://gut_tests_and_examples/test/integration" +_directory1 = "res://test/unit" +_directory2 = "res://test/integration" _directory3 = "" _directory4 = "" _directory5 = "" @@ -60,6 +61,7 @@ margin_top = 18.0 margin_right = 908.0 margin_bottom = 93.0 rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false focus_mode = 2 mouse_filter = 0 mouse_default_cursor_shape = 0 diff --git a/gut_tests_and_examples/scripts/global.gd b/scripts/global.gd similarity index 100% rename from gut_tests_and_examples/scripts/global.gd rename to scripts/global.gd diff --git a/gut_tests_and_examples/scripts/main.gd b/scripts/main.gd similarity index 83% rename from gut_tests_and_examples/scripts/main.gd rename to scripts/main.gd index a4c4c3be..8abed0b2 100644 --- a/gut_tests_and_examples/scripts/main.gd +++ b/scripts/main.gd @@ -53,11 +53,11 @@ func _on_tests_finished(): tester.p("Tests done callback called") #------------------------------------ -# This creates an instance of Gut and runs a single script. The output will +# This creates an instance of Gut and runs a single script. The output will # be visible in the console, not the Gut instance on the screen. #------------------------------------ func _run_test_one_line(): - load('res://addons/gut/gut.gd').new().test_script('res://gut_tests_and_examples/test/samples/test_sample_all_passed.gd') + load('res://addons/gut/gut.gd').new().test_script('res://test/samples/test_sample_all_passed.gd') #------------------------------------ # More lines, get result text out manually. Can also inspect the results further @@ -82,8 +82,8 @@ func _run_all_tests(): # !! -------- # Add all scripts in two directories. - tester.add_directory('res://gut_tests_and_examples/test/unit') - tester.add_directory('res://gut_tests_and_examples/test/integration') + tester.add_directory('res://test/unit') + tester.add_directory('res://test/integration') # Automatcially run all scripts when loaded. tester.test_scripts(true) @@ -92,21 +92,21 @@ func _run_all_tests(): if(tester.get_fail_count() > 0): tester.p("SOMEBODY BROKE SOMETHIN'!!\n") -# These are all the tests that MUST be run to verify Gut is working as expected. +# These are all the tests that MUST be run to verify Gut is working as expected. # Some methods may include tests that are expected to fail. Closely inspect # the resutls. func _run_gut_tests(gut): gut.set_should_print_to_console(false) - gut.add_script('res://gut_tests_and_examples/test/unit/test_gut.gd') - gut.add_script('res://gut_tests_and_examples/test/unit/test_gut_yielding.gd') - gut.add_script('res://gut_tests_and_examples/test/unit/test_test.gd') - gut.add_script('res://gut_tests_and_examples/test/unit/test_signal_watcher.gd') + gut.add_script('res://test/unit/test_gut.gd') + gut.add_script('res://test/unit/test_gut_yielding.gd') + gut.add_script('res://test/unit/test_test.gd') + gut.add_script('res://test/unit/test_signal_watcher.gd') gut.set_yield_between_tests(true) - # true says to run all the scripts, not just the first or + # true says to run all the scripts, not just the first or # the selected script. - gut.test_scripts(true) + gut.test_scripts(true) -# Make a new Gut and run all the Gut specific tests. +# Make a new Gut and run all the Gut specific tests. func _on_RunGutTestsButton_pressed(): var gut = load('res://addons/gut/gut.gd').new() add_child(gut) diff --git a/gut_tests_and_examples/templates/test_.gd b/templates/test_.gd similarity index 100% rename from gut_tests_and_examples/templates/test_.gd rename to templates/test_.gd diff --git a/gut_tests_and_examples/test/integration/test_sample_all_passed_integration.gd b/test/integration/test_sample_all_passed_integration.gd similarity index 100% rename from gut_tests_and_examples/test/integration/test_sample_all_passed_integration.gd rename to test/integration/test_sample_all_passed_integration.gd diff --git a/gut_tests_and_examples/test/integration/test_this_scirpt_has_a_really_long_name_to_test_display.gd b/test/integration/test_this_scirpt_has_a_really_long_name_to_test_display.gd similarity index 100% rename from gut_tests_and_examples/test/integration/test_this_scirpt_has_a_really_long_name_to_test_display.gd rename to test/integration/test_this_scirpt_has_a_really_long_name_to_test_display.gd diff --git a/gut_tests_and_examples/test/samples/test_readme_examples.gd b/test/samples/test_readme_examples.gd similarity index 100% rename from gut_tests_and_examples/test/samples/test_readme_examples.gd rename to test/samples/test_readme_examples.gd diff --git a/gut_tests_and_examples/test/samples/test_sample_all_passed.gd b/test/samples/test_sample_all_passed.gd similarity index 100% rename from gut_tests_and_examples/test/samples/test_sample_all_passed.gd rename to test/samples/test_sample_all_passed.gd diff --git a/gut_tests_and_examples/test/samples/test_sample_one.gd b/test/samples/test_sample_one.gd similarity index 100% rename from gut_tests_and_examples/test/samples/test_sample_one.gd rename to test/samples/test_sample_one.gd diff --git a/gut_tests_and_examples/test/samples/test_sample_two.gd b/test/samples/test_sample_two.gd similarity index 100% rename from gut_tests_and_examples/test/samples/test_sample_two.gd rename to test/samples/test_sample_two.gd diff --git a/gut_tests_and_examples/test/samples/two_pass_pending_fail.gd b/test/samples/two_pass_pending_fail.gd similarity index 100% rename from gut_tests_and_examples/test/samples/two_pass_pending_fail.gd rename to test/samples/two_pass_pending_fail.gd diff --git a/gut_tests_and_examples/test/test_dir_load/bad_prefix.gd b/test/test_dir_load/bad_prefix.gd similarity index 100% rename from gut_tests_and_examples/test/test_dir_load/bad_prefix.gd rename to test/test_dir_load/bad_prefix.gd diff --git a/gut_tests_and_examples/test/test_dir_load/test_bad_extension.txt b/test/test_dir_load/test_bad_extension.txt similarity index 100% rename from gut_tests_and_examples/test/test_dir_load/test_bad_extension.txt rename to test/test_dir_load/test_bad_extension.txt diff --git a/gut_tests_and_examples/test/test_dir_load/test_samples.gd b/test/test_dir_load/test_samples.gd similarity index 100% rename from gut_tests_and_examples/test/test_dir_load/test_samples.gd rename to test/test_dir_load/test_samples.gd diff --git a/gut_tests_and_examples/test/test_dir_load/test_samples2.gd b/test/test_dir_load/test_samples2.gd similarity index 100% rename from gut_tests_and_examples/test/test_dir_load/test_samples2.gd rename to test/test_dir_load/test_samples2.gd diff --git a/gut_tests_and_examples/test/test_dir_load/test_samples3.gd b/test/test_dir_load/test_samples3.gd similarity index 100% rename from gut_tests_and_examples/test/test_dir_load/test_samples3.gd rename to test/test_dir_load/test_samples3.gd diff --git a/gut_tests_and_examples/test/unit/test_command_line_auto_load.gd b/test/unit/test_command_line_auto_load.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_command_line_auto_load.gd rename to test/unit/test_command_line_auto_load.gd diff --git a/gut_tests_and_examples/test/unit/test_gut.gd b/test/unit/test_gut.gd similarity index 88% rename from gut_tests_and_examples/test/unit/test_gut.gd rename to test/unit/test_gut.gd index d62a185f..041b0ac0 100644 --- a/gut_tests_and_examples/test/unit/test_gut.gd +++ b/test/unit/test_gut.gd @@ -229,7 +229,7 @@ func test_simulate_calls_physics_process(): # ------------------------------ # Setting test to run # ------------------------------ -const SAMPLES_DIR = 'res://gut_tests_and_examples/test/samples/' +const SAMPLES_DIR = 'res://test/samples/' func test_get_set_test_to_run(): gr.test.assert_get_set_methods(gr.test_gut, 'unit_test_name', '', 'hello') assert_pass(4) @@ -286,7 +286,7 @@ func test_gut_clears_test_instances_between_runs(): # ------------------------------ # Loading diretories # ------------------------------ -const TEST_LOAD_DIR = 'res://gut_tests_and_examples/test/test_dir_load' +const TEST_LOAD_DIR = 'res://test/test_dir_load' func test_adding_directory_loads_files(): gr.test_gut.add_directory(TEST_LOAD_DIR) assert_has(gr.test_gut._test_scripts, TEST_LOAD_DIR + '/test_samples.gd') @@ -304,9 +304,9 @@ func test_if_directory_does_not_exist_it_does_not_die(): assert_true(true, 'We should get here') func test_adding_same_directory_does_not_add_duplicates(): - gr.test_gut.add_directory('res://gut_tests_and_examples/test/unit') + gr.test_gut.add_directory('res://test/unit') var orig = gr.test_gut._test_scripts.size() - gr.test_gut.add_directory('res://gut_tests_and_examples/test/unit') + gr.test_gut.add_directory('res://test/unit') assert_eq(gr.test_gut._test_scripts.size(), orig) # We only have 3 directories with tests in them so test 3 @@ -315,13 +315,13 @@ func test_directories123_defined_in_editor_are_loaded_on_ready(): var t = Test.new() t.gut = g g.set_yield_between_tests(false) - g._directory1 = 'res://gut_tests_and_examples/test/test_dir_load' - g._directory2 = 'res://gut_tests_and_examples/test/unit' - g._directory3 = 'res://gut_tests_and_examples/test/integration' + g._directory1 = 'res://test/test_dir_load' + g._directory2 = 'res://test/unit' + g._directory3 = 'res://test/integration' add_child(g) - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/test_dir_load/test_samples.gd', 'Should have dir1 script') - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/unit/test_gut.gd', 'Should have dir2 script') - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/integration/test_sample_all_passed_integration.gd', 'Should have dir3 script') + t.assert_has(g._test_scripts, 'res://test/test_dir_load/test_samples.gd', 'Should have dir1 script') + t.assert_has(g._test_scripts, 'res://test/unit/test_gut.gd', 'Should have dir2 script') + t.assert_has(g._test_scripts, 'res://test/integration/test_sample_all_passed_integration.gd', 'Should have dir3 script') assert_eq(t.get_pass_count(), 3, 'they should have passed') # ^ aaaand then we test 2 more. @@ -330,20 +330,20 @@ func test_directories456_defined_in_editor_are_loaded_on_ready(): var t = Test.new() t.gut = g g.set_yield_between_tests(false) - g._directory4 = 'res://gut_tests_and_examples/test/test_dir_load' - g._directory5 = 'res://gut_tests_and_examples/test/unit' - g._directory6 = 'res://gut_tests_and_examples/test/integration' + g._directory4 = 'res://test/test_dir_load' + g._directory5 = 'res://test/unit' + g._directory6 = 'res://test/integration' add_child(g) - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/test_dir_load/test_samples.gd', 'Should have dir4 script') - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/unit/test_gut.gd', 'Should have dir5 script') - t.assert_has(g._test_scripts, 'res://gut_tests_and_examples/test/integration/test_sample_all_passed_integration.gd', 'Should have dir6 script') + t.assert_has(g._test_scripts, 'res://test/test_dir_load/test_samples.gd', 'Should have dir4 script') + t.assert_has(g._test_scripts, 'res://test/unit/test_gut.gd', 'Should have dir5 script') + t.assert_has(g._test_scripts, 'res://test/integration/test_sample_all_passed_integration.gd', 'Should have dir6 script') assert_eq(t.get_pass_count(), 3, 'they should have passed') # ------------------------------ # Signal tests # ------------------------------ func test_when_moving_to_next_test_watched_signals_are_cleared(): - gr.test_gut.add_script('res://gut_tests_and_examples/test/unit/verify_signal_watches_are_cleared.gd') + gr.test_gut.add_script('res://test/unit/verify_signal_watches_are_cleared.gd') gr.test_gut.test_scripts() assert_eq(gr.test_gut.get_pass_count(), 1, 'One test should have passed.') assert_eq(gr.test_gut.get_fail_count(), 1, 'One failure for not watching anymore.') diff --git a/gut_tests_and_examples/test/unit/test_gut_yielding.gd b/test/unit/test_gut_yielding.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_gut_yielding.gd rename to test/unit/test_gut_yielding.gd diff --git a/gut_tests_and_examples/test/unit/test_moved_methods.gd b/test/unit/test_moved_methods.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_moved_methods.gd rename to test/unit/test_moved_methods.gd diff --git a/gut_tests_and_examples/test/unit/test_print.gd b/test/unit/test_print.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_print.gd rename to test/unit/test_print.gd diff --git a/gut_tests_and_examples/test/unit/test_signal_watcher.gd b/test/unit/test_signal_watcher.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_signal_watcher.gd rename to test/unit/test_signal_watcher.gd diff --git a/gut_tests_and_examples/test/unit/test_summary.gd b/test/unit/test_summary.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_summary.gd rename to test/unit/test_summary.gd diff --git a/gut_tests_and_examples/test/unit/test_test.gd b/test/unit/test_test.gd similarity index 100% rename from gut_tests_and_examples/test/unit/test_test.gd rename to test/unit/test_test.gd diff --git a/gut_tests_and_examples/test/unit/verify_signal_watches_are_cleared.gd b/test/unit/verify_signal_watches_are_cleared.gd similarity index 100% rename from gut_tests_and_examples/test/unit/verify_signal_watches_are_cleared.gd rename to test/unit/verify_signal_watches_are_cleared.gd