Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 63499294b4415bba971383507fe0307c222b99b5)
+++ tests/pybin/settings.py	(revision a5ea26135d5db981be7cff8e27809ec6e169064e)
@@ -126,4 +126,5 @@
 	global archive
 	global install
+	global invariant
 
 	global continue_
@@ -140,4 +141,5 @@
 	all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
 	archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
+	invariant    = options.invariant
 	continue_    = options.continue_
 	dry_run      = options.dry_run # must be called before tools.config_hash()
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 63499294b4415bba971383507fe0307c222b99b5)
+++ tests/test.py	(revision a5ea26135d5db981be7cff8e27809ec6e169064e)
@@ -114,4 +114,5 @@
 	parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
 	parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
+	parser.add_argument('--invariant', help='Tell the compiler to check invariants while running.', action='store_true')
 	parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180)
 	parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
@@ -172,4 +173,7 @@
 	test.prepare()
 
+	# extra flags for cfa to pass through make.
+	cfa_flags = 'CFAFLAGS=--invariant' if settings.invariant else None
+
 	# ----------
 	# MAKE
@@ -177,5 +181,5 @@
 	# build, skipping to next test on error
 	with Timed() as comp_dur:
-		make_ret, _, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )
+		make_ret, _, _ = make(test.target(), flags=cfa_flags, output_file=subprocess.DEVNULL, error=out_file, error_file=err_file)
 
 	# ----------
