1b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// Copyright 2014 the V8 project authors. All rights reserved.
2b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// Use of this source code is governed by a BSD-style license that can be
3b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// found in the LICENSE file.
4b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
5b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#ifndef V8_COMPILER_COMPILER_TEST_UTILS_H_
6b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define V8_COMPILER_COMPILER_TEST_UTILS_H_
7b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
8b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#include "testing/gtest/include/gtest/gtest.h"
9b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
10b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochnamespace v8 {
11b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochnamespace internal {
12b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdochnamespace compiler {
13b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
14b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// The TARGET_TEST(Case, Name) macro works just like
15b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// TEST(Case, Name), except that the test is disabled
16b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// if the platform is not a supported TurboFan target.
17b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#if V8_TURBOFAN_TARGET
18b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST(Case, Name) TEST(Case, Name)
19b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#else
20b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST(Case, Name) TEST(Case, DISABLED_##Name)
21b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#endif
22b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
23b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
24b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// The TARGET_TEST_F(Case, Name) macro works just like
25b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// TEST_F(Case, Name), except that the test is disabled
26b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// if the platform is not a supported TurboFan target.
27b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#if V8_TURBOFAN_TARGET
28b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST_F(Case, Name) TEST_F(Case, Name)
29b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#else
30b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST_F(Case, Name) TEST_F(Case, DISABLED_##Name)
31b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#endif
32b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
33b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
34b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// The TARGET_TEST_P(Case, Name) macro works just like
35b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// TEST_P(Case, Name), except that the test is disabled
36b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// if the platform is not a supported TurboFan target.
37b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#if V8_TURBOFAN_TARGET
38b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST_P(Case, Name) TEST_P(Case, Name)
39b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#else
40b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TEST_P(Case, Name) TEST_P(Case, DISABLED_##Name)
41b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#endif
42b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
43b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
44b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// The TARGET_TYPED_TEST(Case, Name) macro works just like
45b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// TYPED_TEST(Case, Name), except that the test is disabled
46b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch// if the platform is not a supported TurboFan target.
47b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#if V8_TURBOFAN_TARGET
48b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, Name)
49b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#else
50b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#define TARGET_TYPED_TEST(Case, Name) TYPED_TEST(Case, DISABLED_##Name)
51b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#endif
52b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
53b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}  // namespace compiler
54b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}  // namespace internal
55b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch}  // namespace v8
56b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch
57b8a8cc1952d61a2f3a2568848933943a543b5d3eBen Murdoch#endif  // V8_COMPILER_COMPILER_TEST_UTILS_H_
58