From 024e3c4dbcd4252bc0ef318aac5b1ccc91785937 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 12 Apr 2008 04:55:18 +0200 Subject: [PATCH] change build to link in separate libs, also split test executable. now building liblumiback.a liblumiproc.a liblumi.a build a separate test-common executable (for everything in src/common) include a precompiled header for assets. --- SConstruct | 23 +++++---- src/pre.hpp | 1 + src/pre_a.hpp | 49 +++++++++++++++++++ src/proc/asset.hpp | 2 - src/proc/asset/db.hpp | 2 + src/proc/asset/media.hpp | 2 + src/proc/asset/meta.hpp | 2 + src/proc/asset/proc.hpp | 2 + src/proc/asset/struct.hpp | 2 + src/proc/assetmanager.hpp | 2 + tests/50components.tests | 2 +- tests/52query.tests | 2 +- .../{components => }/common/appconfigtest.cpp | 0 .../common/customsharedptrtest.cpp | 0 .../common/exceptionerrortest.cpp | 0 .../common/factoryspecialtest.cpp | 6 +-- tests/{components => }/common/factorytest.cpp | 2 +- .../{components => common}/helloworldtest.cpp | 0 tests/common/mainsuite.cpp | 42 ++++++++++++++++ .../common/query/querydiagnostics.hpp | 0 .../common/query/queryutilstest.cpp | 2 +- .../common/removefromsettest.cpp | 0 .../common/sanitizedidentifiertest.cpp | 0 .../common/singletonsubclasstest.cpp | 6 +-- .../{components => }/common/singletontest.cpp | 6 +-- .../common/singletontestmocktest.cpp | 0 .../common/test/cmdlinewrappertest.cpp | 0 .../common/test/testoptiontest.cpp | 0 .../{components => }/common/testtargetobj.hpp | 0 .../{components => }/common/typelisttest.cpp | 0 .../common/typelistutiltest.cpp | 0 .../common/visitingtoolconcept.cpp | 0 .../common/visitingtoolextendedtest.cpp | 0 .../common/visitingtooltest.cpp | 0 tests/components/mainsuite.cpp | 43 +--------------- tests/components/proc/asset/testasset.hpp | 2 + .../mobject/session/defsmanagerimpltest.cpp | 2 + .../proc/mobject/session/defsmanagertest.cpp | 2 + .../mobject/session/defsregistryimpltest.cpp | 2 +- 39 files changed, 139 insertions(+), 67 deletions(-) create mode 100644 src/pre_a.hpp rename tests/{components => }/common/appconfigtest.cpp (100%) rename tests/{components => }/common/customsharedptrtest.cpp (100%) rename tests/{components => }/common/exceptionerrortest.cpp (100%) rename tests/{components => }/common/factoryspecialtest.cpp (99%) rename tests/{components => }/common/factorytest.cpp (99%) rename tests/{components => common}/helloworldtest.cpp (100%) create mode 100644 tests/common/mainsuite.cpp rename tests/{components => }/common/query/querydiagnostics.hpp (100%) rename tests/{components => }/common/query/queryutilstest.cpp (99%) rename tests/{components => }/common/removefromsettest.cpp (100%) rename tests/{components => }/common/sanitizedidentifiertest.cpp (100%) rename tests/{components => }/common/singletonsubclasstest.cpp (99%) rename tests/{components => }/common/singletontest.cpp (99%) rename tests/{components => }/common/singletontestmocktest.cpp (100%) rename tests/{components => }/common/test/cmdlinewrappertest.cpp (100%) rename tests/{components => }/common/test/testoptiontest.cpp (100%) rename tests/{components => }/common/testtargetobj.hpp (100%) rename tests/{components => }/common/typelisttest.cpp (100%) rename tests/{components => }/common/typelistutiltest.cpp (100%) rename tests/{components => }/common/visitingtoolconcept.cpp (100%) rename tests/{components => }/common/visitingtoolextendedtest.cpp (100%) rename tests/{components => }/common/visitingtooltest.cpp (100%) mode change 100644 => 120000 tests/components/mainsuite.cpp diff --git a/SConstruct b/SConstruct index 355f2b941..cef5ebda0 100644 --- a/SConstruct +++ b/SConstruct @@ -234,18 +234,23 @@ def defineBuildTargets(env, artifacts): We use a custom function to declare a whole tree of srcfiles. """ - lumobj = ( srcSubtree(env,'$SRCDIR/backend') - + srcSubtree(env,'$SRCDIR/proc') - + srcSubtree(env,'$SRCDIR/common') - + srcSubtree(env,'$SRCDIR/lib') - ) + objback = srcSubtree(env,'$SRCDIR/backend') + objproc = srcSubtree(env,'$SRCDIR/proc') + objlib = ( srcSubtree(env,'$SRCDIR/common') + + srcSubtree(env,'$SRCDIR/lib') + ) plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True) - core = env.StaticLibrary('$BINDIR/core.la', lumobj) - #core = lumobj # use this for linking directly + core = ( env.StaticLibrary('$BINDIR/lumiback.la', objback) + + env.StaticLibrary('$BINDIR/lumiproc.la', objproc) + + env.StaticLibrary('$BINDIR/lumi.la', objlib) + ) # use PCH to speed up building - precomp = env.PrecompiledHeader('$SRCDIR/pre') - env.Depends(lumobj, precomp) + precomp = ( env.PrecompiledHeader('$SRCDIR/pre') + + env.PrecompiledHeader('$SRCDIR/pre_a') + ) + env.Depends(objproc, precomp) + env.Depends(objlib, precomp) artifacts['lumiera'] = env.Program('$BINDIR/lumiera', ['$SRCDIR/main.cpp']+ core ) artifacts['plugins'] = env.SharedLibrary('$BINDIR/lumiera-plugin', plugobj) diff --git a/src/pre.hpp b/src/pre.hpp index 19717c2bb..203613c3d 100644 --- a/src/pre.hpp +++ b/src/pre.hpp @@ -31,6 +31,7 @@ ** building the object files including this header). ** ** @see mobject.hpp usage example + ** @see pre_a.hpp precompiled header including Asset subsystem */ #ifndef LUMIERA_PRE_HPP diff --git a/src/pre_a.hpp b/src/pre_a.hpp new file mode 100644 index 000000000..34a8e72f2 --- /dev/null +++ b/src/pre_a.hpp @@ -0,0 +1,49 @@ +/* + PRE_A.hpp - precompiled header (including assets) + + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file pre.hpp + ** Precompiled Header including Asset subsystem. + ** Assortment of standard util, error handling and basic lib-boost components, + ** together with the basic asset.hpp. + ** + ** @see pre.hpp + */ + +#ifndef LUMIERA_PRE_A_HPP +#define LUMIERA_PRE_A_HPP + + +#include +#include +#include +#include +#include +#include +#include + +#include "lumiera.h" +#include "proc/asset.hpp" + + +#endif /*LUMIERA_PRE_A_HPP*/ diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index 7088b8324..ec1c64ef9 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -55,8 +55,6 @@ #define PROC_INTERFACE_ASSET_H -#include "pre.hpp" - #include "proc/asset/category.hpp" #include "common/error.hpp" #include "common/p.hpp" diff --git a/src/proc/asset/db.hpp b/src/proc/asset/db.hpp index 493a188cf..cb32868d7 100644 --- a/src/proc/asset/db.hpp +++ b/src/proc/asset/db.hpp @@ -25,6 +25,8 @@ #define ASSET_DB_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/error.hpp" diff --git a/src/proc/asset/media.hpp b/src/proc/asset/media.hpp index ce43d6231..4e122cd53 100644 --- a/src/proc/asset/media.hpp +++ b/src/proc/asset/media.hpp @@ -35,6 +35,8 @@ #ifndef ASSET_MEDIA_H #define ASSET_MEDIA_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/factory.hpp" #include "proc/mobject/mobject.hpp" diff --git a/src/proc/asset/meta.hpp b/src/proc/asset/meta.hpp index 89500c226..02be992db 100644 --- a/src/proc/asset/meta.hpp +++ b/src/proc/asset/meta.hpp @@ -36,6 +36,8 @@ #ifndef ASSET_META_H #define ASSET_META_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/factory.hpp" diff --git a/src/proc/asset/proc.hpp b/src/proc/asset/proc.hpp index 12e69812c..05eca4ddf 100644 --- a/src/proc/asset/proc.hpp +++ b/src/proc/asset/proc.hpp @@ -35,6 +35,8 @@ #ifndef ASSET_PROC_H #define ASSET_PROC_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/factory.hpp" diff --git a/src/proc/asset/struct.hpp b/src/proc/asset/struct.hpp index df6c5f1f6..7c4c4367b 100644 --- a/src/proc/asset/struct.hpp +++ b/src/proc/asset/struct.hpp @@ -37,6 +37,8 @@ #ifndef ASSET_STRUCT_H #define ASSET_STRUCT_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/query.hpp" #include "common/factory.hpp" diff --git a/src/proc/assetmanager.hpp b/src/proc/assetmanager.hpp index 610e0d1dc..22138065d 100644 --- a/src/proc/assetmanager.hpp +++ b/src/proc/assetmanager.hpp @@ -36,6 +36,8 @@ #define PROC_INTERFACE_ASSETMANAGER_H +#include "pre_a.hpp" + #include "proc/asset.hpp" #include "common/error.hpp" #include "common/singleton.hpp" diff --git a/tests/50components.tests b/tests/50components.tests index d2d38e5d0..63e97cf9a 100644 --- a/tests/50components.tests +++ b/tests/50components.tests @@ -1,4 +1,4 @@ -TESTING "Component Test Suite: common and basic components" ./test-components --group=common +TESTING "Component Test Suite: common and basic components" ./test-common --group=common diff --git a/tests/52query.tests b/tests/52query.tests index 2c598b3b0..799875d7b 100644 --- a/tests/52query.tests +++ b/tests/52query.tests @@ -1,4 +1,4 @@ -TESTING "Proc Layer config rules Test Suite" ./test-components --group=query +TESTING "Proc Layer config rules Test Suite" ./test-common --group=query diff --git a/tests/components/common/appconfigtest.cpp b/tests/common/appconfigtest.cpp similarity index 100% rename from tests/components/common/appconfigtest.cpp rename to tests/common/appconfigtest.cpp diff --git a/tests/components/common/customsharedptrtest.cpp b/tests/common/customsharedptrtest.cpp similarity index 100% rename from tests/components/common/customsharedptrtest.cpp rename to tests/common/customsharedptrtest.cpp diff --git a/tests/components/common/exceptionerrortest.cpp b/tests/common/exceptionerrortest.cpp similarity index 100% rename from tests/components/common/exceptionerrortest.cpp rename to tests/common/exceptionerrortest.cpp diff --git a/tests/components/common/factoryspecialtest.cpp b/tests/common/factoryspecialtest.cpp similarity index 99% rename from tests/components/common/factoryspecialtest.cpp rename to tests/common/factoryspecialtest.cpp index ecf293cd9..eaf50fe42 100644 --- a/tests/components/common/factoryspecialtest.cpp +++ b/tests/common/factoryspecialtest.cpp @@ -21,12 +21,12 @@ * *****************************************************/ -#include "common/testtargetobj.hpp" -#include "common/factory.hpp" - #include "common/test/run.hpp" #include "common/util.hpp" +#include "testtargetobj.hpp" +#include "common/factory.hpp" + #include #include #include diff --git a/tests/components/common/factorytest.cpp b/tests/common/factorytest.cpp similarity index 99% rename from tests/components/common/factorytest.cpp rename to tests/common/factorytest.cpp index 6c96a337c..bde121a8c 100644 --- a/tests/components/common/factorytest.cpp +++ b/tests/common/factorytest.cpp @@ -21,7 +21,7 @@ * *****************************************************/ -#include "common/testtargetobj.hpp" +#include "testtargetobj.hpp" #include "common/test/run.hpp" #include "common/factory.hpp" diff --git a/tests/components/helloworldtest.cpp b/tests/common/helloworldtest.cpp similarity index 100% rename from tests/components/helloworldtest.cpp rename to tests/common/helloworldtest.cpp diff --git a/tests/common/mainsuite.cpp b/tests/common/mainsuite.cpp new file mode 100644 index 000000000..aa500cdbe --- /dev/null +++ b/tests/common/mainsuite.cpp @@ -0,0 +1,42 @@ +/* + mainsuite.cpp - "the" Lumiera self test suite + + Copyright (C) Lumiera.org + 2008, Christian Thaeter + Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#include "common/test/suite.hpp" +#include "common/test/testoption.hpp" + +/** run all tests or any single test specified in the first + * cmd line argument. + * Note: to ease debugging, we don't catch any exceptions. + */ +int main (int argc, char* argv[]) +{ + util::Cmdline args (argc,argv); + test::TestOption optparser (args); + test::Suite suite (optparser.getTestgroup()); + + if (optparser.getDescribe()) + suite.describe(); + else + suite.run (args); + return 0; +} diff --git a/tests/components/common/query/querydiagnostics.hpp b/tests/common/query/querydiagnostics.hpp similarity index 100% rename from tests/components/common/query/querydiagnostics.hpp rename to tests/common/query/querydiagnostics.hpp diff --git a/tests/components/common/query/queryutilstest.cpp b/tests/common/query/queryutilstest.cpp similarity index 99% rename from tests/components/common/query/queryutilstest.cpp rename to tests/common/query/queryutilstest.cpp index 05cfab7ef..fc5e914a9 100644 --- a/tests/components/common/query/queryutilstest.cpp +++ b/tests/common/query/queryutilstest.cpp @@ -26,7 +26,7 @@ #include "common/cmdline.hpp" #include "common/query.hpp" -#include "common/query/querydiagnostics.hpp" +#include "query/querydiagnostics.hpp" #include #include diff --git a/tests/components/common/removefromsettest.cpp b/tests/common/removefromsettest.cpp similarity index 100% rename from tests/components/common/removefromsettest.cpp rename to tests/common/removefromsettest.cpp diff --git a/tests/components/common/sanitizedidentifiertest.cpp b/tests/common/sanitizedidentifiertest.cpp similarity index 100% rename from tests/components/common/sanitizedidentifiertest.cpp rename to tests/common/sanitizedidentifiertest.cpp diff --git a/tests/components/common/singletonsubclasstest.cpp b/tests/common/singletonsubclasstest.cpp similarity index 99% rename from tests/components/common/singletonsubclasstest.cpp rename to tests/common/singletonsubclasstest.cpp index aad667b9f..cdbdd6934 100644 --- a/tests/components/common/singletonsubclasstest.cpp +++ b/tests/common/singletonsubclasstest.cpp @@ -21,12 +21,12 @@ * *****************************************************/ -#include "common/testtargetobj.hpp" -#include "common/singletonsubclass.hpp" - #include "common/test/run.hpp" #include "common/util.hpp" +#include "testtargetobj.hpp" +#include "common/singletonsubclass.hpp" + #include #include #include diff --git a/tests/components/common/singletontest.cpp b/tests/common/singletontest.cpp similarity index 99% rename from tests/components/common/singletontest.cpp rename to tests/common/singletontest.cpp index b531d7e9c..9960ff911 100644 --- a/tests/components/common/singletontest.cpp +++ b/tests/common/singletontest.cpp @@ -21,12 +21,12 @@ * *****************************************************/ -#include "common/testtargetobj.hpp" - #include "common/test/run.hpp" -#include "common/singleton.hpp" #include "common/util.hpp" +#include "testtargetobj.hpp" +#include "common/singleton.hpp" + #include #include #include diff --git a/tests/components/common/singletontestmocktest.cpp b/tests/common/singletontestmocktest.cpp similarity index 100% rename from tests/components/common/singletontestmocktest.cpp rename to tests/common/singletontestmocktest.cpp diff --git a/tests/components/common/test/cmdlinewrappertest.cpp b/tests/common/test/cmdlinewrappertest.cpp similarity index 100% rename from tests/components/common/test/cmdlinewrappertest.cpp rename to tests/common/test/cmdlinewrappertest.cpp diff --git a/tests/components/common/test/testoptiontest.cpp b/tests/common/test/testoptiontest.cpp similarity index 100% rename from tests/components/common/test/testoptiontest.cpp rename to tests/common/test/testoptiontest.cpp diff --git a/tests/components/common/testtargetobj.hpp b/tests/common/testtargetobj.hpp similarity index 100% rename from tests/components/common/testtargetobj.hpp rename to tests/common/testtargetobj.hpp diff --git a/tests/components/common/typelisttest.cpp b/tests/common/typelisttest.cpp similarity index 100% rename from tests/components/common/typelisttest.cpp rename to tests/common/typelisttest.cpp diff --git a/tests/components/common/typelistutiltest.cpp b/tests/common/typelistutiltest.cpp similarity index 100% rename from tests/components/common/typelistutiltest.cpp rename to tests/common/typelistutiltest.cpp diff --git a/tests/components/common/visitingtoolconcept.cpp b/tests/common/visitingtoolconcept.cpp similarity index 100% rename from tests/components/common/visitingtoolconcept.cpp rename to tests/common/visitingtoolconcept.cpp diff --git a/tests/components/common/visitingtoolextendedtest.cpp b/tests/common/visitingtoolextendedtest.cpp similarity index 100% rename from tests/components/common/visitingtoolextendedtest.cpp rename to tests/common/visitingtoolextendedtest.cpp diff --git a/tests/components/common/visitingtooltest.cpp b/tests/common/visitingtooltest.cpp similarity index 100% rename from tests/components/common/visitingtooltest.cpp rename to tests/common/visitingtooltest.cpp diff --git a/tests/components/mainsuite.cpp b/tests/components/mainsuite.cpp deleted file mode 100644 index aa500cdbe..000000000 --- a/tests/components/mainsuite.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - mainsuite.cpp - "the" Lumiera self test suite - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - Hermann Vosseler - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#include "common/test/suite.hpp" -#include "common/test/testoption.hpp" - -/** run all tests or any single test specified in the first - * cmd line argument. - * Note: to ease debugging, we don't catch any exceptions. - */ -int main (int argc, char* argv[]) -{ - util::Cmdline args (argc,argv); - test::TestOption optparser (args); - test::Suite suite (optparser.getTestgroup()); - - if (optparser.getDescribe()) - suite.describe(); - else - suite.run (args); - return 0; -} diff --git a/tests/components/mainsuite.cpp b/tests/components/mainsuite.cpp new file mode 120000 index 000000000..3c6dd11cb --- /dev/null +++ b/tests/components/mainsuite.cpp @@ -0,0 +1 @@ +../common/mainsuite.cpp \ No newline at end of file diff --git a/tests/components/proc/asset/testasset.hpp b/tests/components/proc/asset/testasset.hpp index e1abc57d2..9ba16a4e6 100644 --- a/tests/components/proc/asset/testasset.hpp +++ b/tests/components/proc/asset/testasset.hpp @@ -25,6 +25,8 @@ #define ASSET_TESTASSET_H +#include "pre_a.hpp" + #include "proc/asset.hpp" //#include "common/util.hpp" diff --git a/tests/components/proc/mobject/session/defsmanagerimpltest.cpp b/tests/components/proc/mobject/session/defsmanagerimpltest.cpp index 8aa773d5f..85f1c088c 100644 --- a/tests/components/proc/mobject/session/defsmanagerimpltest.cpp +++ b/tests/components/proc/mobject/session/defsmanagerimpltest.cpp @@ -21,6 +21,8 @@ * *****************************************************/ +#include "pre_a.hpp" + #include "common/test/run.hpp" #include "common/util.hpp" diff --git a/tests/components/proc/mobject/session/defsmanagertest.cpp b/tests/components/proc/mobject/session/defsmanagertest.cpp index 5f5ed686e..8c819c7f2 100644 --- a/tests/components/proc/mobject/session/defsmanagertest.cpp +++ b/tests/components/proc/mobject/session/defsmanagertest.cpp @@ -21,6 +21,8 @@ * *****************************************************/ +#include "pre_a.hpp" + #include "common/test/run.hpp" #include "common/util.hpp" diff --git a/tests/components/proc/mobject/session/defsregistryimpltest.cpp b/tests/components/proc/mobject/session/defsregistryimpltest.cpp index b67b6cbe2..0aae90b3a 100644 --- a/tests/components/proc/mobject/session/defsregistryimpltest.cpp +++ b/tests/components/proc/mobject/session/defsregistryimpltest.cpp @@ -28,7 +28,7 @@ #include "common/factory.hpp" #include "common/query.hpp" -#include "common/query/querydiagnostics.hpp" +#include "../common/query/querydiagnostics.hpp" #include #include