| Flutter Impeller |

compiler_test.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter 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 #ifndef FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_
6 #define FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_
7
8 #include "flutter/testing/testing.h"
9 #include "impeller/base/validation.h"
10 #include "impeller/compiler/compiler.h"
11 #include "impeller/compiler/source_options.h"
12 #include "impeller/compiler/types.h"
13
14 namespace impeller {
15 namespace compiler {
16 namespace testing {
17
18 class CompilerTest : public ::testing::TestWithParam<TargetPlatform> {
19 public:
20 CompilerTest();
21
22 ~CompilerTest();
23
24 std::unique_ptr<fml::FileMapping> GetReflectionJson(
25 const char* fixture_name) const;
26
27 std::unique_ptr<fml::FileMapping> GetShaderFile(
28 const char* fixture_name,
29 TargetPlatform platform) const;
30
31 bool CanCompileAndReflect(
32 const char* fixture_name,
33 SourceType source_type = SourceType::kUnknown,
34 SourceLanguage source_language = SourceLanguage::kGLSL,
35 const char* entry_point_name = "main") const;
36
37 private:
38 std::string intermediates_path_;
39 fml::UniqueFD intermediates_directory_;
40
41 CompilerTest(const CompilerTest&) = delete;
42
43 CompilerTest& operator=(const CompilerTest&) = delete;
44 };
45
46 } // namespace testing
47 } // namespace compiler
48 } // namespace impeller
49
50 #endif // FLUTTER_IMPELLER_COMPILER_COMPILER_TEST_H_
impeller::compiler::testing::CompilerTest
Definition: compiler_test.h:18
impeller::compiler::testing::CompilerTest::CanCompileAndReflect
bool CanCompileAndReflect(const char *fixture_name, SourceType source_type=SourceType::kUnknown, SourceLanguage source_language=SourceLanguage::kGLSL, const char *entry_point_name="main") const
Definition: compiler_test.cc:86
impeller::compiler::testing::CompilerTest::GetReflectionJson
std::unique_ptr< fml::FileMapping > GetReflectionJson(const char *fixture_name) const
Definition: compiler_test.cc:71
impeller::compiler::testing::CompilerTest::GetShaderFile
std::unique_ptr< fml::FileMapping > GetShaderFile(const char *fixture_name, TargetPlatform platform) const
Definition: compiler_test.cc:78
impeller::compiler::testing::CompilerTest::CompilerTest
CompilerTest()
Definition: compiler_test.cc:26
impeller::compiler::testing::CompilerTest::~CompilerTest
~CompilerTest()
Definition: compiler_test.cc:34
types.h
compiler.h
impeller::compiler::SourceType
SourceType
Definition: types.h:21
impeller::compiler::SourceType::kUnknown
@ kUnknown
impeller::compiler::SourceLanguage
SourceLanguage
Definition: types.h:42
impeller::compiler::SourceLanguage::kGLSL
@ kGLSL
impeller::compiler::TargetPlatform
TargetPlatform
Definition: types.h:28
impeller
Definition: allocation.cc:12
source_options.h
validation.h