return 0
}
+whereami() {
+ local scriptpath
+
+ if ! scriptpath=$(realpath "${BASH_SOURCE[0]}"); then
+ return 1
+ fi
+
+ echo "${scriptpath%/*}"
+ return 0
+}
+
+use_this_toolbox() {
+ local here
+
+ if ! here=$(whereami); then
+ return 1
+ fi
+
+ if ! export PATH="$here:$PATH"; then
+ return 1
+ fi
+
+ return 0
+}
+
{
+ if ! use_this_toolbox; then
+ exit 1
+ fi
+
if ! . toolbox.sh; then
exit 1
fi
#!/bin/bash
# array_spec.sh - Test cases for the toolbox array module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
if ! . toolbox.sh; then
exit 1
fi
+++ /dev/null
-../include
\ No newline at end of file
#!/bin/bash
# ipc_spec.sh - Test cases for the toolbox ipc module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "ipc"
#!/bin/bash
# is_spec.sh - Test cases for the toolbox is module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "is"
#!/bin/bash
# json_spec.sh - Test cases for the toolbox json module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
if ! . toolbox.sh; then
exit 1
fi
#!/bin/bash
# log_spec.sh - Test cases for the toolbox log module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "log"
#!/bin/bash
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "mutex"
#!/bin/bash
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "opt"
#!/bin/bash
# queue_spec.sh - Test cases for the toolbox queue module
-# Copyright (C) 2021 Matthias Kruk
+# Copyright (C) 2021-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
if ! . toolbox.sh; then
exit 1
fi
#!/bin/bash
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "sem"
#!/bin/bash
# uipc_spec.sh - Test cases for the toolbox uipc module
-# Copyright (C) 2022 Matthias Kruk
+# Copyright (C) 2022-2023 Matthias Kruk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "uipc"
#!/bin/bash
-export PATH="$PWD/..:$PATH"
-
. toolbox.sh
include "wmutex"