# [PATCH] t3008: find test-tool through path lookup

2 messages from 2019-12-22 to 2020-01-01. Participants: Johannes Sixt, Johannes Schindelin.
Thread: https://gitlist.dev/t/52508

## Johannes Sixt, 2019-12-22 15:03

Subject: [PATCH] t3008: find test-tool through path lookup
Message-ID: <2dc0b0f3-19ce-62ab-5af9-fdb2d05b00bd@kdbg.org>
URL: https://gitlist.dev/e/2dc0b0f3-19ce-62ab-5af9-fdb2d05b00bd%40kdbg.org

```
Do not use $GIT_BUILD_DIR without quotes; it may contain spaces and be
split into fields. But it is not necessary to access test-tool with an
absolute path in the first place as it can be found via path lookup.
Remove the explicit path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 Found this today coincidentally when I happened to look at the terminal
 with test output at the right time and saw a suspicous error message
 that included just one half of the build directory path.

 -- Hannes

 t/t3008-ls-files-lazy-init-name-hash.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh
index 64f047332b..85f3704958 100755
--- a/t/t3008-ls-files-lazy-init-name-hash.sh
+++ b/t/t3008-ls-files-lazy-init-name-hash.sh
@@ -4,7 +4,7 @@ test_description='Test the lazy init name hash with various folder structures'
 
 . ./test-lib.sh
 
-if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus)
+if test 1 -eq $(test-tool online-cpus)
 then
 	skip_all='skipping lazy-init tests, single cpu'
 	test_done
-- 
2.24.1.524.gae569673ff


```

## Johannes Schindelin, 2020-01-01 22:19

Subject: Re: [PATCH] t3008: find test-tool through path lookup
Message-ID: <nycvar.QRO.7.76.6.2001012319200.46@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.2001012319200.46%40tvgsbejvaqbjf.bet
In-Reply-To: <2dc0b0f3-19ce-62ab-5af9-fdb2d05b00bd@kdbg.org>

```
Hi Hannes,

On Sun, 22 Dec 2019, Johannes Sixt wrote:

> Do not use $GIT_BUILD_DIR without quotes; it may contain spaces and be
> split into fields. But it is not necessary to access test-tool with an
> absolute path in the first place as it can be found via path lookup.
> Remove the explicit path.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  Found this today coincidentally when I happened to look at the terminal
>  with test output at the right time and saw a suspicous error message
>  that included just one half of the build directory path.

This patch looks good to me.

Thanks,
Dscho

>
>  -- Hannes
>
>  t/t3008-ls-files-lazy-init-name-hash.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t3008-ls-files-lazy-init-name-hash.sh b/t/t3008-ls-files-lazy-init-name-hash.sh
> index 64f047332b..85f3704958 100755
> --- a/t/t3008-ls-files-lazy-init-name-hash.sh
> +++ b/t/t3008-ls-files-lazy-init-name-hash.sh
> @@ -4,7 +4,7 @@ test_description='Test the lazy init name hash with various folder structures'
>
>  . ./test-lib.sh
>
> -if test 1 -eq $($GIT_BUILD_DIR/t/helper/test-tool online-cpus)
> +if test 1 -eq $(test-tool online-cpus)
>  then
>  	skip_all='skipping lazy-init tests, single cpu'
>  	test_done
> --
> 2.24.1.524.gae569673ff
>
>

```
