5#include <initializer_list>
8#include "flutter/fml/command_line.h"
9#include "flutter/fml/file.h"
10#include "flutter/testing/testing.h"
19 std::initializer_list<const char*> additional_options = {}) {
20 std::vector<const char*>
options = {
"--opengl-desktop",
"--input=input.vert",
22 "--spirv=output.spirv"};
24 additional_options.end());
31TEST(SwitchesTest, DoesntMangleUnicodeIncludes) {
32 const char* directory_name =
"test_shader_include_�";
42 ASSERT_TRUE(switches.
AreValid(std::cout));
48TEST(SwitchesTest, SourceLanguageDefaultsToGLSL) {
50 ASSERT_TRUE(switches.
AreValid(std::cout));
54TEST(SwitchesTest, SourceLanguageCanBeSetToHLSL) {
56 ASSERT_TRUE(switches.
AreValid(std::cout));
60TEST(SwitchesTest, DefaultEntryPointIsMain) {
62 ASSERT_TRUE(switches.
AreValid(std::cout));
66TEST(SwitchesTest, EntryPointCanBeSetForHLSL) {
68 ASSERT_TRUE(switches.
AreValid(std::cout));
69 ASSERT_EQ(switches.
entry_point,
"CustomEntryPoint");
74 "mandelbrot_unrolled");
76 "mandelbrotunrolled");
83TEST(SwitchesTest, ShaderBundleModeValid) {
86 std::vector<const char*>
options = {
87 "--shader-bundle={}",
"--sl=test.shaderbundle",
"--runtime-stage-metal"};
92 ASSERT_TRUE(switches.
AreValid(std::cout));
SourceLanguage source_language
std::string shader_bundle
bool AreValid(std::ostream &explain) const
std::vector< IncludeDir > include_directories
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
fml::UniqueFD OpenFixturesDirectory()
Opens the fixtures directory for the unit-test harness.
static fml::UniqueFD CreateDirectory(const fml::UniqueFD &base_directory, const std::vector< std::string > &components, FilePermission permission, size_t index)
CommandLine CommandLineFromIteratorsWithArgv0(const std::string &argv0, InputIterator first, InputIterator last)
TEST(CompilerTest, ShaderKindMatchingIsSuccessful)
Switches MakeSwitchesDesktopGL(std::initializer_list< const char * > additional_options={})
std::string ConvertToEntrypointName(std::string_view string)
Ensure that the entrypoint name is a valid identifier in the target language.