Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/shaderc
Path: blob/main/glslc/test/option_dash_c.py
1560 views
1
# Copyright 2015 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
import expect
16
from glslc_test_framework import inside_glslc_testsuite
17
from placeholder import FileShader
18
19
20
def empty_es_310_shader():
21
return '#version 310 es\n void main() {}\n'
22
23
24
@inside_glslc_testsuite('OptionC')
25
class TestSingleDashCSingleFile(expect.ValidObjectFile):
26
"""Tests that glslc accepts -c [filename]."""
27
28
shader = FileShader(empty_es_310_shader(), '.vert')
29
glslc_args = ['-c', shader]
30
31
32
@inside_glslc_testsuite('OptionC')
33
class TestSingleFileSingleDashC(expect.ValidObjectFile):
34
"""Tests that glslc accepts [filename] -c."""
35
36
shader = FileShader(empty_es_310_shader(), '.vert')
37
glslc_args = [shader, '-c']
38
39
40
@inside_glslc_testsuite('OptionC')
41
class TestMultipleFiles(expect.ValidObjectFile):
42
"""Tests that glslc accepts -c and multiple source files."""
43
44
shader1 = FileShader(empty_es_310_shader(), '.vert')
45
shader2 = FileShader(empty_es_310_shader(), '.frag')
46
glslc_args = ['-c', shader1, shader2]
47
48
49
@inside_glslc_testsuite('OptionC')
50
class TestMultipleDashC(expect.ValidObjectFile):
51
"""Tests that glslc accepts multiple -c and treated them as one."""
52
53
shader1 = FileShader(empty_es_310_shader(), '.vert')
54
shader2 = FileShader(empty_es_310_shader(), '.vert')
55
glslc_args = ['-c', shader1, '-c', '-c', shader2]
56
57