Integrating latest 47acbe8

This commit is contained in:
alexpete
2021-03-25 13:57:57 -07:00
parent 448c549698
commit 75dc720198
10312 changed files with 2711566 additions and 671451 deletions
+10
View File
@@ -0,0 +1,10 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
+212
View File
@@ -0,0 +1,212 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
BuildSystems BAT to automate building on packages for Windows
"""
import logging
import pytest
import os
pytest.importorskip('ly_test_tools')
import ly_test_tools.builtin.helpers as helpers
from .test_lib import build_helper
logger = logging.getLogger(__name__)
@pytest.mark.BAT
@pytest.mark.parametrize('spec', ['all'])
@pytest.mark.parametrize('project', ['SamplesProject'])
class TestWindowsBuildConfig(object):
"""
Automated tests for all the build configurations for Windows.
Test cases live in Repository/Build System/Lumberyard Builds/Configurations
"""
@pytest.mark.test_case_id('C15723869')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['profile'])
@pytest.mark.build
def test_build_win_x64_vs2017_profile(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15723870')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['profile_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2017_profile_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15723871')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['profile_test'])
@pytest.mark.build
def test_build_win_x64_vs2017_profile_test(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15723872')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['profile_test_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2017_profile_test_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15716369')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['debug'])
@pytest.mark.build
def test_build_win_x64_vs2017_debug(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15716370')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['debug_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2017_debug_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15716371')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['debug_test'])
@pytest.mark.build
def test_build_win_x64_vs2019_debug_test(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15716372')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['debug_test_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2017_debug_test_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15723889')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['release'])
@pytest.mark.build
def test_build_win_x64_vs2017_release(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15723890')
@pytest.mark.parametrize('platform', ['win_x64_vs2017'])
@pytest.mark.parametrize('configuration', ['release_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2017_release_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815180')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['profile'])
@pytest.mark.build
def test_build_win_x64_vs2019_profile(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815181')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['profile_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2019_profile_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815182')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['profile_test'])
@pytest.mark.build
def test_build_win_x64_vs2019_profile_test(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815183')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['profile_test_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2019_profile_test_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815174')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['debug'])
@pytest.mark.build
def test_build_win_x64_vs2019_debug(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815175')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['debug_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2019_debug_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815176')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['debug_test'])
@pytest.mark.build
def test_build_win_x64_vs2019_debug_test(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815177')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['debug_test_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2019_debug_test_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815190')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['release'])
@pytest.mark.build
def test_build_win_x64_vs2019_release(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
@pytest.mark.test_case_id('C15815191')
@pytest.mark.parametrize('platform', ['win_x64_vs2019'])
@pytest.mark.parametrize('configuration', ['release_dedicated'])
@pytest.mark.build
def test_build_win_x64_vs2019_release_dedicated(self, workspace, platform, configuration, project, spec):
workspace.build()
build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log')
assert build_helper.verify_build_log(build_log, platform, configuration)
+10
View File
@@ -0,0 +1,10 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
@@ -0,0 +1,38 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Helper functions for build systems
"""
import os
import logging
logger = logging.getLogger(__name__)
def verify_build_log(build_log_path, platform, configuration):
"""
This will search the log file for an expected success message for a specific platform configuration.
:param build_log_path: the full path to the log file. e.g. \\dev\TestResults\timestamp_folder\pytest_results\...
:param platform: the compiler to use, e.g. "win_x64_vs2017"
:param configuration: the flavor of the build, e.g. "profile"
:return: True, if success message is found within the build log. False, if success message is not found and raise an assertion error if the build log cannot be found.
"""
success_message = "[WAF] 'build_{0}_{1}' finished successfully".format(platform, configuration)
if os.path.exists(build_log_path):
with open(build_log_path) as build_file:
for line in build_file:
if success_message in line:
logger.info('Success message was found for {0}_{1}'.format(platform, configuration))
return True
logger.info('Success message not found for {0}_{1}'.format(platform, configuration))
return False
else:
logger.info('We cannot find the build log and this is the path we are looking for {0}'.format(build_log_path))
raise AssertionError