diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/common.sh | 34 | ||||
-rw-r--r-- | tests/local.mk | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/common.sh b/tests/common.sh new file mode 100644 index 0000000..0efb208 --- /dev/null +++ b/tests/common.sh @@ -0,0 +1,34 @@ +# ProteanOS Development Kit +# tests/common.sh +# Common testsuite functions +# +# Copyright (C) 2013-2014 Patrick "P. J." McDermott +# +# 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use() +{ + local module="${1}" + local dir= + + dir='lib' + + if [ -f "${dir}/${module}.sm" ]; then + . "${dir}/${module}.sm" + else + printf '%s: Error: Failed to load module "%s": %s\n' \ + "${0##*/}" "${module}" 'no such file or directory' >&2 + exit 2 + fi +} diff --git a/tests/local.mk b/tests/local.mk new file mode 100644 index 0000000..d938299 --- /dev/null +++ b/tests/local.mk @@ -0,0 +1 @@ +TESTS = |