michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "SanityChecks.h" michael@0: #include "TestPoint.h" michael@0: #include "TestScaling.h" michael@0: #include "TestBugs.h" michael@0: #ifdef WIN32 michael@0: #include "TestDrawTargetD2D.h" michael@0: #endif michael@0: michael@0: #include michael@0: #include michael@0: michael@0: struct TestObject { michael@0: TestBase *test; michael@0: std::string name; michael@0: }; michael@0: michael@0: michael@0: using namespace std; michael@0: michael@0: int michael@0: main() michael@0: { michael@0: TestObject tests[] = michael@0: { michael@0: { new SanityChecks(), "Sanity Checks" }, michael@0: #ifdef WIN32 michael@0: { new TestDrawTargetD2D(), "DrawTarget (D2D)" }, michael@0: #endif michael@0: { new TestPoint(), "Point Tests" }, michael@0: { new TestScaling(), "Scaling Tests" } michael@0: { new TestBugs(), "Bug Tests" } michael@0: }; michael@0: michael@0: int totalFailures = 0; michael@0: int totalTests = 0; michael@0: stringstream message; michael@0: printf("------ STARTING RUNNING TESTS ------\n"); michael@0: for (int i = 0; i < sizeof(tests) / sizeof(TestObject); i++) { michael@0: message << "--- RUNNING TESTS: " << tests[i].name << " ---\n"; michael@0: printf(message.str().c_str()); michael@0: message.str(""); michael@0: int failures = 0; michael@0: totalTests += tests[i].test->RunTests(&failures); michael@0: totalFailures += failures; michael@0: // Done with this test! michael@0: delete tests[i].test; michael@0: } michael@0: message << "------ FINISHED RUNNING TESTS ------\nTests run: " << totalTests << " - Passes: " << totalTests - totalFailures << " - Failures: " << totalFailures << "\n"; michael@0: printf(message.str().c_str()); michael@0: return totalFailures; michael@0: }