AM_CFLAGS = -g -Wall -pedantic -Wsign-compare -DDEFAULTTEXTDIR='"@textlibdir@"' -I$(srcdir)/../include @ATF_CFLAGS@
mlmmj_LDADD = $(top_builddir)/src/libmlmmj.a @ATF_LIBS@
-test_scripts = mlmmj-send.sh
+test_scripts = mlmmj-send.sh \
+ functional-tests.sh
check_SCRIPTS= $(test_scripts:.sh=)
SUFFIXES= .sh
--- /dev/null
+#!/usr/bin/env atf-sh
+
+. $(atf_get_srcdir)/test_env.sh
+
+tests_init \
+ discard
+
+discard_body()
+{
+
+ mlmmjrecv=$(command -v mlmmj-receive)
+ mlmmjmaint=$(command -v mlmmj-maintd)
+ init_ml list
+ here=$(pwd)
+
+ atf_check -s exit:0 $mlmmjrecv -L list -F <<-EOF
+bla
+EOF
+ atf_check -o inline:"bla\n" cat list/queue/discarded/*
+ # the discarded file is too new, do not drop it yet
+ atf_check -s exit:0 $mlmmjmaint -F -L ${here}/list
+ atf_check -o inline:"bla\n" cat list/queue/discarded/*
+ atf_check touch -m -t 197001010101 list/queue/discarded/*
+ atf_check -s exit:0 $mlmmjmaint -F -L ${here}/list
+ atf_check -o inline:"list/queue/discarded\n" find list/queue/discarded -type d -empty
+}