Skip to content

Commit bfaffff

Browse files
committed
test: use provided app name in windows ui tests
1 parent bd4a5bb commit bfaffff

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

sample/Tests/test/test_windows_helpers.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -598,16 +598,27 @@ def open_sample_app(clear_data=False):
598598

599599
print(f"Opening {product_name}...")
600600

601-
# Look for the executable in build folder first, then current directory
602-
exe_paths = [
603-
f"../build/{product_name}.exe", # Relative to Tests folder
604-
f"{product_name}.exe" # Current directory (fallback)
605-
]
601+
# Check if UNITY_APP_PATH is provided (takes precedence)
602+
app_path_env = os.getenv("UNITY_APP_PATH")
603+
604+
# Look for the executable in multiple locations
605+
exe_paths = []
606+
607+
# First priority: use UNITY_APP_PATH if provided
608+
if app_path_env:
609+
exe_paths.append(app_path_env)
610+
611+
# Then check standard locations
612+
exe_paths.extend([
613+
f"{product_name}.exe", # Current directory (for Unity 6 builds in Tests/)
614+
f"../build/{product_name}.exe", # Relative to Tests folder (for Unity 2021)
615+
f"./{product_name}.exe", # Explicit current directory
616+
])
606617

607618
exe_launched = False
608619
for exe_path in exe_paths:
609620
if os.path.exists(exe_path):
610-
print(f"Found executable at: {exe_path}")
621+
print(f"Found executable at: {os.path.abspath(exe_path)}")
611622
subprocess.Popen([exe_path], shell=True)
612623
exe_launched = True
613624
break

setup-symlinks.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ try {
4646
cmd /c mklink /D "Scenes" "$scenesTarget" | Out-Null
4747
cmd /c mklink /D "Scripts" "$scriptsTarget" | Out-Null
4848
cmd /c mklink /D "Editor" "$editorTarget" | Out-Null
49-
49+
5050
# Create file symbolic links for .meta files
5151
cmd /c mklink "Scenes.meta" "$scenesMetaTarget" | Out-Null
5252
cmd /c mklink "Scripts.meta" "$scriptsMetaTarget" | Out-Null

0 commit comments

Comments
 (0)