summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2022-03-16 22:02:05 (EDT)
committer P. J. McDermott <pj@pehjota.net>2022-03-17 16:17:43 (EDT)
commit8ae8df6d9f903cee298e1cc821a73dc6ab916367 (patch)
treed5a0cb1858617deae5cd82a4c6c9c38952932719
parent89e5655582467a90dc322d7c7f41c6eac7d340d6 (diff)
downloadatsign-8ae8df6d9f903cee298e1cc821a73dc6ab916367.zip
atsign-8ae8df6d9f903cee298e1cc821a73dc6ab916367.tar.gz
atsign-8ae8df6d9f903cee298e1cc821a73dc6ab916367.tar.bz2
tests: Add (stub) parse test
-rw-r--r--.gitignore1
-rw-r--r--tests/.gitignore2
-rw-r--r--tests/local.mk6
-rwxr-xr-xtests/parse.sh32
4 files changed, 40 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 01cf14c..07d68cf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,7 @@ Makefile
*.o
/version.c
/@
+/test-suite.log
/atsign-*.tar*
/atsign-*/
/MD5SUMS
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..7e563b8
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,2 @@
+*.log
+*.trs
diff --git a/tests/local.mk b/tests/local.mk
index 8c5797c..95671bc 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -1,3 +1,5 @@
+TESTS = \
+ %reldir%/parse.sh
TEST_EXTENSIONS = .sh
SH_LOG_DRIVER = \
AM_TAP_AWK='$(AWK)' \
@@ -5,5 +7,7 @@ SH_LOG_DRIVER = \
TOP_BUILDDIR="$(abs_top_builddir)" \
$(SHELL) $(top_srcdir)/build-aux/tap-driver.sh
EXTRA_DIST += \
+ $(TESTS) \
$(top_srcdir)/build-aux/tap-driver.sh \
- %reldir%/aux/tap-functions.sh
+ %reldir%/aux/tap-functions.sh \
+ %reldir%/parse.sh
diff --git a/tests/parse.sh b/tests/parse.sh
new file mode 100755
index 0000000..1de2320
--- /dev/null
+++ b/tests/parse.sh
@@ -0,0 +1,32 @@
+# Tests @'s date/time parsing
+#
+# Copyright (C) 2022 P. J. McDermott
+#
+# This file is part of @
+#
+# @ 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.
+#
+# @ 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 @. If not, see <http://www.gnu.org/licenses/>.
+
+set -eu
+
+. "${TOP_SRCDIR}/tests/aux/tap-functions.sh"
+
+plan_ later
+
+if [ x"$(TZ=UTC0 "${TOP_BUILDDIR}/@" -d '19700101T000000')" = x'0' ]; then
+ ok_ -- '19700101T000000'
+else
+ not_ok_ -- '19700101T000000'
+fi
+
+plan_ now