diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-09-06 15:47:03 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-09-06 15:47:03 +0300 |
commit | ce6b1f659290f2dbf6f874161fe0dc288fac2043 (patch) | |
tree | c61c5aebb8963dde7643e7fce1d46696e8e989b7 | |
parent | a5d72d435a8dd43e13b6d010bd04d4ee492b6908 (diff) | |
download | direvent-ce6b1f659290f2dbf6f874161fe0dc288fac2043.tar.gz direvent-ce6b1f659290f2dbf6f874161fe0dc288fac2043.tar.bz2 |
Add new test
* tests/samepath.at: New file.
* tests/Makefile.am: Add new testcase.
* tests/testsuite.at: Likewise.
* NEWS: Update
* README: Update
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/samepath.at | 76 | ||||
-rw-r--r-- | tests/testsuite.at | 1 |
5 files changed, 81 insertions, 3 deletions
@@ -1,4 +1,4 @@ -direvent -- history of user-visible changes. 2014-09-01 +direvent -- history of user-visible changes. 2014-09-03 Copyright (C) 2012-2014 Sergey Poznyakoff See the end of file for copying conditions. @@ -48,7 +48,7 @@ Version 2.0, 2013-01-11 * Change command line handling -Direvent accepts handler definitions interspersed with directory +Dircond accepts handler definitions interspersed with directory name. This allows for having different per-directory handlers. Similarly, the autowatch options ("-a" and "-l") affect the @@ -43,7 +43,7 @@ at http://direvent.man.gnu.org.ua. * Copyright information: -Copyright (C) 2012, 2013 Sergey Poznyakoff +Copyright (C) 2012-2014 Sergey Poznyakoff Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/tests/Makefile.am b/tests/Makefile.am index d89dfcb..f8b356f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -55,6 +55,7 @@ TESTSUITE_AT = \ re03.at\ re04.at\ re05.at\ + samepath.at\ testsuite.at\ write.at diff --git a/tests/samepath.at b/tests/samepath.at new file mode 100644 index 0000000..8697c26 --- /dev/null +++ b/tests/samepath.at @@ -0,0 +1,76 @@ +# This file is part of Direvent testsuite. -*- Autotest -*- +# Copyright (C) 2014 Sergey Poznyakoff +# +# Direvent 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, or (at your option) +# any later version. +# +# Direvent 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 Direvent. If not, see <http://www.gnu.org/licenses/>. + +AT_SETUP([Watchers with same paths]) +AT_KEYWORDS([samepath]) + +AT_DIREVENT_TEST([ +debug 10; +syslog { + facility ${TESTSUITE_FACILITY:-local0}; + tag direvent-test:write; +} +watcher { + path $cwd/dir; + event write; + option (stdout,stderr); + command "$TESTDIR/envdump -s -i DIREVENT_FILE=:DIREVENT_GENEV_NAME= -f $outfile"; +} +watcher { + path $cwd/dir; + event delete; + option (stdout,stderr); + command "$TESTDIR/envdump -s -i DIREVENT_FILE=:DIREVENT_GENEV_NAME= -f $outfile -a -k\$self_test_pid"; +} +], +[echo "x" > dir/file +rm dir/file], +[outfile=$cwd/dump +mkdir dir +>dir/file], +[sed "s^$cwd^(CWD)^;s^$TESTDIR^(TESTDIR)^;/^argv\[[[0-9]]\]=-k/d" $outfile], +[0], +[# Dump of execution environment +cwd is (CWD)/dir +# Arguments +argv[[0]]=(TESTDIR)/envdump +argv[[1]]=-s +argv[[2]]=-i +argv[[3]]=DIREVENT_FILE=:DIREVENT_GENEV_NAME= +argv[[4]]=-f +argv[[5]]=(CWD)/dump +# Environment +DIREVENT_FILE=file +DIREVENT_GENEV_NAME=write +# End +# Dump of execution environment +cwd is (CWD)/dir +# Arguments +argv[[0]]=(TESTDIR)/envdump +argv[[1]]=-s +argv[[2]]=-i +argv[[3]]=DIREVENT_FILE=:DIREVENT_GENEV_NAME= +argv[[4]]=-f +argv[[5]]=(CWD)/dump +argv[[6]]=-a +# Environment +DIREVENT_FILE=file +DIREVENT_GENEV_NAME=delete +# End +]) + +AT_CLEANUP + diff --git a/tests/testsuite.at b/tests/testsuite.at index 7ea0e28..a88f78d 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -50,6 +50,7 @@ m4_include([delete.at]) m4_include([write.at]) m4_include([attrib.at]) m4_include([cmdexp.at]) +m4_include([samepath.at]) AT_BANNER([Environment modifications]) m4_include([env00.at]) |