8 Commits

Author SHA1 Message Date
Yves-Marie Haussonne
cb66508e19 refactor(base.lua): improve test completion logic
Refactored the test completion logic in the `run_tests` function for better readability and maintainability. Removed redundant check for `minetest.settings:get_bool("test_harness_stop_server", true)` and streamlined the conditional flow based on `tests_state`. This change enhances code clarity without altering functionality significantly.
2024-10-02 12:36:45 +02:00
Yves-Marie Haussonne
02f78d379b chore(ci): update packaging script output directory
Adjusted the packaging script in `.gitlab-ci.yml` to save artifacts in `/tmp/` for improved storage management and accessibility. Additionally, fixed a conditional statement in `base.lua` to properly handle the failfast option during testing.
2024-10-02 12:15:03 +02:00
Yves-Marie Haussonne
4475ebb556 debug 2024-10-02 11:31:19 +02:00
Yves-Marie Haussonne
514e089214 fix(tests): change 'break' to 'return' in run_tests
Changing 'break' to 'return' in the run_tests function to stop the test loop when a failure occurs, improving test harness behavior by returning from the function instead of breaking out of the loop.
2024-10-02 11:24:24 +02:00
Yves-Marie Haussonne
199abfba88 refactor(base.lua): improve run_tests function logic
Refactor the run_tests function in base.lua to enhance its logic and readability. The changes ensure proper handling of the tests_state enumeration.
2024-10-02 11:12:18 +02:00
Yves-Marie Haussonne
14860ab625 fix(testing): ensure mod validity in get_test_registrator
Check if the provided mod name is valid by iterating through the registered mod names before allowing test registration.
2024-10-02 08:07:56 +02:00
Yves-Marie Haussonne
b40bbafd4c feat(tests): introduce modular test registration
- Adds support for registering tests under specific modules to enhance organization and categorization.
- Introduces `register_test` function scoped within a module using `get_test_registrator`.
- Track tests by module for improved visibility and management.
- Enhances test output formatting to include module information alongside test names.
2024-10-02 01:42:45 +02:00
Yves-Marie Haussonne
6514938564 Add generic test harness lib. test itself 2024-10-01 19:00:24 +02:00