Skip to content

Commit

Permalink
Make benchmark script independent of external libs
Browse files Browse the repository at this point in the history
Signed-off-by: Henrik Panhans <hpanhans@kayak.com>
  • Loading branch information
henrik-dmg committed Mar 7, 2024
1 parent ef848b4 commit 836c2e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import subprocess
import sys
import time
from distutils.dir_util import copy_tree
from shutil import copytree
from os import path
from pathlib import Path
from shutil import copy2, rmtree
Expand Down Expand Up @@ -34,15 +34,15 @@ def exit_handler():

# Copy template files
TEMPLATE_FILES_FOLDER = "Example/Template Files/"
copy_tree(TEMPLATE_FILES_FOLDER, "Benchmark/Template Files/")
copytree(TEMPLATE_FILES_FOLDER, "Benchmark/Template Files/")

# Copying over screenshots and titles
for locale in LOCALES:
print(f"Copying files for {locale}")
for device in ["iPhone X", "iPad Pro"]:
screenshot_source_folder = f"Example/Screenshots/{device}/en"
screenshot_target_folder = f"Benchmark/Screenshots/{device}/{locale}"
copy_tree(screenshot_source_folder, screenshot_target_folder)
copytree(screenshot_source_folder, screenshot_target_folder)

STRING_SOURCE_FILE = "Example/Strings/en.strings"
STRING_DESTINATION_FILE = f"Benchmark/Strings/{locale}.strings"
Expand All @@ -56,7 +56,7 @@ def exit_handler():
compile_process = subprocess.run("swift build -c release", shell=True, check=True)

if compile_process.returncode != 0:
exit(compile_process.returncode)
sys.exit(compile_process.returncode)

# Running benchmark
benchmark_start = time.time()
Expand Down

0 comments on commit 836c2e6

Please sign in to comment.