Index: configure.ac
===================================================================
--- configure.ac	(revision f844ef1d2617f49c942d373969b847f7fc5ae831)
+++ configure.ac	(revision d0a719337605ff092ec30a9628eacac47018187c)
@@ -134,4 +134,7 @@
 AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
 AC_CONFIG_FILES([
+	tests/CodeChecks/atlocal 
+	tests/CodeChecks/Makefile])
+AC_CONFIG_FILES([
 	tests/Tesselations/Makefile 
 	tests/Tesselations/defs])
Index: tests/CodeChecks/Makefile.am
===================================================================
--- tests/CodeChecks/Makefile.am	(revision d0a719337605ff092ec30a9628eacac47018187c)
+++ tests/CodeChecks/Makefile.am	(revision d0a719337605ff092ec30a9628eacac47018187c)
@@ -0,0 +1,44 @@
+AUTOM4TE = autom4te
+EXTRA_DIST = \
+	atlocal.in \
+	testsuite*.at \
+	$(TESTSUITE)
+TESTSUITE = $(srcdir)/testsuite
+
+TESTSCRIPTS =
+
+max_jobs = 4
+ 
+check-local: atlocal package.m4 $(TESTSUITE)
+	nrjobs=; \
+	for flag in $$MAKEFLAGS; do \
+		case $$flag in \
+		--* | =*=) ;; \
+		*j*) nrjobs="-j$(max_jobs)" ;; \
+		esac; \
+	done; \
+	$(SHELL) '$(TESTSUITE)' $$nrjobs $(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 $(TESTSCRIPTS)
+	$(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: tests/CodeChecks/atlocal.in
===================================================================
--- tests/CodeChecks/atlocal.in	(revision d0a719337605ff092ec30a9628eacac47018187c)
+++ tests/CodeChecks/atlocal.in	(revision d0a719337605ff092ec30a9628eacac47018187c)
@@ -0,0 +1,1 @@
+abs_top_srcdir='@abs_top_srcdir@'
Index: tests/CodeChecks/testsuite.at
===================================================================
--- tests/CodeChecks/testsuite.at	(revision d0a719337605ff092ec30a9628eacac47018187c)
+++ tests/CodeChecks/testsuite.at	(revision d0a719337605ff092ec30a9628eacac47018187c)
@@ -0,0 +1,41 @@
+# Process with autom4te to create an -*- Autotest -*- test suite.
+#
+# see regression/... subdirs wherein for each of the cases and each check (enumerated) is a pre and post dir. 
+# In pre initial files are placed, in post results can be found to be checked by diff in this testsuite.
+
+AT_INIT([Molecular Builder])
+AT_TESTED(egrep find grep)
+
+# Use colored output with new-enough Autotest.
+m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS])
+
+AT_BANNER([MoleCuilder - Code Checks])
+AT_SETUP([Checking for present MemDebug.hpp include])
+AT_KEYWORDS([CodeCheck,MemDebug])
+m4_include(atlocal)
+ok="builder.cpp MemDebug.cpp SubspaceFactorizer.cpp TestRunner.cpp"
+echo `pwd`
+echo "${#ok[*]} are ok to not contain MemDebug.hpp: ${ok[0]} ${ok[1]}."
+liste=`find ${abs_top_srcdir}/src -name '*.cpp'`
+for file in $liste
+do
+	# check whether its one of the excluded ones
+	found=0
+	for item in $ok
+	do
+		if test "$item" == "`basename $file`"
+		then
+			found=1
+			break
+		fi
+	done
+	# if not, check whether it contains the include if its NOT a unit test
+	if test -z `echo $file | grep unittests`
+	then
+		if test $found -eq 0
+		then
+			AT_CHECK([egrep -q '^#include.*MemDebug.hpp' $file], 0, [ignore], [ignore], [echo "Could not find MemDebug.hpp include in $file."])
+		fi
+	fi
+done
+AT_CLEANUP
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision f844ef1d2617f49c942d373969b847f7fc5ae831)
+++ tests/Makefile.am	(revision d0a719337605ff092ec30a9628eacac47018187c)
@@ -1,2 +1,2 @@
-SUBDIRS = regression Tesselations
+SUBDIRS = CodeChecks regression Tesselations
 
