MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / run_tests

Method run_tests

modules/gdscript/tests/gdscript_test_runner.cpp:196–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194#endif
195
196int GDScriptTestRunner::run_tests() {
197 if (!make_tests()) {
198 FAIL("An error occurred while making the tests.");
199 return -1;
200 }
201
202 if (!generate_class_index()) {
203 FAIL("An error occurred while generating class index.");
204 return -1;
205 }
206
207 int failed = 0;
208 for (int i = 0; i < tests.size(); i++) {
209 GDScriptTest test = tests[i];
210 if (print_filenames) {
211 print_line(test.get_source_relative_filepath());
212 }
213 GDScriptTest::TestResult result = test.run_test();
214
215 String expected = FileAccess::get_file_as_string(test.get_output_file());
216#ifndef DEBUG_ENABLED
217 expected = strip_warnings(expected);
218#endif
219 INFO(test.get_source_file());
220 if (!result.passed) {
221 INFO(expected);
222 failed++;
223 }
224
225 CHECK_MESSAGE(result.passed, (result.passed ? String() : result.output));
226 }
227
228 return failed;
229}
230
231bool GDScriptTestRunner::generate_outputs() {
232 is_generating = true;

Callers 1

Calls 7

print_lineFunction · 0.85
strip_warningsFunction · 0.85
run_testMethod · 0.80
get_source_fileMethod · 0.80
sizeMethod · 0.65
StringClass · 0.50

Tested by

no test coverage detected