From 53eb3851d1115bc825bdf1c4d6f9407e8ff414d4 Mon Sep 17 00:00:00 2001 From: Anish Athalye Date: Tue, 18 Apr 2017 22:18:58 -0400 Subject: Make launcher find python binary --- test/tests/find-python-executable.bash | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 test/tests/find-python-executable.bash (limited to 'test') diff --git a/test/tests/find-python-executable.bash b/test/tests/find-python-executable.bash new file mode 100644 index 0000000..cc46724 --- /dev/null +++ b/test/tests/find-python-executable.bash @@ -0,0 +1,58 @@ +test_description='can find python executable with different names' +. '../test-lib.bash' + +# the test machine needs to have a binary named `python` +test_expect_success 'setup' ' +mkdir ~/tmp_bin && +( + IFS=: + for p in $PATH; do + find $p -maxdepth 1 -mindepth 1 -exec sh -c \ + '"'"'ln -sf {} $HOME/tmp_bin/$(basename {})'"'"' \; + done +) && +rm -f ~/tmp_bin/python && +rm -f ~/tmp_bin/python2 && +rm -f ~/tmp_bin/python3 +' + +test_expect_failure 'run' ' +PATH="$HOME/tmp_bin" run_dotbot <> ~/tmp_bin/python <