Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision a5121bff2d239413034fc4cc466f9e5b15eebd1b)
+++ tests/Makefile.am	(revision 575a6e500466575fde0acedd9b84c09b42ac2ee8)
@@ -33,5 +33,5 @@
 	-DIN_DIR="${srcdir}/.in/"
 
-AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS}
+AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
 
 CC = @CFACC@
@@ -59,5 +59,5 @@
 
 .validate: .validate.c
-	@$(COMPILE) .validate.c -fsyntax-only
+	$(COMPILE) .validate.c -fsyntax-only -Wall -Wextra -Werror
 
 .validate.c:
Index: tests/Makefile.in
===================================================================
--- tests/Makefile.in	(revision a5121bff2d239413034fc4cc466f9e5b15eebd1b)
+++ tests/Makefile.in	(revision 575a6e500466575fde0acedd9b84c09b42ac2ee8)
@@ -304,5 +304,5 @@
 AM_CFLAGS = $(if $(test), 2> $(test), ) -g -Wall -Wno-unused-function \
 	-quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" ${DEBUG_FLAGS} \
-	${INSTALL_FLAGS}
+	${INSTALL_FLAGS} ${ARCH_FLAGS}
 fstream_test_SOURCES = fstream_test.c
 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c
@@ -625,5 +625,5 @@
 
 .validate: .validate.c
-	@$(COMPILE) .validate.c -fsyntax-only
+	$(COMPILE) .validate.c -fsyntax-only -Wall -Wextra -Werror
 
 .validate.c:
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision a5121bff2d239413034fc4cc466f9e5b15eebd1b)
+++ tests/pybin/settings.py	(revision 575a6e500466575fde0acedd9b84c09b42ac2ee8)
@@ -29,20 +29,36 @@
 	}
 
+	CrossCompileFlags = {
+		'x64' : 'ARCH_FLAGS=-m64',
+		'x86' : 'ARCH_FLAGS=-m32',
+	}
+
 	def __init__(self, arch):
+		try:
+			canonical_host = Architecture.makeCanonical( config.HOSTARCH )
+		except KeyError:
+			print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr)
+			sys.exit(1)
+
 		if arch:
+			try:
+				arch = Architecture.makeCanonical( arch )
+			except KeyError:
+				print("Unkown architecture %s" % arch, file=sys.stderr)
+				sys.exit(1)
+
+		if arch and arch != canonical_host:
+			self.target = arch
 			self.cross_compile = True
-			try:
-				self.target = Architecture.makeCanonical( arch )
+			try :
+				self.flags = Architecture.CrossCompileFlags[arch]
 			except KeyError:
-				print("Unkown architecture %s" % arch)
+				print("Cross compilation not available for architecture %s" % arch, file=sys.stderr)
 				sys.exit(1)
+
 		else:
+			self.target = canonical_host
 			self.cross_compile = False
-			try:
-				arch = config.HOSTARCH
-				self.target = Architecture.makeCanonical( arch )
-			except KeyError:
-				print("Running on unkown architecture %s" % arch)
-				sys.exit(1)
+			self.flags = ""
 
 		self.string = self.target
@@ -65,5 +81,5 @@
 	def __init__(self, value):
 		self.string = "debug" if value else "no debug"
-		self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug" if value else "-nodebug")
+		self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug -O0" if value else "-nodebug -O2")
 
 class Install:
@@ -98,5 +114,5 @@
 		with open (".validate.err", "r") as myfile:
 			error=myfile.read()
-		print('ERROR: Invalid configuration', file=sys.stderr)
+		print("ERROR: Invalid configuration %s:%s" % (arch.string, debug.string), file=sys.stderr)
 		print("       verify returned : \n%s" % error, file=sys.stderr)
 		tools.rm("%s/.validate.err" % BUILDDIR)
Index: tests/pybin/tools.py
===================================================================
--- tests/pybin/tools.py	(revision a5121bff2d239413034fc4cc466f9e5b15eebd1b)
+++ tests/pybin/tools.py	(revision 575a6e500466575fde0acedd9b84c09b42ac2ee8)
@@ -101,4 +101,5 @@
 		'-s' if silent else '',
 		test_param,
+		settings.arch.flags,
 		settings.debug.flags,
 		settings.install.flags,
Index: tests/test.py
===================================================================
--- tests/test.py	(revision a5121bff2d239413034fc4cc466f9e5b15eebd1b)
+++ tests/test.py	(revision 575a6e500466575fde0acedd9b84c09b42ac2ee8)
@@ -98,5 +98,10 @@
 	parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run')
 
-	options =  parser.parse_args()
+	try:
+		options =  parser.parse_args()
+	except:
+		print('ERROR: invalid arguments', file=sys.stderr)
+		parser.print_help(sys.stderr)
+    		sys.exit(1)
 
 	# script must have at least some tests to run or be listing
