Index: Jenkins/FullBuild
===================================================================
--- Jenkins/FullBuild	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ Jenkins/FullBuild	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -132,4 +132,5 @@
 
 <img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=0" >
+<img src="https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/plot/Compilation/getPlot?index=1" >
 
 <p>- Logs ----------------------------------------------------------------</p>
Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ Jenkinsfile	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -197,16 +197,16 @@
 		if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' }
 
-		def groupCompile = new PlotGroup('Compilation', 'seconds', true)
-		def groupConcurrency = new PlotGroup('Concurrency', 'nanoseconds', false)
+		def groupCompile = new PlotGroup('Compilation', 'duration (s) - lower is better', true)
+		def groupConcurrency = new PlotGroup('Concurrency', 'duration (n) - lower is better', false)
 
 		//Then publish the results
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'compile'       , groupCompile    , 'Compilation')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff'  , groupCompile    , 'Compilation Speed-Up')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch'     , groupConcurrency, 'Context Switching')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff', groupConcurrency, 'Context Switching Speed-Up')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex'         , groupConcurrency, 'Mutual Exclusion')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff'    , groupConcurrency, 'Mutual Exclusion Speed-Up')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'signal'        , groupConcurrency, 'Internal and External Scheduling')
-		do_plot(Settings.RunBenchmark && Settings.Publish, 'signal.diff'   , groupConcurrency, 'Internal and External Scheduling Speed-Up')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'compile'       , groupCompile    , false, 'Compilation')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff'  , groupCompile    , true , 'Compilation (relative)')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch'     , groupConcurrency, false, 'Context Switching')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff', groupConcurrency, true , 'Context Switching (relative)')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex'         , groupConcurrency, false, 'Mutual Exclusion')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff'    , groupConcurrency, true , 'Mutual Exclusion (relative)')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'signal'        , groupConcurrency, false, 'Internal and External Scheduling')
+		do_plot(Settings.RunBenchmark && Settings.Publish, 'signal.diff'   , groupConcurrency, true , 'Internal and External Scheduling (relative)')
 	}
 }
@@ -466,5 +466,5 @@
 }
 
-def do_plot(boolean new_data, String file, PlotGroup group, String title) {
+def do_plot(boolean new_data, String file, PlotGroup group, boolean relative, String title) {
 
 	if(new_data) {
@@ -489,5 +489,5 @@
 			exclZero: false,
 			keepRecords: false,
-			logarithmic: group.log,
+			logarithmic: !relative && group.log,
 			numBuilds: '120',
 			useDescr: true,
Index: libcfa/src/Makefile.am
===================================================================
--- libcfa/src/Makefile.am	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ libcfa/src/Makefile.am	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -26,9 +26,11 @@
 VPATH += :../prelude
 
+gdbwaittarget=""
+
 # AM_CFLAGS for all cfa source
 # AM_CFAFLAGS for only cfa source
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)  @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
Index: libcfa/src/Makefile.in
===================================================================
--- libcfa/src/Makefile.in	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ libcfa/src/Makefile.in	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -435,4 +435,5 @@
 am__v_UPP_1 = 
 lib_LTLIBRARIES = libcfa.la libcfathread.la
+gdbwaittarget = ""
 
 # AM_CFLAGS for all cfa source
@@ -440,5 +441,5 @@
 # use -no-include-stdhdr to prevent rebuild cycles
 # The built sources must not depend on the installed headers
-AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
+AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)  @CONFIG_CFAFLAGS@
 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -1188,4 +1188,5 @@
 		assert( toType );
 		toType = resolveTypeof( toType, indexer );
+		assert(!dynamic_cast<TypeofType *>(toType));
 		SymTab::validateType( toType, &indexer );
 		adjustExprType( toType, env, indexer );
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/SynTree/ApplicationExpr.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Tue Apr 26 12:41:06 2016
-// Update Count     : 4
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Aug 12 14:28:00 2019
+// Update Count     : 5
 //
 
@@ -76,4 +76,8 @@
 }
 
+bool ApplicationExpr::get_lvalue() const {
+	return result->get_lvalue();
+}
+
 void ApplicationExpr::print( std::ostream &os, Indenter indent ) const {
 	os << "Application of" << std::endl << indent+1;
Index: src/SynTree/CommaExpr.cc
===================================================================
--- src/SynTree/CommaExpr.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/SynTree/CommaExpr.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Rob Schluntz
-// Last Modified On : Mon May 02 15:19:44 2016
-// Update Count     : 1
+// Last Modified By : Andrew Beach
+// Last Modified On : Mon Arg 12 16:11:00 2016
+// Update Count     : 2
 //
 
@@ -39,4 +39,9 @@
 }
 
