mirror of
https://github.com/LTTLabsOSS/markbench-tests.git
synced 2026-01-09 14:07:56 -05:00
25 lines
744 B
Python
25 lines
744 B
Python
"""Utility functions for Cinebench 2024 test script"""
|
|
import re
|
|
|
|
SCORE_PATTERN = re.compile(r"^CB (\d+\.\d+) \(.+\)$")
|
|
|
|
def get_score(output: str) -> str | None:
|
|
"""Finds score pattern from output string"""
|
|
for line in reversed(output.splitlines()):
|
|
match = SCORE_PATTERN.search(line)
|
|
if match:
|
|
return match.group(1)
|
|
|
|
return None
|
|
|
|
|
|
def friendly_test_name(test: str) -> str:
|
|
"""Return a friendlier string given a test argument"""
|
|
if test == "g_CinebenchCpu1Test=true":
|
|
return "Cinebench 2024 Single Core"
|
|
if test == "g_CinebenchCpuXTest=true":
|
|
return "Cinebench 2024 Multicore"
|
|
if test == "g_CinebenchGpuTest=true":
|
|
return "Cinebench 2024 GPU"
|
|
return test
|
|
|