mirror of
https://github.com/LTTLabsOSS/markbench-tests.git
synced 2026-01-09 14:07:56 -05:00
Pugetbench logic updates for 1.4 changes.
This commit is contained in:
@@ -134,27 +134,29 @@ def main():
|
||||
|
||||
version = args.app_version
|
||||
score = 0
|
||||
full_version = None
|
||||
trimmed_version = None
|
||||
test = ""
|
||||
if args.app == "premierepro":
|
||||
test = "Adobe Premiere Pro"
|
||||
if version is None:
|
||||
version = get_premierepro_version()
|
||||
full_version, trimmed_version = get_premierepro_version()
|
||||
elif args.app == "photoshop":
|
||||
test = "Adobe Photoshop"
|
||||
if version is None:
|
||||
version = get_photoshop_version()
|
||||
full_version, trimmed_version = get_photoshop_version()
|
||||
elif args.app == "aftereffects":
|
||||
test = "Adobe After Effects"
|
||||
if version is None:
|
||||
version = get_aftereffects_version()
|
||||
full_version, trimmed_version = get_aftereffects_version()
|
||||
elif args.app == "resolve":
|
||||
test = "Davinci Resolve Studio"
|
||||
if version is None:
|
||||
version = get_davinci_version() + "-studio"
|
||||
full_version, trimmed_version = get_davinci_version() + "-studio"
|
||||
|
||||
try:
|
||||
start_time, end_time = run_benchmark(
|
||||
args.app, version, args.benchmark_version)
|
||||
args.app, trimmed_version, args.benchmark_version)
|
||||
log_file = find_latest_log()
|
||||
score = find_score_in_log(log_file)
|
||||
destination = Path(script_dir) / "run" / os.path.split(log_file)[1]
|
||||
@@ -165,7 +167,7 @@ def main():
|
||||
"end_time": seconds_to_milliseconds(end_time),
|
||||
"test": "PugetBench",
|
||||
"test_parameter": test,
|
||||
"app_version": version,
|
||||
"app_version": full_version,
|
||||
"benchmark_version": args.benchmark_version,
|
||||
"pugetbench_version": get_pugetbench_version(),
|
||||
"unit": "Score",
|
||||
|
||||
@@ -99,15 +99,20 @@ def find_score_in_log(log_path):
|
||||
|
||||
|
||||
def get_photoshop_version() -> str:
|
||||
"""Get the current installed Adobe Premiere Pro version string."""
|
||||
base_path = "C:\\Program Files\\Adobe"
|
||||
|
||||
# Look for Adobe Premiere Pro folders
|
||||
"""Get the installed Adobe Photoshop version string, prioritizing Beta versions."""
|
||||
base_path = r"C:\Program Files\Adobe"
|
||||
|
||||
# Check if Adobe folder exists
|
||||
if not os.path.exists(base_path):
|
||||
print("Adobe directory not found.")
|
||||
return None
|
||||
|
||||
# Look for Adobe Photoshop folders
|
||||
possible_versions = sorted(
|
||||
[d for d in os.listdir(base_path) if "Adobe Photoshop" in d],
|
||||
reverse=True # Prioritize newer versions
|
||||
)
|
||||
|
||||
|
||||
for folder in possible_versions:
|
||||
exe_path = os.path.join(base_path, folder, "Photoshop.exe")
|
||||
if os.path.exists(exe_path):
|
||||
@@ -116,13 +121,19 @@ def get_photoshop_version() -> str:
|
||||
exe_path, "\\VarFileInfo\\Translation"
|
||||
)[0]
|
||||
str_info_path = f"\\StringFileInfo\\{lang:04X}{codepage:04X}\\ProductVersion"
|
||||
return win32api.GetFileVersionInfo(exe_path, str_info_path)
|
||||
full_version = win32api.GetFileVersionInfo(exe_path, str_info_path)
|
||||
|
||||
# Trim to major.minor
|
||||
parts = full_version.split(".")
|
||||
major_minor = ".".join(parts[:2]) if len(parts) >= 2 else full_version
|
||||
|
||||
return full_version, major_minor
|
||||
except Exception as e:
|
||||
print(f"Error reading version from {exe_path}: {e}")
|
||||
|
||||
return None # No valid installation found
|
||||
return None, None
|
||||
|
||||
def get_aftereffects_version() -> str:
|
||||
def get_aftereffects_version() -> tuple[str, str]:
|
||||
"""Get the installed Adobe After Effects version string, prioritizing Beta versions."""
|
||||
base_path = r"C:\Program Files\Adobe"
|
||||
|
||||
@@ -151,17 +162,28 @@ def get_aftereffects_version() -> str:
|
||||
if info:
|
||||
lang, codepage = info[0]
|
||||
str_info_path = f"\\StringFileInfo\\{lang:04X}{codepage:04X}\\ProductVersion"
|
||||
return str(win32api.GetFileVersionInfo(exe_path, str_info_path))
|
||||
full_version = str(win32api.GetFileVersionInfo(exe_path, str_info_path))
|
||||
|
||||
# Trim to major.minor
|
||||
parts = full_version.split(".")
|
||||
major_minor = ".".join(parts[:2]) if len(parts) >= 2 else full_version
|
||||
|
||||
return full_version, major_minor
|
||||
except Exception as e:
|
||||
print(f"Error reading version from {exe_path}: {e}")
|
||||
|
||||
return None # No valid installation found
|
||||
return None, None
|
||||
|
||||
|
||||
def get_premierepro_version() -> str:
|
||||
def get_premierepro_version() -> tuple[str, str]:
|
||||
"""Get the current installed Adobe Premiere Pro version string."""
|
||||
base_path = "C:\\Program Files\\Adobe"
|
||||
|
||||
base_path = r"C:\Program Files\Adobe"
|
||||
|
||||
# Check if Adobe folder exists
|
||||
if not os.path.exists(base_path):
|
||||
print("Adobe directory not found.")
|
||||
return None
|
||||
|
||||
# Look for Adobe Premiere Pro folders
|
||||
possible_versions = sorted(
|
||||
[d for d in os.listdir(base_path) if "Adobe Premiere Pro" in d],
|
||||
@@ -176,27 +198,45 @@ def get_premierepro_version() -> str:
|
||||
exe_path, "\\VarFileInfo\\Translation"
|
||||
)[0]
|
||||
str_info_path = f"\\StringFileInfo\\{lang:04X}{codepage:04X}\\ProductVersion"
|
||||
return win32api.GetFileVersionInfo(exe_path, str_info_path)
|
||||
full_version = win32api.GetFileVersionInfo(exe_path, str_info_path)
|
||||
|
||||
# Trim to major.minor
|
||||
parts = full_version.split(".")
|
||||
major_minor = ".".join(parts[:2]) if len(parts) >= 2 else full_version
|
||||
|
||||
return full_version, major_minor
|
||||
except Exception as e:
|
||||
print(f"Error reading version from {exe_path}: {e}")
|
||||
|
||||
return None # No valid installation found
|
||||
return None, None
|
||||
|
||||
|
||||
def get_davinci_version() -> str:
|
||||
"""get current photoshop version string"""
|
||||
path = "C:\\Program Files\\Blackmagic Design\\DaVinci Resolve\\Resolve.exe"
|
||||
"""Get the current installed Davinci Resolve Studio version string."""
|
||||
path = r"C:\Program Files\Blackmagic Design\DaVinci Resolve\Resolve.exe"
|
||||
if not os.path.exists(path):
|
||||
print("DaVinci Resolve executable not found.")
|
||||
return None, None
|
||||
|
||||
try:
|
||||
lang, codepage = win32api.GetFileVersionInfo(
|
||||
path, "\\VarFileInfo\\Translation")[0]
|
||||
path, "\\VarFileInfo\\Translation"
|
||||
)[0]
|
||||
str_info_path = f"\\StringFileInfo\\{lang:04X}{codepage:04X}\\ProductVersion"
|
||||
return win32api.GetFileVersionInfo(path, str_info_path)
|
||||
full_version = win32api.GetFileVersionInfo(path, str_info_path)
|
||||
|
||||
# Trim to major.minor
|
||||
parts = full_version.split(".")
|
||||
major_minor = ".".join(parts[:2]) if len(parts) >= 2 else full_version
|
||||
|
||||
return full_version, major_minor
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return None
|
||||
print(f"Error reading version from {path}: {e}")
|
||||
return None, None
|
||||
|
||||
def get_pugetbench_version() -> str:
|
||||
"""get current premiere pro version string"""
|
||||
"""Get the current installed PugetBench version string."""
|
||||
path = "C:\\Program Files\\PugetBench for Creators\\PugetBench for Creators.exe"
|
||||
try:
|
||||
lang, codepage = win32api.GetFileVersionInfo(
|
||||
|
||||
Reference in New Issue
Block a user