Index: LinearAlgebra/tests/CodeChecks/Makefile.am
===================================================================
--- LinearAlgebra/tests/CodeChecks/Makefile.am	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
+++ LinearAlgebra/tests/CodeChecks/Makefile.am	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
@@ -0,0 +1,46 @@
+AUTOM4TE = autom4te
+EXTRA_DIST = \
+	atlocal.in \
+	testsuite*.at \
+	$(TESTSUITE)
+TESTSUITE = $(srcdir)/testsuite
+
+TESTSCRIPTS = \
+	testsuite-memdebug.at \
+	testsuite-config_h.at
+
+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: LinearAlgebra/tests/CodeChecks/atlocal.in
===================================================================
--- LinearAlgebra/tests/CodeChecks/atlocal.in	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
+++ LinearAlgebra/tests/CodeChecks/atlocal.in	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
@@ -0,0 +1,1 @@
+abs_top_srcdir='@abs_top_srcdir@'
Index: LinearAlgebra/tests/CodeChecks/testsuite-config_h.at
===================================================================
--- LinearAlgebra/tests/CodeChecks/testsuite-config_h.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
+++ LinearAlgebra/tests/CodeChecks/testsuite-config_h.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
@@ -0,0 +1,26 @@
+AT_SETUP([Checking for present config.h include])
+AT_KEYWORDS([CodeCheck,MemDebug])
+m4_include(atlocal)
+ok=""
+echo `pwd`
+echo "${#ok[*]} are ok to not contain config.h: ${ok[*]}."
+liste=`find ${abs_top_srcdir}/src -name '*.?pp'`
+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 test $found -eq 0
+  then
+    AT_CHECK([egrep -q '^#include.*config.h' $file], 0, [ignore], [ignore], [echo "Could not find config.h include in $file."])
+  fi
+done
+AT_CLEANUP
Index: LinearAlgebra/tests/CodeChecks/testsuite-memdebug.at
===================================================================
--- LinearAlgebra/tests/CodeChecks/testsuite-memdebug.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
+++ LinearAlgebra/tests/CodeChecks/testsuite-memdebug.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
@@ -0,0 +1,29 @@
+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: LinearAlgebra/tests/CodeChecks/testsuite.at
===================================================================
--- LinearAlgebra/tests/CodeChecks/testsuite.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
+++ LinearAlgebra/tests/CodeChecks/testsuite.at	(revision bf4b9ff97113f58a6031de8f9e67813336ae63f1)
@@ -0,0 +1,15 @@
+# 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])
+m4_include(testsuite-memdebug.at)
+
+m4_include(testsuite-config_h.at)
