Index: molecuilder/tests/Makefile.am
===================================================================
--- molecuilder/tests/Makefile.am	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
+++ molecuilder/tests/Makefile.am	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
@@ -0,0 +1,30 @@
+AUTOM4TE = autom4te
+EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in
+TESTSUITE = $(srcdir)/testsuite
+
+check-local: atconfig atlocal package.m4 $(TESTSUITE)
+		$(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS)
+
+installcheck-local: atconfig atlocal $(TESTSUITE)
+		$(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' \
+		$(TESTSUITEFLAGS)
+     
+clean-local:
+		test ! -f '$(TESTSUITE)' || \
+		$(SHELL) '$(TESTSUITE)' --clean
+
+AUTOTEST = $(AUTOM4TE) --language=autotest
+$(TESTSUITE): $(srcdir)/testsuite.at
+		$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+		mv $@.tmp $@
+
+# The `:;' works around a Bash 3.2 bug when the output is not writeable.
+$(srcdir)/package.m4: $(top_srcdir)/configure.ac
+			:;{ \
+					echo '# Signature of the current package.' && \
+					echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])' && \
+					echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])' && \
+					echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])' && \
+					echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])' && \
+					echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+				} >'$(srcdir)/package.m4'
Index: molecuilder/tests/atlocal.in
===================================================================
--- molecuilder/tests/atlocal.in	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
+++ molecuilder/tests/atlocal.in	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
@@ -0,0 +1,4 @@
+prefix='@prefix@'
+exec_prefix='@prefix@'
+topdir='@topdir@'
+bindir='@bindir@'
Index: molecuilder/tests/molecuilder.in
===================================================================
--- molecuilder/tests/molecuilder.in	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
+++ molecuilder/tests/molecuilder.in	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# wrapper for testing molecuilder
+
+. atconfig
+
+"${abs_top_builddir}/src/molecuilder" \
+	${1+"$@"}
+status=$?
+
+exit $status
Index: molecuilder/tests/testsuite.at
===================================================================
--- molecuilder/tests/testsuite.at	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
+++ molecuilder/tests/testsuite.at	(revision 1f72651642c49c432b41bb5a2fa676e0643a17be)
@@ -0,0 +1,36 @@
+# Process with autom4te to create an -*- Autotest -*- test suite.
+
+
+AT_INIT([Molecular Builder])
+
+# Checking if command line options are parsed correctly
+AT_BANNER([MoleCuilder - standard options])
+AT_SETUP([Standard Options])
+AT_CHECK([pwd],[ignore],[ignore])
+AT_CHECK([../../molecuilder -v], 0, [stdout], [ignore])
+AT_CHECK([fgrep molecuilder stdout], 0, [ignore], [ignore])
+AT_CHECK([../../molecuilder -h], 0, [stdout], [ignore])
+AT_CHECK([fgrep "Give this help screen" stdout], 0, [ignore], [ignore])
+AT_CLEANUP
+
+AT_BANNER([MoleCuilder - simple command line tests])
+AT_SETUP([Simple configuration])
+# 1. create a fake element database with the only element we need
+AT_DATA([elements.db],[#	Covalent	radius	of	each	element	in	Angstroem	from	CSD	(binding	is:	[Rcov(A)+Rcov(B)-t,Rcov(A)+Rcov(B)+t]	with	t	=	0.4A
+#Element	Name	Symbol	Period	Group	Block	Atomic	Number	AtomicWeight	Covalent	Radius	vdW	Radius
+Hydrogen	H	1	1	s	1	1.008	0.23	1.09
+])
+# 2. create some simplest molecular geometry
+AT_DATA([test.xyz], [[1
+ # test configuration, created by molecuilder test suite
+H	10.	10.	10.
+]])
+# 3. make sure config is empty and not remnant from last test with broken dirs
+AT_DATA([test.conf], [])
+AT_CHECK([../../molecuilder -e elements.db -p test.xyz test.conf], 0, [ignore], [ignore])
+AT_CHECK([fgrep "Ion_Type1_1" test.conf], 0, [Ion_Type1_1	10.000000000	10.000000000	10.000000000	0 # Number in molecule 0
+], [ignore])
+AT_CLEANUP
+
+
+