+bool CommaExpr::get_lvalue() const {
+	// xxx - as above, shouldn't be an lvalue but that information is used anyways.
+	return result->get_lvalue();
+}
+
 void CommaExpr::print( std::ostream &os, Indenter indent ) const {
 	os << "Comma Expression:" << std::endl;
Index: src/SynTree/Expression.cc
===================================================================
--- src/SynTree/Expression.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/SynTree/Expression.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Wed Aug  7 17:03:00 2019
-// Update Count     : 62
+// Last Modified On : Thr Aug 15 13:43:00 2019
+// Update Count     : 64
 //
 
@@ -64,5 +64,6 @@
 
 bool Expression::get_lvalue() const {
-	return result->get_lvalue();
+	assert( !result->get_lvalue() );
+	return false;
 }
 
@@ -138,4 +139,8 @@
 }
 
+bool VariableExpr::get_lvalue() const {
+	return result->get_lvalue();
+}
+
 VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {
 	VariableExpr * funcExpr = new VariableExpr( func );
@@ -269,4 +274,8 @@
 CastExpr::~CastExpr() {
 	delete arg;
+}
+
+bool CastExpr::get_lvalue() const {
+	return result->get_lvalue();
 }
 
@@ -380,4 +389,9 @@
 	// don't delete the member declaration, since it points somewhere else in the tree
 	delete aggregate;
+}
+
+bool MemberExpr::get_lvalue() const {
+	assert( result->get_lvalue() );
+	return true;
 }
 
@@ -432,4 +446,7 @@
 }
 
+bool UntypedExpr::get_lvalue() const {
+	return result->get_lvalue();
+}
 
 void UntypedExpr::print( std::ostream & os, Indenter indent ) const {
@@ -490,4 +507,8 @@
 	delete arg2;
 	delete arg3;
+}
+
+bool ConditionalExpr::get_lvalue() const {
+	return result->get_lvalue();
 }
 
@@ -548,4 +569,8 @@
 }
 
+bool ConstructorExpr::get_lvalue() const {
+	return result->get_lvalue();
+}
+
 void ConstructorExpr::print( std::ostream & os, Indenter indent ) const {
 	os <<  "Constructor Expression: " << std::endl << indent+1;
@@ -565,4 +590,9 @@
 CompoundLiteralExpr::~CompoundLiteralExpr() {
 	delete initializer;
+}
+
+bool CompoundLiteralExpr::get_lvalue() const {
+	assert( result->get_lvalue() );
+	return true;
 }
 
@@ -616,4 +646,7 @@
 		result = new VoidType( Type::Qualifiers() );
 	}
+}
+bool StmtExpr::get_lvalue() const {
+	return result->get_lvalue();
 }
 void StmtExpr::print( std::ostream & os, Indenter indent ) const {
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/SynTree/Expression.h	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -10,6 +10,6 @@
 // Created On       : Mon May 18 07:44:20 2015
 // Last Modified By : Andrew Beach
-// Last Modified On : Wed Aug  7 16:56:00 2019
-// Update Count     : 51
+// Last Modified On : Thr Aug 15 13:46:00 2019
+// Update Count     : 54
 //
 
@@ -71,5 +71,5 @@
 	const Type * get_result() const { return result; }
 	void set_result( Type * newValue ) { result = newValue; }
-	bool get_lvalue() const;
+	virtual bool get_lvalue() const;
 
 	TypeSubstitution * get_env() const { return env; }
@@ -99,4 +99,6 @@
 	virtual ~ApplicationExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_function() const { return function; }
 	void set_function( Expression * newValue ) { function = newValue; }
@@ -121,4 +123,6 @@
 	UntypedExpr( const UntypedExpr & other );
 	virtual ~UntypedExpr();
+
+	bool get_lvalue() const final;
 
 	Expression * get_function() const { return function; }
@@ -209,4 +213,6 @@
 	virtual ~CastExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_arg() const { return arg; }
 	void set_arg( Expression * newValue ) { arg = newValue; }
@@ -292,4 +298,6 @@
 	virtual ~MemberExpr();
 
+	bool get_lvalue() const final;
+
 	DeclarationWithType * get_member() const { return member; }
 	void set_member( DeclarationWithType * newValue ) { member = newValue; }
@@ -314,4 +322,6 @@
 	VariableExpr( const VariableExpr & other );
 	virtual ~VariableExpr();
+
+	bool get_lvalue() const final;
 
 	DeclarationWithType * get_var() const { return var; }
@@ -501,4 +511,6 @@
 	virtual ~ConditionalExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_arg1() const { return arg1; }
 	void set_arg1( Expression * newValue ) { arg1 = newValue; }
@@ -525,4 +537,6 @@
 	virtual ~CommaExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_arg1() const { return arg1; }
 	void set_arg1( Expression * newValue ) { arg1 = newValue; }
@@ -611,4 +625,6 @@
 	~ConstructorExpr();
 
+	bool get_lvalue() const final;
+
 	Expression * get_callExpr() const { return callExpr; }
 	void set_callExpr( Expression * newValue ) { callExpr = newValue; }
@@ -629,4 +645,6 @@
 	CompoundLiteralExpr( const CompoundLiteralExpr & other );
 	virtual ~CompoundLiteralExpr();
+
+	bool get_lvalue() const final;
 
 	Initializer * get_initializer() const { return initializer; }
@@ -687,4 +705,6 @@
 	virtual ~TupleExpr();
 
+	bool get_lvalue() const final;
+
 	std::list<Expression*>& get_exprs() { return exprs; }
 
@@ -705,4 +725,6 @@
 	TupleIndexExpr( const TupleIndexExpr & other );
 	virtual ~TupleIndexExpr();
+
+	bool get_lvalue() const final;
 
 	Expression * get_tuple() const { return tuple; }
@@ -754,4 +776,6 @@
 	StmtExpr( const StmtExpr & other );
 	virtual ~StmtExpr();
+
+	bool get_lvalue() const final;
 
 	CompoundStmt * get_statements() const { return statements; }
Index: src/SynTree/TupleExpr.cc
===================================================================
--- src/SynTree/TupleExpr.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/SynTree/TupleExpr.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Mon May 18 07:44:20 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Mar 17 09:42:29 2017
-// Update Count     : 3
+// Last Modified By : Andrew Beach
+// Last Modified On : Wed Aug 14 14:34:00 2019
+// Update Count     : 5
 //
 
@@ -57,4 +57,8 @@
 }
 
