aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-10-01 16:43:18 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-10-01 16:58:20 +0300
commitddb280198adcada561b8e72c79b92d50a05b3e78 (patch)
treede6f2d47fe10d0fb37279893d17ffcbd30b156ce /tests
parent78b25d9756403fef919684738f7aecb2cdcee465 (diff)
downloadeclat-ddb280198adcada561b8e72c79b92d50a05b3e78.tar.gz
eclat-ddb280198adcada561b8e72c79b92d50a05b3e78.tar.bz2
Implement exit; add some docs.
* Makefile.am (SUBDIRS): Add doc. * configure.ac: Build doc/Makefile * doc/Makefile.am: New file. * doc/eclat-associate-address.1: New file. * doc/eclat.1: New file. * etc/associate-address.fln: Call exit if the request fails. * etc/default.fln: Call exit if error is returned or if the response is not recognized. * lib/forlan.c (forlan_eval_env) <exit_code>: New member. New built-in function: exit. (forlan_run): Return exit code. * lib/forlan.h (forlan_run): Change return type. * lib/forlanlex.l: Treat unquoted decimal number as a quoted string. * src/asscaddr-cl.opt: Minor changes. * src/cmdline.opt: Minor changes. * src/eclat.c: Return EX_NOPERM on unsufficient permissions to open the configuration file. * tests/exit.at: New file. * tests/Makefile.am: Add new files. * tests/testsuite.at: Include new test cases. * tests/tforlan.c: Propagate the return from forlan_run to the shell.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/exit.at25
-rw-r--r--tests/testsuite.at1
-rw-r--r--tests/tforlan.c7
-rw-r--r--tests/xml01.at2
5 files changed, 33 insertions, 5 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 181f2f0..56a4b99 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -47,10 +47,11 @@ TESTSUITE_AT = \
describe-instances.at\
describe-tags.at\
describe-volumes.at\
- get-console-output.at\
dump01.at\
dump02.at\
+ exit.at\
forlan01.at\
+ get-console-output.at\
hmac01.at\
hmac02.at\
hmac03.at\
diff --git a/tests/exit.at b/tests/exit.at
new file mode 100644
index 0000000..c8da624
--- /dev/null
+++ b/tests/exit.at
@@ -0,0 +1,25 @@
+# This file is part of Eclat -*- Autotest -*-
+# Copyright (C) 2012 Sergey Poznyakoff
+#
+# Eclat 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.
+#
+# Eclat 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 Eclat. If not, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP(the exit function)
+
+AT_DATA([prog],[
+exit(25);
+])
+
+AT_CHECK([tforlan prog /dev/null], [25])
+
+AT_CLEANUP \ No newline at end of file
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 1776e3b..ccb5868 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -42,6 +42,7 @@ m4_include([xml01.at])
AT_BANNER([Forlan])
m4_include([forlan01.at])
+m4_include([exit.at])
m4_include([dump01.at])
m4_include([dump02.at])
m4_include([print01.at])
diff --git a/tests/tforlan.c b/tests/tforlan.c
index 403438e..64f84e1 100644
--- a/tests/tforlan.c
+++ b/tests/tforlan.c
@@ -176,13 +176,14 @@ main(int argc, char **argv)
if (options & OPT_SORT)
grecs_tree_sort(tree, node_ident_cmp);
- forlan_run(env, tree);
+ rc = forlan_run(env, tree);
grecs_tree_free(tree);
- }
+ } else
+ rc = 0;
forlan_free_environment(env);
- return 0;
+ return rc;
}
diff --git a/tests/xml01.at b/tests/xml01.at
index 01d7df4..1d650a4 100644
--- a/tests/xml01.at
+++ b/tests/xml01.at
@@ -25,7 +25,7 @@ AT_DATA([input],[<?xml version="1.0" encoding="UTF-8"?>
<resourceId>i-00000000</resourceId>
<resourceType>instance</resourceType>
<key>foo</key>
- <value>bar</value>
+mkdir <value>bar</value>
</item>
<item>
<resourceId>i-11111111</resourceId>

Return to:

Send suggestions and report system problems to the System administrator.