OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mojo/public/tests/test_support_private.h" |
| 6 |
| 7 #include <assert.h> |
| 8 #include <stddef.h> |
| 9 #include <stdio.h> |
| 10 |
| 11 static mojo::test::TestSupport* g_test_support = NULL; |
| 12 |
| 13 extern "C" { |
| 14 |
| 15 void MojoTestSupportLogPerfResult(const char* test_name, |
| 16 double value, |
| 17 const char* units) { |
| 18 if (g_test_support) |
| 19 g_test_support->LogPerfResult(test_name, value, units); |
| 20 else |
| 21 printf("[no test runner]\t%s\t%g\t%s\n", test_name, value, units); |
| 22 } |
| 23 |
| 24 } // extern "C" |
| 25 |
| 26 namespace mojo { |
| 27 namespace test { |
| 28 |
| 29 TestSupport::~TestSupport() { |
| 30 } |
| 31 |
| 32 // static |
| 33 void TestSupport::Init(TestSupport* test_support) { |
| 34 assert(!g_test_support); |
| 35 g_test_support = test_support; |
| 36 } |
| 37 |
| 38 // static |
| 39 TestSupport* TestSupport::Get() { |
| 40 return g_test_support; |
| 41 } |
| 42 |
| 43 // static |
| 44 void TestSupport::Reset() { |
| 45 g_test_support = NULL; |
| 46 } |
| 47 |
| 48 } // namespace test |
| 49 } // namespace mojo |
OLD | NEW |