diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-08-15 21:41:09 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-08-15 21:41:09 (EDT) |
commit | b64a9234e2a15ab92f7fdc06a65ad5f0734c0856 (patch) | |
tree | 7930659cb8bf3e3be5898371befb4be3b0d4028c /tests | |
parent | 3ec7db9002a139aacda4dbffe598de784951ef08 (diff) |
Set up testsuite
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 = |