Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "SanityChecks.h"
7 #include "TestPoint.h"
8 #include "TestScaling.h"
9 #include "TestBugs.h"
10 #ifdef WIN32
11 #include "TestDrawTargetD2D.h"
12 #endif
14 #include <string>
15 #include <sstream>
17 struct TestObject {
18 TestBase *test;
19 std::string name;
20 };
23 using namespace std;
25 int
26 main()
27 {
28 TestObject tests[] =
29 {
30 { new SanityChecks(), "Sanity Checks" },
31 #ifdef WIN32
32 { new TestDrawTargetD2D(), "DrawTarget (D2D)" },
33 #endif
34 { new TestPoint(), "Point Tests" },
35 { new TestScaling(), "Scaling Tests" }
36 { new TestBugs(), "Bug Tests" }
37 };
39 int totalFailures = 0;
40 int totalTests = 0;
41 stringstream message;
42 printf("------ STARTING RUNNING TESTS ------\n");
43 for (int i = 0; i < sizeof(tests) / sizeof(TestObject); i++) {
44 message << "--- RUNNING TESTS: " << tests[i].name << " ---\n";
45 printf(message.str().c_str());
46 message.str("");
47 int failures = 0;
48 totalTests += tests[i].test->RunTests(&failures);
49 totalFailures += failures;
50 // Done with this test!
51 delete tests[i].test;
52 }
53 message << "------ FINISHED RUNNING TESTS ------\nTests run: " << totalTests << " - Passes: " << totalTests - totalFailures << " - Failures: " << totalFailures << "\n";
54 printf(message.str().c_str());
55 return totalFailures;
56 }