Browse Source

fix the benchmarker script by testing for the correct amount of parameters and obtaining the test name correctly

master
Constantin Fürst 1 year ago
parent
commit
21194b7fde
  1. 7
      benchmarks/benchmark-descriptors/benchmarker.sh

7
benchmarks/benchmark-descriptors/benchmarker.sh

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Check if the correct number of arguments is provided # Check if the correct number of arguments is provided
if [ "$#" -ne 3 ]; then
if [ "$#" -ne 4 ]; then
echo "Usage: $0 <program_location> <descriptor-directory> <output-directory> <file-extender>" echo "Usage: $0 <program_location> <descriptor-directory> <output-directory> <file-extender>"
exit 1 exit 1
fi fi
@ -23,8 +23,9 @@ for json_file in "$json_directory"/*.json; do
# Check if there are matching files # Check if there are matching files
if [ -e "$json_file" ]; then if [ -e "$json_file" ]; then
# Execute the program with the JSON file as parameters # Execute the program with the JSON file as parameters
name="${filename%.*}"
bn=$(basename $json_file)
name="${bn%.*}"
echo "running test ${name} ..." echo "running test ${name} ..."
"$program_location" "$json_file" "${output-directory}/${name}${file_extender}.json"
"$program_location" "$json_file" "${output_dir}/${name}${file_extender}.json"
fi fi
done done
Loading…
Cancel
Save