diff --git a/builds/testing.mk b/builds/testing.mk index 4549e0181..e0fe0965e 100644 --- a/builds/testing.mk +++ b/builds/testing.mk @@ -2,6 +2,7 @@ FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c FTBENCH_BIN = $(OBJ_DIR)/bench.o +FTBENCH_FLAG = -c 50 FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf) BASELINE = $(addprefix $(FTBENCH_DIR)/baseline/, $(notdir $(FONTS:.ttf=.txt))) BENCHMARK = $(addprefix $(FTBENCH_DIR)/benchmark/, $(notdir $(FONTS:.ttf=.txt))) @@ -25,7 +26,7 @@ $(FTBENCH_BIN): $(FTBENCH_SRC) | $(OBJ_DIR) baseline: $(FTBENCH_BIN) $(BASELINE_DIR) @echo "Creating baseline..." @$(foreach font, $(FONTS), \ - $(FTBENCH_BIN) $(font) > $(BASELINE_DIR)$(notdir $(font:.ttf=.txt)); \ + $(FTBENCH_BIN) $(FTBENCH_FLAG) $(font) > $(BASELINE_DIR)$(notdir $(font:.ttf=.txt)); \ ) @echo "Baseline created." @@ -34,9 +35,9 @@ baseline: $(FTBENCH_BIN) $(BASELINE_DIR) benchmark: $(FTBENCH_BIN) $(BENCHMARK_DIR) @echo "Creating benchmark..." @$(foreach font, $(FONTS), \ - $(FTBENCH_BIN) $(font) > $(BENCHMARK_DIR)$(notdir $(font:.ttf=.txt)); \ + $(FTBENCH_BIN) $(FTBENCH_FLAG) $(font) > $(BENCHMARK_DIR)$(notdir $(font:.ttf=.txt)); \ ) - @$(PYTHON) $(HTMLCREATOR) > $(HTMLFILE) + @$(PYTHON) $(HTMLCREATOR) @echo "Benchmark created." .PHONY: clean-benchmark diff --git a/src/tools/ftbench/fonts/deactivated/Arial_subset.ttf b/src/tools/ftbench/fonts/Arial_subset.ttf similarity index 100% rename from src/tools/ftbench/fonts/deactivated/Arial_subset.ttf rename to src/tools/ftbench/fonts/Arial_subset.ttf diff --git a/src/tools/ftbench/fonts/deactivated/Tahoma_subset.ttf b/src/tools/ftbench/fonts/Tahoma_subset.ttf similarity index 100% rename from src/tools/ftbench/fonts/deactivated/Tahoma_subset.ttf rename to src/tools/ftbench/fonts/Tahoma_subset.ttf diff --git a/src/tools/ftbench/fonts/deactivated/TimesNewRoman_subset.ttf b/src/tools/ftbench/fonts/TimesNewRoman_subset.ttf similarity index 100% rename from src/tools/ftbench/fonts/deactivated/TimesNewRoman_subset.ttf rename to src/tools/ftbench/fonts/TimesNewRoman_subset.ttf diff --git a/src/tools/ftbench/src/tohtml.py b/src/tools/ftbench/src/tohtml.py index 95b11f3d9..cd5c4ef51 100644 --- a/src/tools/ftbench/src/tohtml.py +++ b/src/tools/ftbench/src/tohtml.py @@ -2,7 +2,15 @@ import os import re # Create the HTML file -with open('../../../../benchmark.html', 'w') as f: +current_dir = os.path.dirname(os.path.abspath(__file__)) + +# Get the project root directory (assuming the script is inside nested directories in the project root) +project_root = os.path.abspath(os.path.join(current_dir, '../../../../')) + +# Construct the absolute path to the benchmark file +benchmark_file = os.path.join(project_root, 'benchmark.html') + +with open(benchmark_file, 'w') as f: f.write('\n') f.write('\n') f.write('Benchmark Results\n') @@ -10,10 +18,10 @@ with open('../../../../benchmark.html', 'w') as f: f.write('\n') f.write('

Benchmark Results

\n') - # Traverse through the 'baselines' directory - for filename in os.listdir('../baseline'): - baseline_filepath = os.path.join('../baseline', filename) - benchmark_filepath = os.path.join('../benchmark', filename) + # Traverse through the 'baseline directory + for filename in os.listdir(os.path.join(project_root, 'src/tools/ftbench/baseline')): + baseline_filepath = os.path.join(os.path.join(project_root, 'src/tools/ftbench/baseline'), filename) + benchmark_filepath = os.path.join(os.path.join(project_root, 'src/tools/ftbench/benchmark'), filename) # Process the baseline file with open(baseline_filepath, 'r') as baseline_file: