Skip to content

Commit

Permalink
Fix bug in PATH cleaning, more robust installation detection
Browse files Browse the repository at this point in the history
The previous implementation gobbled up the first entry of the PATH by interpreting the second argument as pattern.
New implementation avoids this and is more robust in detecting existing KLEE installations.
  • Loading branch information
MartinNowack authored and misonijnik committed Oct 23, 2024
1 parent db17e10 commit 2541da0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ run_tests() {
# TODO change to pinpoint specific directory
cd "${build_dir}"

# Remove klee from PATH
export PATH=${PATH/":/home/klee/klee_build/bin"/}
# Remove klee from PATH. The goal is that for test cases klee is referenced via `%klee` not accidently being picked up via PATH
if which klee; then
return 1 # should not happen
full_path_to_klee="$(which klee)"
target_directory="$(dirname "${full_path_to_klee}")"
PATH=${PATH/$target_directory/}
if which klee; then
return 1 # should not happen
fi
fi

###############################################################################
Expand Down

0 comments on commit 2541da0

Please sign in to comment.