| 194 | #endif |
| 195 | |
| 196 | int 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 | |
| 231 | bool GDScriptTestRunner::generate_outputs() { |
| 232 | is_generating = true; |
no test coverage detected