+bool TupleExpr::get_lvalue() const {
+	return result->get_lvalue();
+}
+
 void TupleExpr::print( std::ostream &os, Indenter indent ) const {
 	os << "Tuple:" << std::endl;
@@ -76,4 +80,9 @@
 TupleIndexExpr::~TupleIndexExpr() {
 	delete tuple;
+}
+
+bool TupleIndexExpr::get_lvalue() const {
+	assert( result->get_lvalue() );
+	return true;
 }
 
Index: src/main.cc
===================================================================
--- src/main.cc	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ src/main.cc	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 15 23:12:02 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Aug 22 13:06:18 2019
-// Update Count     : 605
+// Last Modified On : Fri Aug 23 06:50:08 2019
+// Update Count     : 607
 //
 
@@ -17,8 +17,8 @@
 #include <execinfo.h>                       // for backtrace, backtrace_symbols
 #include <getopt.h>                         // for no_argument, optind, geto...
-#include <signal.h>                         // for signal, SIGABRT, SIGSEGV
 #include <cassert>                          // for assertf
 #include <cstdio>                           // for fopen, FILE, fclose, stdin
 #include <cstdlib>                          // for exit, free, abort, EXIT_F...
+#include <csignal>                         // for signal, SIGABRT, SIGSEGV
 #include <cstring>                          // for index
 #include <fstream>                          // for ofstream
@@ -96,4 +96,6 @@
 DeclarationNode * parseTree = nullptr;					// program parse tree
 
+static bool waiting_for_gdb = false;					// flag to set cfa-cpp to wait for gdb on start
+
 static std::string PreludeDirector = "";
 
@@ -167,5 +169,4 @@
 } // sigAbortHandler
 
