blob: ce54877fdd40cdc7b12d239df8d6b9cc4d7fb916 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2022 The Chromium Authors
Roland Bockd662a2d2022-07-12 20:55:272// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/check_is_test.h"
6
Cliff Smolinskyfed5d5a52025-03-24 18:03:267#include "base/base_export.h"
Roland Bockd662a2d2022-07-12 20:55:278
9namespace {
10bool g_this_is_a_test = false;
11}
12
13namespace base::internal {
Peter Boström39497a602024-11-19 22:20:2414bool get_is_test_impl() {
Daniel Murphy5fa7a3192024-04-17 23:08:4315 return g_this_is_a_test;
16}
Roland Bockd662a2d2022-07-12 20:55:2717} // namespace base::internal
18
19namespace base::test {
Roland Bock3c0853f2022-10-23 01:23:0120// base/test/allow_check_is_test_for_testing.h declares
21// `AllowCheckIsTestForTesting`, but is only allowed to be included in test
22// code. We therefore have to also mark the symbol as exported here.
23BASE_EXPORT void AllowCheckIsTestForTesting() {
Roland Bockd662a2d2022-07-12 20:55:2724 g_this_is_a_test = true;
25}
Roland Bockd662a2d2022-07-12 20:55:2726} // namespace base::test