From c652336860a1dd617976b233bc003505bb1cbeef Mon Sep 17 00:00:00 2001 From: Syphax bouazzouni Date: Tue, 28 Nov 2023 13:29:32 +0100 Subject: [PATCH] fixing the test runner after the new changes in the ontoportal script --- bin/ontoportal | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/bin/ontoportal b/bin/ontoportal index 87a1a170..dedbf59f 100755 --- a/bin/ontoportal +++ b/bin/ontoportal @@ -177,9 +177,30 @@ dev() { # Function to handle the "test" option test() { echo "Running tests..." + local test_path="" + local test_options="" + local all_arguments=() + # Check for command line arguments + while [ "$#" -gt 0 ]; do + case "$1" in + --api-url | --reset-cache | --old-path | --goo-path | --sparql-client-path) + all_arguments+=("$1" "$2") + shift 2 + ;; + *) + if [ -z "$test_path" ]; then + test_path="$1" + else + test_options="$test_options $1" + fi + ;; + esac + shift + done - local custom_command="API_URL=$api_url bundle exec rake test TEST=\"$test_path\" TESTOPTS=\"$test_options\"" - run_command "$custom_command" "$@" + local custom_command="bundle exec rake test TEST='$test_path' TESTOPTS='$test_options'" + echo "run : $custom_command" + run_command "$custom_command" "${all_arguments[@]}" } # Function to handle the "run" option