From d0631f18e075f8df620e126edde80c3e45888bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Mon, 4 Dec 2023 13:01:29 +0100 Subject: [PATCH] write script to re-run existing benchmarks in a given folder --- benchmarks/run-all-benchmarks-in-folder.sh | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 benchmarks/run-all-benchmarks-in-folder.sh diff --git a/benchmarks/run-all-benchmarks-in-folder.sh b/benchmarks/run-all-benchmarks-in-folder.sh new file mode 100644 index 0000000..bf4fffb --- /dev/null +++ b/benchmarks/run-all-benchmarks-in-folder.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Check if the correct number of arguments is provided +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Assign arguments to variables +program_location="$1" +json_directory="$2" + +# Check if the specified directory exists +if [ ! -d "$json_directory" ]; then + echo "Error: Directory $json_directory not found." + exit 1 +fi + +# Iterate over all JSON files in the directory +for json_file in "$json_directory"/*.json; do + # Check if there are matching files + if [ -e "$json_file" ]; then + # Execute the program with the JSON file as parameters + "$program_location" "$json_file" "$json_file" + fi +done