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.
5 #include "mojo/public/tests/test_support_private.h"
11 static mojo::test::TestSupport
* g_test_support
= NULL
;
15 void MojoTestSupportLogPerfResult(const char* test_name
,
16 const char* sub_test_name
,
20 g_test_support
->LogPerfResult(test_name
, sub_test_name
, value
, units
);
23 printf("[no test runner]\t%s/%s\t%g\t%s\n", test_name
, sub_test_name
,
26 printf("[no test runner]\t%s\t%g\t%s\n", test_name
, value
, units
);
31 FILE* MojoTestSupportOpenSourceRootRelativeFile(const char* relative_path
) {
33 return g_test_support
->OpenSourceRootRelativeFile(relative_path
);
34 printf("[no test runner]\n");
38 char** MojoTestSupportEnumerateSourceRootRelativeDirectory(
39 const char* relative_path
) {
41 return g_test_support
->EnumerateSourceRootRelativeDirectory(relative_path
);
43 printf("[no test runner]\n");
46 char** rv
= static_cast<char**>(calloc(1, sizeof(char*)));
56 TestSupport::~TestSupport() {
60 void TestSupport::Init(TestSupport
* test_support
) {
61 assert(!g_test_support
);
62 g_test_support
= test_support
;
66 TestSupport
* TestSupport::Get() {
67 return g_test_support
;
71 void TestSupport::Reset() {
72 g_test_support
= NULL
;