Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/shaderc
Path: blob/main/glslc/test/stdin_out.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, StdinShader
18
19
20
@inside_glslc_testsuite('StdInOut')
21
class VerifyStdinWorks(expect.ValidObjectFile):
22
"""Tests glslc accepts vertex shader extension (.vert)."""
23
24
shader = StdinShader('#version 140\nvoid main() { }')
25
glslc_args = ['-c', '-fshader-stage=vertex', shader]
26
27
28
@inside_glslc_testsuite('StdInOut')
29
class VerifyStdoutWorks(
30
expect.ReturnCodeIsZero, expect.StdoutMatch, expect.StderrMatch):
31
32
shader = FileShader('#version 140\nvoid main() {}', '.vert')
33
glslc_args = [shader, '-o', '-']
34
35
# We expect SOME stdout, we just do not care what.
36
expected_stdout = True
37
expected_stderr = ''
38
39