merge after finishing DefaultsManager; build split in several static libs
This commit is contained in:
commit
e04c7d54cb
14 changed files with 338 additions and 85 deletions
58
AUTHORS
Normal file
58
AUTHORS
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
|
||||||
|
Cinelerra(2) Authors
|
||||||
|
====================
|
||||||
|
|
||||||
|
hv=Jack Crossfire <broadcast@earthling.net>
|
||||||
|
j6t=Johannes Sixt <johannes.sixt@telecom.at>
|
||||||
|
minmax=Andraz Tori <Andraz.tori1@guest.arnes.si>
|
||||||
|
herman=Herman Robak <herman@skolelinux.no>
|
||||||
|
baver=Richard Baverstock <baver@thebeever.com>
|
||||||
|
pere=Petter Reinholdtsen <pere@hungry.com>
|
||||||
|
tfheen=Tollef Fog Heen <tollef@add.no>
|
||||||
|
andreask=Andreas Kielb <andreaskielb@web.de>
|
||||||
|
theraz=Tyler Geddes <tgeddes@wgeddes.com>
|
||||||
|
dyce=Gergely Erdelyi <dyce@rovidzar.hu>
|
||||||
|
dreamlx=David Arendt <admin@prnet.org>
|
||||||
|
ga=Gustavo Iniguez <ga@kutxa.homeunix.org>
|
||||||
|
memenk=Michael Eric Menk <meklev@osys.grm.hia.no>
|
||||||
|
benjif=Benjamin Flaming <cinelerra@solobanjo.com>
|
||||||
|
cobra=Kevin Brosius <cobra@compuserve.com>
|
||||||
|
taraba=Mark Taraba <m_taraba@yahoo.com>
|
||||||
|
nate=Nathan Kurz <nate@verse.com>
|
||||||
|
mammique=Camille Harang <mammique@garbure.org>
|
||||||
|
kbielefe=Karl Bielefeldt <uhauufo02@sneakemail.com>
|
||||||
|
alexf=Alex Ferrer <alex@ftconsult.com>
|
||||||
|
pmdumuid=Pierre Dumuid <pierre.dumuid@adelaide.edu.au>
|
||||||
|
giskard=Riccardo Setti <giskard@autistici.org>
|
||||||
|
jstewart=Joe Stewart <jstewart@lurhq.com>
|
||||||
|
doudou=Sylvain Joyeux <doudou@melix.net>
|
||||||
|
rafael2k=Rafael Diniz <rafael@riseup.net>
|
||||||
|
nicolasm=Nicolas Maufrais <e.conti@gmx.net>
|
||||||
|
|
||||||
|
Involved in Lumiera development
|
||||||
|
===============================
|
||||||
|
cehteh=Christian Thaeter <ct@pipapo.org>
|
||||||
|
ichthyo=Hermann Vosseler <Ichthyostega@web.de>
|
||||||
|
plouj=Michael Ploujnikov <ploujj@gmail.com>
|
||||||
|
|
||||||
|
_______________________________________________________________
|
||||||
|
Further Credits
|
||||||
|
|
||||||
|
Parts of the Proc-Layer Implementation are heavily inspired by
|
||||||
|
The Loki Library
|
||||||
|
Copyright (c) 2001 by Andrei Alexandrescu
|
||||||
|
Loki is governed by a MIT-License.
|
||||||
|
See: http://loki-lib.sourceforge.net
|
||||||
|
and the book:
|
||||||
|
Alexandrescu, Andrei.
|
||||||
|
"Modern C++ Design: Generic Programming and Design
|
||||||
|
Patterns Applied". Copyright (c) 2001. Addison-Wesley.
|
||||||
|
ISBN 0201704315
|
||||||
|
|
||||||
|
Loki Copyright Notice:
|
||||||
|
Permission to use, copy, modify, distribute and sell this software for any
|
||||||
|
purpose is hereby granted without fee, provided that the above copyright
|
||||||
|
notice appear in all copies and that both that copyright notice and this
|
||||||
|
permission notice appear in supporting documentation.
|
||||||
|
The author makes no representations about the suitability of this software
|
||||||
|
for any purpose. It is provided "as is" without express or implied warranty.
|
||||||
25
SConstruct
25
SConstruct
|
|
@ -179,7 +179,7 @@ def configurePlatform(env):
|
||||||
if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
|
if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'C'):
|
||||||
print 'Did not find the pthread lib or pthread.h, exiting.'
|
print 'Did not find the pthread lib or pthread.h, exiting.'
|
||||||
else:
|
else:
|
||||||
conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD_H')
|
conf.env.Append(CPPFLAGS = ' -DHAVE_PTHREAD')
|
||||||
conf.env.Append(CCFLAGS = ' -pthread')
|
conf.env.Append(CCFLAGS = ' -pthread')
|
||||||
|
|
||||||
if conf.CheckCHeader('execinfo.h'):
|
if conf.CheckCHeader('execinfo.h'):
|
||||||
|
|
@ -234,24 +234,29 @@ def defineBuildTargets(env, artifacts):
|
||||||
We use a custom function to declare a whole tree of srcfiles.
|
We use a custom function to declare a whole tree of srcfiles.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
lumobj = ( srcSubtree(env,'$SRCDIR/backend')
|
objback = srcSubtree(env,'$SRCDIR/backend')
|
||||||
+ srcSubtree(env,'$SRCDIR/proc')
|
objproc = srcSubtree(env,'$SRCDIR/proc')
|
||||||
+ srcSubtree(env,'$SRCDIR/common')
|
objlib = ( srcSubtree(env,'$SRCDIR/common')
|
||||||
+ srcSubtree(env,'$SRCDIR/lib')
|
+ srcSubtree(env,'$SRCDIR/lib')
|
||||||
)
|
)
|
||||||
plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True)
|
plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True)
|
||||||
core = env.StaticLibrary('$BINDIR/core.la', lumobj)
|
core = ( env.StaticLibrary('$BINDIR/lumiback.la', objback)
|
||||||
#core = lumobj # use this for linking directly
|
+ env.StaticLibrary('$BINDIR/lumiproc.la', objproc)
|
||||||
|
+ env.StaticLibrary('$BINDIR/lumi.la', objlib)
|
||||||
|
)
|
||||||
|
|
||||||
# use PCH to speed up building
|
# use PCH to speed up building
|
||||||
precomp = env.PrecompiledHeader('$SRCDIR/pre')
|
precomp = ( env.PrecompiledHeader('$SRCDIR/pre')
|
||||||
env.Depends(lumobj, precomp)
|
+ env.PrecompiledHeader('$SRCDIR/pre_a')
|
||||||
|
)
|
||||||
|
env.Depends(objproc, precomp)
|
||||||
|
env.Depends(objlib, precomp)
|
||||||
|
|
||||||
artifacts['lumiera'] = env.Program('$BINDIR/lumiera', ['$SRCDIR/main.cpp']+ core )
|
artifacts['lumiera'] = env.Program('$BINDIR/lumiera', ['$SRCDIR/main.cpp']+ core )
|
||||||
artifacts['plugins'] = env.SharedLibrary('$BINDIR/lumiera-plugin', plugobj)
|
artifacts['plugins'] = env.SharedLibrary('$BINDIR/lumiera-plugin', plugobj)
|
||||||
|
|
||||||
# call subdir SConscript(s) for independent components
|
# call subdir SConscript(s) for independent components
|
||||||
SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts')
|
SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts core')
|
||||||
SConscript(dirs=[TESTDIR], exports='env artifacts core')
|
SConscript(dirs=[TESTDIR], exports='env artifacts core')
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -264,7 +269,7 @@ def definePostBuildTargets(env, artifacts):
|
||||||
il = env.Alias('install-lib', '$DESTDIR/lib')
|
il = env.Alias('install-lib', '$DESTDIR/lib')
|
||||||
env.Alias('install', [ib, il])
|
env.Alias('install', [ib, il])
|
||||||
|
|
||||||
build = env.Alias('build', artifacts['lumiera']+artifacts['plugins'])
|
build = env.Alias('build', artifacts['lumiera']+artifacts['plugins']+artifacts['tools'])
|
||||||
allbu = env.Alias('allbuild', build+artifacts['testsuite'])
|
allbu = env.Alias('allbuild', build+artifacts['testsuite'])
|
||||||
env.Default('build')
|
env.Default('build')
|
||||||
# additional files to be cleaned when cleaning 'build'
|
# additional files to be cleaned when cleaning 'build'
|
||||||
|
|
|
||||||
38
admin/vgsuppression.c
Normal file
38
admin/vgsuppression.c
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
vgsuppression.c - Helper program to generate valgrind suppression files
|
||||||
|
|
||||||
|
Copyright (C) Lumiera.org
|
||||||
|
2008, Christian Thaeter <ct@pipapo.org>
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
|
/*
|
||||||
|
just place any problematic calls where valgrind whines about in main (with comments please)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "lib/safeclib.h"
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
/* debian etch glibc is lazy about cleaning up TLS */
|
||||||
|
lumiera_tmpbuf_provide (100);
|
||||||
|
lumiera_tmpbuf_freeall ();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
3
admin/vgsuppression_gen.sh
Executable file
3
admin/vgsuppression_gen.sh
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
valgrind --leak-check=yes --show-reachable=yes --gen-suppressions=all ./vgsuppression 2>&1 | sed '/==[0-9]*==/d;'
|
||||||
12
src/main.cpp
12
src/main.cpp
|
|
@ -23,16 +23,24 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "lumiera.h"
|
#include "proc/lumiera.hpp"
|
||||||
|
|
||||||
using std::cout;
|
using std::cout;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using lumiera::Appconfig;
|
using lumiera::Appconfig;
|
||||||
|
using lumiera::ON_GLOBAL_INIT;
|
||||||
|
using lumiera::ON_GLOBAL_SHUTDOWN;
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
{
|
{
|
||||||
cout << "*** Lumiera NLE for Linux ***" << endl
|
cout << "*** Lumiera NLE for Linux ***" << endl
|
||||||
<< " Version: " << Appconfig::get("version") << endl;
|
<< " Version: " << Appconfig::get("version") << "\n";
|
||||||
|
|
||||||
|
Appconfig::lifecycle (ON_GLOBAL_INIT);
|
||||||
|
|
||||||
|
// great things are happening here....
|
||||||
|
|
||||||
|
Appconfig::lifecycle (ON_GLOBAL_SHUTDOWN);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
52
src/pre.hpp
Normal file
52
src/pre.hpp
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
PRE.hpp - precompiled header collection
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (C) Lumiera.org
|
||||||
|
2008, Christian Thaeter <ct@pipapo.org>
|
||||||
|
Hermann Vosseler <Ichthyostega@web.de>
|
||||||
|
|
||||||
|
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 Collection.
|
||||||
|
** Assortment of standard util, error handling and basic lib-boost components,
|
||||||
|
** frequently used in conjunction. Precompiling these can speedup building
|
||||||
|
** significantly. When used, this header should be included prior to any other
|
||||||
|
** headers (and it needs to be compiled by gcc into a "pre.gch" file prior to
|
||||||
|
** 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
|
||||||
|
#define LUMIERA_PRE_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <tr1/memory>
|
||||||
|
#include <boost/function.hpp>
|
||||||
|
#include <boost/format.hpp>
|
||||||
|
#include <boost/bind.hpp>
|
||||||
|
|
||||||
|
#include "proc/lumiera.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /*LUMIERA_PRE_HPP*/
|
||||||
1
src/proc/DIR_INFO
Normal file
1
src/proc/DIR_INFO
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Lumiera processing core
|
||||||
46
src/proc/lumiera.hpp
Normal file
46
src/proc/lumiera.hpp
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
/*
|
||||||
|
LUMIERA.hpp - global definitions and common types for the Proc-Layer
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (C) Lumiera.org
|
||||||
|
2008, Christian Thaeter <ct@pipapo.org>
|
||||||
|
Hermann Vosseler <Ichthyostega@web.de>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LUMIERA_H
|
||||||
|
#define LUMIERA_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* common types frequently used... */
|
||||||
|
|
||||||
|
#include "common/util.hpp"
|
||||||
|
#include "common/time.hpp"
|
||||||
|
#include "common/error.hpp" ///< pulls in NoBug via nobugcfg.hpp
|
||||||
|
#include "lib/appconfig.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
namespace lumiera
|
||||||
|
{
|
||||||
|
/* additional global configuration goes here... */
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace lumiera
|
||||||
|
|
||||||
|
#endif /*LUMIERA_H*/
|
||||||
45
src/proc/nobugcfg.cpp
Normal file
45
src/proc/nobugcfg.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
NoBugCfg - NoBug definitions and initialisation for the Proc-Layer
|
||||||
|
|
||||||
|
Copyright (C) Lumiera.org
|
||||||
|
2008, Christian Thaeter <ct@pipapo.org>
|
||||||
|
|
||||||
|
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 "proc/nobugcfg.hpp"
|
||||||
|
|
||||||
|
#define NOBUG_INIT_DEFS_
|
||||||
|
#include "proc/nobugcfg.hpp"
|
||||||
|
#undef NOBUG_INIT_DEFS_
|
||||||
|
|
||||||
|
|
||||||
|
namespace lumiera
|
||||||
|
{
|
||||||
|
void
|
||||||
|
initialize_NoBug ()
|
||||||
|
{
|
||||||
|
NOBUG_INIT;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
static uint callCount = 0;
|
||||||
|
ASSERT ( 0 == callCount++ );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
NOBUGCFG.h - global configuration and definitions for NoBug
|
NOBUGCFG.hpp - NoBug definitions and initialisation for the Proc-Layer
|
||||||
|
|
||||||
|
|
||||||
Copyright (C) Lumiera.org
|
Copyright (C) Lumiera.org
|
||||||
|
|
@ -22,17 +22,20 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file nobugcfg.h
|
/** @file nobugcfg.hpp
|
||||||
** This header is for including and configuring NoBug.
|
** This header is for including and configuring NoBug.
|
||||||
** The idea is that configuration and some globally used flag
|
** The idea is that configuration and some globally used flag
|
||||||
** declarations are to be kept in one central location. Normally,
|
** declarations are to be kept in one central location. Normally,
|
||||||
** this header will be included by appconfig.hpp, which in turn gets
|
** this header will be included via some of the basic headers like
|
||||||
** included by lumiera.h
|
** error.hpp, which in turn gets included by proc/lumiera.hpp
|
||||||
|
**
|
||||||
** @par Besides the usual guarded declarations, this header contains
|
** @par Besides the usual guarded declarations, this header contains
|
||||||
** one section with the corresponding <b>definitions</b>. This section
|
** one section with the corresponding <b>definitions</b>. This section
|
||||||
** is to be called by appconfig.cpp only, which deals with application
|
** is to be included once by some translation unit (currently this is
|
||||||
** wide configuration values contained in the Singleton class Appconfig.
|
** nobugcfg.cpp) in order to generate the necessary definitions.
|
||||||
** Incidentally, the constructor of Appconfig issues the NOBUG_INIT call
|
**
|
||||||
|
** @note this header assures automatic initialisation of NoBug
|
||||||
|
** by placing a static ctor call.
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
@ -41,10 +44,9 @@
|
||||||
#define NOBUGCFG_H
|
#define NOBUGCFG_H
|
||||||
|
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
/* configuration of NoBug goes here... */
|
|
||||||
|
|
||||||
#include <nobug.h>
|
#include <nobug.h>
|
||||||
|
#include "lib/appconfig.hpp"
|
||||||
|
#include "common/error.hpp" ///< make assertions throw instead of abort()
|
||||||
|
|
||||||
|
|
||||||
/* declare flags used throughout the code base... */
|
/* declare flags used throughout the code base... */
|
||||||
|
|
@ -56,6 +58,11 @@
|
||||||
NOBUG_DECLARE_FLAG(mobjectmem);
|
NOBUG_DECLARE_FLAG(mobjectmem);
|
||||||
|
|
||||||
|
|
||||||
|
namespace lumiera {
|
||||||
|
void initialize_NoBug ();
|
||||||
|
namespace {
|
||||||
|
LifecycleHook schedule_ (ON_BASIC_INIT, &initialize_NoBug);
|
||||||
|
} }
|
||||||
#endif /*NOBUGCFG_H ======= (End) Part 1: DECLARATIONS ======== */
|
#endif /*NOBUGCFG_H ======= (End) Part 1: DECLARATIONS ======== */
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -65,15 +72,6 @@
|
||||||
|
|
||||||
#ifdef NOBUG_INIT_DEFS_ /*========== Part 2: DEFINITIONS ========= */
|
#ifdef NOBUG_INIT_DEFS_ /*========== Part 2: DEFINITIONS ========= */
|
||||||
|
|
||||||
/* ================================= common C Part ========= */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus /* ============== C++-Part ============== */
|
|
||||||
|
|
||||||
|
|
||||||
/* flags used throughout the code base... */
|
/* flags used throughout the code base... */
|
||||||
NOBUG_CPP_DEFINE_FLAG(config);
|
NOBUG_CPP_DEFINE_FLAG(config);
|
||||||
|
|
@ -83,10 +81,6 @@
|
||||||
NOBUG_CPP_DEFINE_FLAG_LIMIT(assetmem, LOG_WARNING);
|
NOBUG_CPP_DEFINE_FLAG_LIMIT(assetmem, LOG_WARNING);
|
||||||
NOBUG_CPP_DEFINE_FLAG_LIMIT(mobjectmem, LOG_WARNING);
|
NOBUG_CPP_DEFINE_FLAG_LIMIT(mobjectmem, LOG_WARNING);
|
||||||
|
|
||||||
#include "common/error.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* ===================== (End) C++-Part ============= */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
## SConscript - SCons buildscript for tool subdirectory (called by SConstruct)
|
## SConscript - SCons buildscript for tool subdirectory (called by SConstruct)
|
||||||
##
|
##
|
||||||
|
|
||||||
Import('env','artifacts')
|
Import('env','artifacts','core')
|
||||||
|
|
||||||
|
|
||||||
# build the ubiquitous Hello World application (note: C source)
|
# build the ubiquitous Hello World application (note: C source)
|
||||||
artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c')
|
artifacts['tools'] = [ env.Program('#$BINDIR/hello-world','hello.c')
|
||||||
+ env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature:
|
+ env.Program('#$BINDIR/try', 'try.cpp') #### to try out some feature...
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,18 +7,19 @@
|
||||||
// execute with NOBUG_LOG='ttt:TRACE' bin/try
|
// execute with NOBUG_LOG='ttt:TRACE' bin/try
|
||||||
// 1/08 - working out a static initialisation problem for Visitor (Tag creation)
|
// 1/08 - working out a static initialisation problem for Visitor (Tag creation)
|
||||||
// 1/08 - check 64bit longs
|
// 1/08 - check 64bit longs
|
||||||
|
// 4/08 - comparison operators on shared_ptr<Asset>
|
||||||
|
|
||||||
|
|
||||||
#include <nobug.h>
|
#include <nobug.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <typeinfo>
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::cout;
|
using std::cout;
|
||||||
|
|
||||||
NOBUG_CPP_DEFINE_FLAG(test);
|
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char* argv[])
|
int main (int argc, char* argv[])
|
||||||
|
|
@ -26,12 +27,8 @@ int main (int argc, char* argv[])
|
||||||
|
|
||||||
NOBUG_INIT;
|
NOBUG_INIT;
|
||||||
|
|
||||||
int64_t lol (1);
|
cout << "\ngulp\n";
|
||||||
cout << sizeof(lol)<< "\n";
|
|
||||||
|
|
||||||
cout << "long: "<< std::numeric_limits<long>::max()
|
|
||||||
<<" 64: " << std::numeric_limits<int64_t>::max()
|
|
||||||
<<"\n";
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
TESTING "test system selftest" cat
|
TESTING "test system selftest" /bin/cat
|
||||||
|
|
||||||
TEST "test cat'ing stdin to stdout" <<END
|
TEST "test cat'ing stdin to stdout" <<END
|
||||||
in: foo: bar
|
in: foo: bar
|
||||||
|
|
@ -7,7 +7,7 @@ return: 0
|
||||||
END
|
END
|
||||||
|
|
||||||
TEST "test stderr, cat'ing noonexistant file" ,nonexistent_file <<END
|
TEST "test stderr, cat'ing noonexistant file" ,nonexistent_file <<END
|
||||||
err: cat: ,nonexistent_file: No such file or directory
|
err: /bin/cat: ,nonexistent_file: No such file or directory
|
||||||
return: 1
|
return: 1
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
|
|
||||||
arg0="$0"
|
arg0="$0"
|
||||||
srcdir=$(dirname "$arg0")
|
srcdir="$(dirname "$arg0")"
|
||||||
|
|
||||||
ulimit -S -t 1 -v 524288
|
ulimit -S -t 1 -v 524288
|
||||||
valgrind=""
|
valgrind=""
|
||||||
|
|
@ -45,7 +45,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo ================ ${0##*/} ================
|
echo "================ ${0##*/} ================"
|
||||||
|
|
||||||
TESTCNT=0
|
TESTCNT=0
|
||||||
SKIPCNT=0
|
SKIPCNT=0
|
||||||
|
|
@ -84,7 +84,7 @@ function TEST()
|
||||||
echo "$arg" >>,expect_stderr
|
echo "$arg" >>,expect_stderr
|
||||||
;;
|
;;
|
||||||
'return')
|
'return')
|
||||||
expect_return=$arg
|
expect_return="$arg"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "UNKOWN TEST COMMAND '$cmd'" 1>&2
|
echo "UNKOWN TEST COMMAND '$cmd'" 1>&2
|
||||||
|
|
@ -95,7 +95,7 @@ function TEST()
|
||||||
echo -n "TEST $name: "
|
echo -n "TEST $name: "
|
||||||
echo -en "\nTEST $name: $* " >>,testlog
|
echo -en "\nTEST $name: $* " >>,testlog
|
||||||
|
|
||||||
case $TESTMODE in
|
case "$TESTMODE" in
|
||||||
*FAST*)
|
*FAST*)
|
||||||
if grep "^TEST $name: .* FAILED" ,testlog.pre >&/dev/null; then
|
if grep "^TEST $name: .* FAILED" ,testlog.pre >&/dev/null; then
|
||||||
MSGOK=" (fixed)"
|
MSGOK=" (fixed)"
|
||||||
|
|
@ -121,7 +121,14 @@ function TEST()
|
||||||
|
|
||||||
fails=0
|
fails=0
|
||||||
|
|
||||||
|
echo -n >,testtmp
|
||||||
|
|
||||||
|
if ! test -x $TESTBIN; then
|
||||||
|
echo -n >,stdout
|
||||||
|
echo "test binary '$TESTBIN' not found" >,stderr
|
||||||
|
((fails+=1))
|
||||||
|
|
||||||
|
else
|
||||||
if test -f ,send_stdin; then
|
if test -f ,send_stdin; then
|
||||||
cat ,send_stdin | $valgrind $TESTBIN "$@" 2>,stderr >,stdout
|
cat ,send_stdin | $valgrind $TESTBIN "$@" 2>,stderr >,stdout
|
||||||
else
|
else
|
||||||
|
|
@ -129,8 +136,6 @@ function TEST()
|
||||||
fi &>/dev/null
|
fi &>/dev/null
|
||||||
return=$?
|
return=$?
|
||||||
|
|
||||||
echo -n >,testtmp
|
|
||||||
|
|
||||||
if test -f ,expect_stdout; then
|
if test -f ,expect_stdout; then
|
||||||
if ! cmp ,expect_stdout ,stdout &>/dev/null; then
|
if ! cmp ,expect_stdout ,stdout &>/dev/null; then
|
||||||
echo "unexpected data on stdout" >>,testtmp
|
echo "unexpected data on stdout" >>,testtmp
|
||||||
|
|
@ -151,10 +156,11 @@ function TEST()
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test $expect_return != $return; then
|
if test "$expect_return" != "$return"; then
|
||||||
echo "unexpected return value $return" >>,testtmp
|
echo "unexpected return value $return" >>,testtmp
|
||||||
((fails+=1))
|
((fails+=1))
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test $fails -eq 0; then
|
if test $fails -eq 0; then
|
||||||
echo ".. OK$MSGOK"
|
echo ".. OK$MSGOK"
|
||||||
|
|
@ -191,7 +197,7 @@ function RUNTESTS()
|
||||||
if test \( ! "${TESTSUITES/*,*/}" \) -a "$TESTSUITES"; then
|
if test \( ! "${TESTSUITES/*,*/}" \) -a "$TESTSUITES"; then
|
||||||
TESTSUITES="{$TESTSUITES}"
|
TESTSUITES="{$TESTSUITES}"
|
||||||
fi
|
fi
|
||||||
for t in $(eval echo $srcdir/*$TESTSUITES*.tests); do
|
for t in $(eval echo "$srcdir/*$TESTSUITES*.tests"); do
|
||||||
echo "$t"
|
echo "$t"
|
||||||
done | sort | uniq | {
|
done | sort | uniq | {
|
||||||
while read i; do
|
while read i; do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue