diff --git a/scripts/run_docker_compare.bash b/scripts/run_docker_compare.bash index 30cdb92a..7ac76e64 100755 --- a/scripts/run_docker_compare.bash +++ b/scripts/run_docker_compare.bash @@ -9,14 +9,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" : ${BACKTRACE:="NO"} # or YES to print a rust backtrace when panicking : ${NO_COLOR:=""} # Set to anything to disable color output - cd "$DIR/../" REALPATH=$(command -v uu-realpath || command -v realpath) MAKE=$(command -v gmake || command -v make) function main { build_container - launch_container + launch_container "${@}" } function build_container { @@ -51,7 +50,17 @@ function launch_container { additional_flags+=(--env RUST_BACKTRACE=full) fi - docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}" + if [ $# -gt 0 ]; then + # If we passed in args, we need to forward them along + for path in "${@}"; do + local full_path=$($REALPATH "$path") + local containing_folder=$(dirname "$full_path") + local file_name=$(basename "$full_path") + docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "${containing_folder}:/input:ro" -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}" -- "/input/$file_name" + done + else + docker run "${additional_flags[@]}" --init --rm -i --mount type=tmpfs,destination=/tmp -v "$($REALPATH ./):/source:ro" --mount source=cargo-cache,target=/usr/local/cargo/registry --mount source=rust-cache,target=/target --env CARGO_TARGET_DIR=/target -w /source --entrypoint "" organic-test "${additional_args[@]}" + fi } main "${@}" diff --git a/scripts/time_parse.bash b/scripts/time_parse.bash index 70e2a576..817bada2 100755 --- a/scripts/time_parse.bash +++ b/scripts/time_parse.bash @@ -17,7 +17,7 @@ function main { additional_flags+=(--profile "$PROFILE") fi cargo build --no-default-features "${additional_flags[@]}" - time ./target/${PROFILE}/parse + time ./target/${PROFILE}/parse "${@}" } main "${@}"