From c285d36ab2a48f09c14655a0dcec5895700fe4dd Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Thu, 28 Sep 2017 17:59:40 +0200 Subject: tests: Add 'basic.sh' * tests/init.sh: New test framework from Gnulib. * tests/basic.sh: New test. * Makefile.am (TESTS): Add it. (TEST_EXTENSIONS): Add '.sh'. (SH_LOG_COMPILER): Use 'pre-inst-env'. (EXTRA_DIST): Add 'tests/init.sh'. * build-aux/pre-inst-env.in: export $srcdir for shell tests. --- tests/basic.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 tests/basic.sh (limited to 'tests/basic.sh') diff --git a/tests/basic.sh b/tests/basic.sh new file mode 100644 index 0000000..07b664b --- /dev/null +++ b/tests/basic.sh @@ -0,0 +1,33 @@ +# basic.sh -- basic tests for mcron +# Copyright © 2017 Mathieu Lirzin +# +# This file is part of GNU Mcron. +# +# GNU Mcron 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. +# +# GNU Mcron 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 GNU Mcron. If not, see . + +source "${srcdir}/tests/init.sh" + +# Use current working directory to store mcron files +XDG_CONFIG_HOME=`pwd` +export XDG_CONFIG_HOME + +mkdir cron +cat > cron/foo.guile < "output$$" +grep -e "foo" "output$$" || fail_ "'foo.guile' job is not scheduled" + +Exit 0 -- cgit v1.2.3