Path: blob/main/glslc/test/option_dashdash_version.py
1560 views
# Copyright 2016 The Shaderc Authors. All rights reserved.1#2# Licensed under the Apache License, Version 2.0 (the "License");3# you may not use this file except in compliance with the License.4# You may obtain a copy of the License at5#6# http://www.apache.org/licenses/LICENSE-2.07#8# Unless required by applicable law or agreed to in writing, software9# distributed under the License is distributed on an "AS IS" BASIS,10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11# See the License for the specific language governing permissions and12# limitations under the License.1314import expect15from glslc_test_framework import inside_glslc_testsuite16import re1718@inside_glslc_testsuite('OptionDashDashVersion')19class TestVersionContainsShaderc(expect.StdoutMatch, expect.ReturnCodeIsZero):20"""Tests --version output contains 'shaderc'."""21glslc_args = ['--version']22expected_stdout = re.compile('^shaderc')232425@inside_glslc_testsuite('OptionDashDashVersion')26class TestVersionContainsSpirvTools(expect.StdoutMatch, expect.ReturnCodeIsZero):27"""Tests --version output contains 'spirv-tools'."""28glslc_args = ['--version']29expected_stdout = re.compile('\nspirv-tools')303132@inside_glslc_testsuite('OptionDashDashVersion')33class TestVersionContainsGlslang(expect.StdoutMatch, expect.ReturnCodeIsZero):34"""Tests --version output contains 'glslang'."""35glslc_args = ['--version']36expected_stdout = re.compile('\nglslang')373839@inside_glslc_testsuite('OptionDashDashVersion')40class TestVersionContainsTarget(expect.StdoutMatch, expect.ReturnCodeIsZero):41"""Tests --version output contains 'Target:'."""42glslc_args = ['--version']43expected_stdout = re.compile('\nTarget: SPIR-V \d+\.\d+')444546