Run all tests and report results.
()
| 267 | |
| 268 | |
| 269 | def run_all_tests(): |
| 270 | """Run all tests and report results.""" |
| 271 | if not HAS_C_EXTENSION: |
| 272 | print("C extension not available, skipping tests") |
| 273 | return |
| 274 | |
| 275 | print("Running Comprehensive C Extension Tests") |
| 276 | print("=" * 50) |
| 277 | |
| 278 | tests = [ |
| 279 | test_empty_tree, |
| 280 | test_single_item, |
| 281 | test_sequential_insert_small, |
| 282 | test_random_insert_small, |
| 283 | test_duplicate_keys, |
| 284 | test_key_error, |
| 285 | test_iteration_order, |
| 286 | test_large_capacity, |
| 287 | test_string_keys, |
| 288 | test_mixed_types, |
| 289 | ] |
| 290 | |
| 291 | passed = 0 |
| 292 | failed = 0 |
| 293 | |
| 294 | for test in tests: |
| 295 | try: |
| 296 | test() |
| 297 | passed += 1 |
| 298 | except Exception as e: |
| 299 | print(f"✗ {test.__name__} FAILED: {e}") |
| 300 | failed += 1 |
| 301 | # Continue with other tests |
| 302 | |
| 303 | print("\n" + "=" * 50) |
| 304 | print(f"Test Results: {passed} passed, {failed} failed") |
| 305 | |
| 306 | if failed == 0: |
| 307 | print("🎉 All tests passed! C extension is working correctly.") |
| 308 | else: |
| 309 | print("🚨 Some tests failed. C extension needs fixes.") |
| 310 | |
| 311 | return failed == 0 |
| 312 | |
| 313 | |
| 314 | if __name__ == "__main__": |
no outgoing calls
no test coverage detected