21
21
22
22
"""
23
23
import pytest
24
- import json
24
+ import shutil
25
25
from pathlib import Path
26
26
from subprocess import TimeoutExpired
27
27
from o3de import manifest
@@ -82,6 +82,7 @@ def test_o3de_registers_engine_fixture(test_installer_fixture, context):
82
82
def test_create_project_fixture (test_o3de_registers_engine_fixture , context ):
83
83
""" o3de.bat CLI creates a project. """
84
84
o3de_path = context .install_root / 'scripts/o3de.bat'
85
+
85
86
result = context .run ([str (o3de_path ),'create-project' ,'--project-path' , str (context .project_path )])
86
87
assert result .returncode == 0 , f"o3de.bat failed to create a project with exit code { result .returncode } "
87
88
@@ -96,15 +97,25 @@ def test_compile_project_fixture(test_create_project_fixture, context):
96
97
cmake_path = next (context .cmake_runtime_path .glob ('**/cmake.exe' ))
97
98
launcher_target = f"{ project_name } .GameLauncher"
98
99
99
- # configure
100
- result = context .run ([str (cmake_path ),'-B' , str (context .project_build_path ), '-S' , '.' ], cwd = context .project_path )
101
- assert result .returncode == 0
102
- assert (context .project_build_path / f'{ project_name } .sln' ).is_file ()
100
+ # configure non-monolithic
101
+ result = context .run ([str (cmake_path ),'-B' , str (context .project_build_path_profile ), '-S' , '.' ], cwd = context .project_path )
102
+ assert result .returncode == 0 , 'Failed to configure the test project non-monolithic build'
103
+ assert (context .project_build_path_profile / f'{ project_name } .sln' ).is_file (), 'No project solution file was created'
104
+
105
+ # build profile (non-monolithic)
106
+ result = context .run ([str (cmake_path ),'--build' , str (context .project_build_path_profile ), '--target' , launcher_target , 'Editor' , '--config' , 'profile' ,'--' ,'-m' ], cwd = context .project_path )
107
+ assert result .returncode == 0 , 'Failed to build the test project profile non-monolithic Launcher and Editor targets'
108
+ assert (context .project_bin_path_profile / f'{ launcher_target } .exe' ).is_file (), 'No test project binary was created'
109
+
110
+ # configure monolithic
111
+ result = context .run ([str (cmake_path ),'-B' , str (context .project_build_path_release ), '-S' , '.' ,'-DLY_MONOLITHIC_GAME=1' ], cwd = context .project_path )
112
+ assert result .returncode == 0 , 'Failed to configure the test project monolithic build'
113
+ assert (context .project_build_path_release / f'{ project_name } .sln' ).is_file (), 'No project solution file was created'
103
114
104
- # build profile, release is not yet supported in the current installer
105
- result = context .run ([str (cmake_path ),'--build' , str (context .project_build_path ), '--target' , launcher_target , 'Editor' , ' --config' , 'profile ' ,'--' ,'-m' ], cwd = context .project_path )
106
- assert result .returncode == 0
107
- assert (context .project_bin_path / f'{ launcher_target } .exe' ).is_file ()
115
+ # build release (monolithic)
116
+ result = context .run ([str (cmake_path ),'--build' , str (context .project_build_path_release ), '--target' , launcher_target , '--config' , 'release ' ,'--' ,'-m' ], cwd = context .project_path )
117
+ assert result .returncode == 0 , 'Failed to build the test project monolithic release Launcher target'
118
+ assert (context .project_bin_path_release / f'{ launcher_target } .exe' ).is_file (), 'No test project binary was created'
108
119
109
120
110
121
@pytest .fixture (scope = "session" )
@@ -155,8 +166,8 @@ def test_run_launcher_fixture(test_run_asset_processor_batch_fixture, context):
155
166
project_name = Path (context .project_path ).name
156
167
launcher_filename = f"{ project_name } .GameLauncher.exe"
157
168
try :
158
- # run launcher for 2 mins
159
- result = context .run ([str (context .project_bin_path / launcher_filename ),'--rhi=null' ], cwd = context .project_bin_path , timeout = 2 * 60 )
169
+ # run profile launcher for 2 mins
170
+ result = context .run ([str (context .project_bin_path_profile / launcher_filename ),'--rhi=null' ], cwd = context .project_bin_path_profile , timeout = 2 * 60 )
160
171
assert result .returncode == 0 , f"{ launcher_filename } failed with exit code { result .returncode } "
161
172
except TimeoutExpired as e :
162
173
# we expect to close the app on timeout ourselves
0 commit comments