From 90d10587e46dfbae634edb25dc8d42e6c3823eb8 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 27 Dec 2022 14:52:20 +0900 Subject: [PATCH] test: Use toolbox in parent directory for tests Because none of the test specs set PATH, tests use the toolbox version that is installed in the environment, not the one that is being tested. This commit modifies the test specs so they prepend the parent directory to PATH. Further, this adds a symbolic link to the includes in the parent directory, making sure the correct includes path is searched first. --- test/array_spec.sh | 2 ++ test/include | 1 + test/ipc_spec.sh | 2 ++ test/is_spec.sh | 2 ++ test/json_spec.sh | 2 ++ test/log_spec.sh | 2 ++ test/mutex_spec.sh | 2 ++ test/opt_spec.sh | 2 ++ test/queue_spec.sh | 2 ++ test/sem_spec.sh | 2 ++ test/uipc_spec.sh | 2 ++ test/wmutex_spec.sh | 2 ++ 12 files changed, 23 insertions(+) create mode 120000 test/include diff --git a/test/array_spec.sh b/test/array_spec.sh index 5699bee..d6f8210 100644 --- a/test/array_spec.sh +++ b/test/array_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + if ! . toolbox.sh; then exit 1 fi diff --git a/test/include b/test/include new file mode 120000 index 0000000..f5030fe --- /dev/null +++ b/test/include @@ -0,0 +1 @@ +../include \ No newline at end of file diff --git a/test/ipc_spec.sh b/test/ipc_spec.sh index 1f956b4..01549e0 100644 --- a/test/ipc_spec.sh +++ b/test/ipc_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + . toolbox.sh include "ipc" diff --git a/test/is_spec.sh b/test/is_spec.sh index c016097..e23df5a 100644 --- a/test/is_spec.sh +++ b/test/is_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + . toolbox.sh include "is" diff --git a/test/json_spec.sh b/test/json_spec.sh index 0d5f93e..3a64876 100644 --- a/test/json_spec.sh +++ b/test/json_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + if ! . toolbox.sh; then exit 1 fi diff --git a/test/log_spec.sh b/test/log_spec.sh index b140b04..13868c6 100644 --- a/test/log_spec.sh +++ b/test/log_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + . toolbox.sh include "log" diff --git a/test/mutex_spec.sh b/test/mutex_spec.sh index 0e44291..ef96d12 100644 --- a/test/mutex_spec.sh +++ b/test/mutex_spec.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH="$PWD/..:$PATH" + . toolbox.sh include "mutex" diff --git a/test/opt_spec.sh b/test/opt_spec.sh index 50d8d66..81a8ab5 100644 --- a/test/opt_spec.sh +++ b/test/opt_spec.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH="$PWD/..:$PATH" + . toolbox.sh include "opt" diff --git a/test/queue_spec.sh b/test/queue_spec.sh index a88ce3f..a921348 100644 --- a/test/queue_spec.sh +++ b/test/queue_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + if ! . toolbox.sh; then exit 1 fi diff --git a/test/sem_spec.sh b/test/sem_spec.sh index f4e0a22..72d1055 100644 --- a/test/sem_spec.sh +++ b/test/sem_spec.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH="$PWD/..:$PATH" + . toolbox.sh include "sem" diff --git a/test/uipc_spec.sh b/test/uipc_spec.sh index 0a21795..9d25806 100644 --- a/test/uipc_spec.sh +++ b/test/uipc_spec.sh @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +export PATH="$PWD/..:$PATH" + . toolbox.sh include "uipc" diff --git a/test/wmutex_spec.sh b/test/wmutex_spec.sh index 61adfec..ad1c5bf 100644 --- a/test/wmutex_spec.sh +++ b/test/wmutex_spec.sh @@ -1,5 +1,7 @@ #!/bin/bash +export PATH="$PWD/..:$PATH" + . toolbox.sh include "wmutex" -- 2.47.3