1 // Copyright 2017 The Shaderc Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include <gmock/gmock.h>
16 #include "shaderc_private.h"
17 
18 namespace {
19 
TEST(ConvertSpecificStage,Exhaustive)20 TEST(ConvertSpecificStage, Exhaustive) {
21   EXPECT_EQ(shaderc_util::Compiler::Stage::Vertex,
22             shaderc_convert_specific_stage(shaderc_vertex_shader));
23   EXPECT_EQ(shaderc_util::Compiler::Stage::Fragment,
24             shaderc_convert_specific_stage(shaderc_fragment_shader));
25   EXPECT_EQ(shaderc_util::Compiler::Stage::TessControl,
26             shaderc_convert_specific_stage(shaderc_tess_control_shader));
27   EXPECT_EQ(shaderc_util::Compiler::Stage::TessEval,
28             shaderc_convert_specific_stage(shaderc_tess_evaluation_shader));
29   EXPECT_EQ(shaderc_util::Compiler::Stage::Geometry,
30             shaderc_convert_specific_stage(shaderc_geometry_shader));
31   EXPECT_EQ(shaderc_util::Compiler::Stage::Compute,
32             shaderc_convert_specific_stage(shaderc_compute_shader));
33   EXPECT_EQ(shaderc_util::Compiler::Stage::RayGenNV,
34             shaderc_convert_specific_stage(shaderc_raygen_shader));
35   EXPECT_EQ(shaderc_util::Compiler::Stage::AnyHitNV,
36             shaderc_convert_specific_stage(shaderc_anyhit_shader));
37   EXPECT_EQ(shaderc_util::Compiler::Stage::ClosestHitNV,
38             shaderc_convert_specific_stage(shaderc_closesthit_shader));
39   EXPECT_EQ(shaderc_util::Compiler::Stage::IntersectNV,
40             shaderc_convert_specific_stage(shaderc_intersection_shader));
41   EXPECT_EQ(shaderc_util::Compiler::Stage::MissNV,
42             shaderc_convert_specific_stage(shaderc_miss_shader));
43   EXPECT_EQ(shaderc_util::Compiler::Stage::CallableNV,
44             shaderc_convert_specific_stage(shaderc_callable_shader));
45   EXPECT_EQ(shaderc_util::Compiler::Stage::TaskNV,
46             shaderc_convert_specific_stage(shaderc_task_shader));
47   EXPECT_EQ(shaderc_util::Compiler::Stage::MeshNV,
48             shaderc_convert_specific_stage(shaderc_mesh_shader));
49 }
50 }  // anonymous namespace
51