-
 int main( int argc, char * argv[] ) {
 	FILE * input;										// use FILE rather than istream because yyin is FILE
@@ -184,4 +185,11 @@
 	parse_cmdline( argc, argv );						// process command-line arguments
 	CodeGen::FixMain::setReplaceMain( !nomainp );
+
+	if ( waiting_for_gdb ) {
+		std::cerr << "Waiting for gdb" << std::endl;
+		std::cerr << "run :" << std::endl;
+		std::cerr << "  gdb attach " << getpid() << std::endl;
+		raise(SIGSTOP);
+	} // if
 
 	try {
@@ -445,4 +453,5 @@
 	{ "statistics", required_argument, nullptr, 'S' },
 	{ "tree", no_argument, nullptr, 't' },
+	{ "gdb", no_argument, nullptr, 'g' },
 	{ "", no_argument, nullptr, 0 },					// -w
 	{ "", no_argument, nullptr, 0 },					// -W
@@ -462,5 +471,6 @@
 	"<directory> prelude directory for debug/nodebug",	// no flag
 	"<option-list> enable profiling information:\n          counters,heap,time,all,none", // -S
-	"build in tree",									// -t
+	"building cfa standard lib",									// -t
+	"wait for gdb to attach",									// -g
 	"",													// -w
 	"",													// -W
@@ -572,6 +582,9 @@
 			Stats::parse_params( optarg );
 			break;
-		  case 't':										// build in tree
+		  case 't':										// building cfa stdlib
 			treep = true;
+			break;
+		  case 'g':										// wait for gdb
+			waiting_for_gdb = true;
 			break;
 		  case 'w':										// suppress all warnings, hidden
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ tests/Makefile.am	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -22,4 +22,5 @@
 debug=yes
 installed=no
+archiveerrors=
 
 INSTALL_FLAGS=-in-tree
@@ -56,8 +57,8 @@
 #----------------------------------------------------------------------------------------------------------------
 all-local :
-	@+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} ${quick_test}
+	@+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
 
 all-tests :
-	@+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
+	@+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
 
 clean-local :
Index: tests/Makefile.in
===================================================================
--- tests/Makefile.in	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ tests/Makefile.in	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -377,4 +377,5 @@
 debug = yes
 installed = no
+archiveerrors = 
 INSTALL_FLAGS = -in-tree
 DEBUG_FLAGS = -debug -O0
@@ -770,8 +771,8 @@
 #----------------------------------------------------------------------------------------------------------------
 all-local :
-	@+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} ${quick_test}
+	@+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} ${quick_test}
 
 all-tests :
-	@+${TEST_PY} --debug=${debug}  --install=${installed} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
+	@+${TEST_PY} --debug=${debug}  --install=${installed} --archive-errors=${archiveerrors} ${concurrent} ${timeouts} --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
 
 clean-local :
Index: tests/pybin/settings.py
===================================================================
--- tests/pybin/settings.py	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ tests/pybin/settings.py	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -4,5 +4,8 @@
 from . import tools
 
+global original_path
+
 try :
+	original_path = os.getcwd()
 	testpath = os.path.dirname(os.path.abspath(os.path.join(os.getcwd(), sys.argv[0])))
 	sys.path.append(testpath)
@@ -113,4 +116,5 @@
 	global timeout
 	global output_width
+	global archive
 
 	dry_run      = options.dry_run
@@ -122,4 +126,5 @@
 	timeout      = Timeouts(options.timeout, options.global_timeout)
 	output_width = 24
+	archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
 
 
Index: tests/pybin/tools.py
===================================================================
--- tests/pybin/tools.py	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ tests/pybin/tools.py	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -2,4 +2,5 @@
 import argparse
 import contextlib
+import datetime
 import fileinput
 import multiprocessing
@@ -273,4 +274,9 @@
 ################################################################################
 
+def pretty_now():
+	ts = time.time()
+	print(ts, file=sys.stderr)
+	return datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H:%M:%S')
+
 # check if arguments is yes or no
 def yes_no(string):
@@ -304,4 +310,21 @@
 	return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output=subprocess.PIPE)
 
+def core_archive(dst, name, exe):
+	# Get the files to copy
+	core = os.path.join(os.getcwd(), "core" )
+
+	# Uncomment if we want timestamps on coredumps
+	# dst  = os.path.join(dst, "%s_%s" % (name, pretty_now()))
+
+	# make a directory for this test
+	mkdir(os.path.join(dst, "dir"))
+
+	# moves the files
+	mv( core, os.path.join(dst, "core" ) )
+	mv( exe , os.path.join(dst, name   ) )
+
+	# return explanatory test
+	return "Archiving %s (executable and core) to %s" % (os.path.relpath(exe, settings.BUILDDIR), os.path.relpath(dst, settings.original_path))
+
 class Timed:
     def __enter__(self):
Index: tests/test.py
===================================================================
--- tests/test.py	(revision 2c60af75e3e26f3bbb703612fe1023fd05354f95)
+++ tests/test.py	(revision ef22ad65ff9727de264304f61406d2505d5d7d45)
@@ -91,4 +91,5 @@
 	parser.add_argument('--all', help='Run all test available', action='store_true')
 	parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
+	parser.add_argument('--archive-errors', help='If called with a valid path, on test crashes the test script will copy the core dump and the executable to the specified path.', type=str, default='')
 	parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int)
 	parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
@@ -179,4 +180,7 @@
 			error = error + info if error else info
 
+			if settings.archive:
+				error = error + '\n' + core_archive(settings.archive, test.target(), exe_file)
+
 
 
@@ -295,5 +299,5 @@
 	# users may want to simply list the tests
 	if options.list_comp :
-		print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --install --timeout --global-timeout -j --jobs ", end='')
+		print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout -j --jobs ", end='')
 		print(" ".join(map(lambda t: "%s" % (t.target()), tests)))
 
