diff options
Diffstat (limited to 'tests/conv.at')
-rw-r--r-- | tests/conv.at | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/conv.at b/tests/conv.at new file mode 100644 index 0000000..d46f7f6 --- /dev/null +++ b/tests/conv.at | |||
@@ -0,0 +1,63 @@ | |||
1 | # This file is part of Direvent testsuite. -*- Autotest -*- | ||
2 | # Copyright (C) 2013-2016 Sergey Poznyakoff | ||
3 | # | ||
4 | # Direvent is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published by | ||
6 | # the Free Software Foundation; either version 3, or (at your option) | ||
7 | # any later version. | ||
8 | # | ||
9 | # Direvent is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with Direvent. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | AT_SETUP([File watcher]) | ||
18 | AT_KEYWORDS([special conv convert file]) | ||
19 | |||
20 | AT_DIREVENT_TEST_UNQUOTED([ | ||
21 | debug 10; | ||
22 | syslog { | ||
23 | facility ${TESTSUITE_FACILITY:-local0}; | ||
24 | tag direvent-test:create; | ||
25 | } | ||
26 | watcher { | ||
27 | path $cwd/file; | ||
28 | event (create,write,delete); | ||
29 | option (stdout,stderr); | ||
30 | command "$TESTDIR/envdump -s -i DIREVENT_FILE=:DIREVENT_GENEV_ -f $outfile -k\$self_test_pid"; | ||
31 | } | ||
32 | ], | ||
33 | [echo "foo" > file | ||
34 | ], | ||
35 | [outfile=$cwd/dump | ||
36 | echo "file" > file | ||
37 | ], | ||
38 | [sed '/^argv\[[[0-9]]\]=-k/d' $outfile | ||
39 | ], | ||
40 | [0], | ||
41 | [# Dump of execution environment | ||
42 | cwd is $cwd | ||
43 | # Arguments | ||
44 | argv[[0]]=$TESTDIR/envdump | ||
45 | argv[[1]]=-s | ||
46 | argv[[2]]=-i | ||
47 | argv[[3]]=DIREVENT_FILE=:DIREVENT_GENEV_ | ||
48 | argv[[4]]=-f | ||
49 | argv[[5]]=$cwd/dump | ||
50 | # Environment | ||
51 | DIREVENT_FILE=file | ||
52 | DIREVENT_GENEV_CODE=2 | ||
53 | DIREVENT_GENEV_NAME=write | ||
54 | # End | ||
55 | ], | ||
56 | [direvent: [[NOTICE]] file watcher $cwd/file converted to directory watcher $cwd | ||
57 | ]) | ||
58 | |||
59 | AT_CLEANUP | ||
60 | |||
61 | |||
62 | |||
63 | |||