Files
o3de/AutomatedTesting/Gem/PythonTests/smoke/test_StaticTools_GenPakShaders_Works.py
T
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
2021-06-30 19:51:55 -07:00

40 lines
1.4 KiB
Python

"""
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Static tool scripts
Launch Static tool and Verify the help message
"""
import os
import pytest
import subprocess
import sys
def verify_help_message(static_tool):
help_message = ["--help", "show this help message and exit"]
output = subprocess.run([sys.executable, static_tool, "-h"], capture_output=True)
assert (
len(output.stderr) == 0 and output.returncode == 0
), f"Error occurred while launching {static_tool}: {output.stderr}"
# verify help message
for message in help_message:
assert message in str(output.stdout), f"Help Message: {message} is not present"
@pytest.mark.parametrize("project", ["AutomatedTesting"])
@pytest.mark.SUITE_smoke
class TestStaticToolsGenPakShadersWorks(object):
def test_StaticTools_GenPakShaders_Works(self, editor):
static_tools = [
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "gen_shaders.py"),
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "get_shader_list.py"),
os.path.join(editor.workspace.paths.engine_root(), "scripts", "bundler", "pak_shaders.py"),
]
for tool in static_tools:
verify_help_message(tool)