From b5d2e9486edf405501d94f43e39a4f478fa26b70 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 20 May 2008 13:04:22 +0200 Subject: [PATCH] small adaptions to scons, fix a test --- SConstruct | 3 ++- tests/50components.tests | 2 +- tests/SConscript | 10 +++++++++- tests/common/exceptionerrortest.cpp | 4 ++-- tests/test.sh | 3 +-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index cef5ebda0..066cd31b0 100644 --- a/SConstruct +++ b/SConstruct @@ -33,7 +33,7 @@ CUSTOPTIONSFILE = 'custom-options' SRCDIR = 'src' BINDIR = 'bin' TESTDIR = 'tests' -VERSION = '3+alpha.01' +VERSION = '0.1+pre.01' #-----------------------------------Configuration # NOTE: scons -h for help. @@ -68,6 +68,7 @@ def setupBasicEnvironment(): RegisterPrecompiledHeader_Builder(env) handleNoBugSwitches(env) + env.Append(CPPDEFINES = '_GNU_SOURCE') appendCppDefine(env,'DEBUG','DEBUG', 'NDEBUG') appendCppDefine(env,'OPENGL','USE_OPENGL') appendVal(env,'ARCHFLAGS', 'CCFLAGS') # for both C and C++ diff --git a/tests/50components.tests b/tests/50components.tests index 18f04ee4b..ae15f37c3 100644 --- a/tests/50components.tests +++ b/tests/50components.tests @@ -62,7 +62,7 @@ out: caught error::Logic: LUMIERA_ERROR_FATAL:floundered (test-2). out: caught error::Invalid: LUMIERA_ERROR_INVALID:invalid input or parameters (test-3). out: caught lumiera::Error: LUMIERA_ERROR_EXTERNAL:failure in external service (test-4). out: caught std::runtime_error: test-5 -out: caught std::exception: std::exception +out: caught std::exception. (unspecific) out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7).....will rethrow as error::State out: caught lumiera::Error: LUMIERA_ERROR_STATE:unforseen state -- caused by: LUMIERA_ERROR_EXTERNAL:failure in external service (test-7). out: intermediate handler caught: LUMIERA_ERROR_EXTERNAL:failure in external service (test-8).....will rethrow as error::State diff --git a/tests/SConscript b/tests/SConscript index 7f66b6284..e662ca044 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -9,6 +9,10 @@ from Buildhelper import globRootdirs Import('env','artifacts','core') +# temp fix to add test.h -- wouldn't it be better to put this header be into src/lib ? +env = env.Clone() +env.Append(CPPPATH='#/.') # add Rootdir to Includepath, so test/test.h is found +# temp fix------------- def testExecutable(env,tree, exeName=None, obj=None): """ declare all targets needed to create a standalone @@ -52,7 +56,7 @@ def treatPluginTestcase(env): moduledirs = globRootdirs('*') # but have to treat some subdirs individually. -specials = ['plugin','locking','library'] +specials = ['plugin','locking','library','backend'] @@ -61,6 +65,10 @@ artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in moduledirs + testExecutable(env, 'locking', obj=['test-locking.c','mutex.c','condition.c']) + testExecutable(env, 'library', exeName='test-llist', obj=['test-llist.c']) + testExecutable(env, 'library', exeName='test-references', obj=['test-references.c']) + + testExecutable(env, 'library', exeName='test-safeclib', obj=['test-safeclib.c']) + + testExecutable(env, 'library', exeName='test-uuid', obj=['test-uuid.c']) + + testExecutable(env, 'backend', exeName='test-filedescriptors', obj=['test-filedescriptors.c']) + + testExecutable(env, 'backend', exeName='test-filehandles', obj=['test-filehandles.c']) ) diff --git a/tests/common/exceptionerrortest.cpp b/tests/common/exceptionerrortest.cpp index 6bc97afbb..e1c133e4f 100644 --- a/tests/common/exceptionerrortest.cpp +++ b/tests/common/exceptionerrortest.cpp @@ -97,7 +97,7 @@ namespace lumiera void throwInvalid (string _) { throw error::Invalid(_); } void throwExternal(string _) { throw error::External(_); } void throwRuntime (string _) { throw std::runtime_error(_); } - void throwExceptn (string _) { throw std::exception(error::State(_)); } + void throwExceptn (string _) { throw std::exception(); } /** @test catching, repackaging and rethrowing of errors. @@ -219,7 +219,7 @@ namespace lumiera catch (error::Invalid&e) { cout << "caught error::Invalid: " << e.what() << "\n"; } catch (Error& e) { cout << "caught lumiera::Error: " << e.what() << "\n"; } catch (runtime_error& e) { cout << "caught std::runtime_error: " << e.what() << "\n"; } - catch (exception& e) { cout << "caught std::exception: " << e.what() << "\n"; } + catch (exception& e) { cout << "caught std::exception. (unspecific)" << "\n"; } catch (...) { cout << "caught an unknown exception\n"; } } }; diff --git a/tests/test.sh b/tests/test.sh index 77bac66bf..d919ed073 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,7 +1,6 @@ #!/bin/bash # Copyright (C) Lumiera.org -# 2007, Christian Thaeter -# Hermann Vosseler +# 2007 - 2008, Christian Thaeter # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as