added C++ plugin to SCons build; added test for common/appconfig.hpp
This commit is contained in:
parent
8c7a2055e8
commit
fee63d8f06
5 changed files with 77 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,6 +7,7 @@ Buildhelper.pyc
|
||||||
optcache
|
optcache
|
||||||
Makefile.in
|
Makefile.in
|
||||||
build/*
|
build/*
|
||||||
|
bin/*
|
||||||
autom4te.cache/*
|
autom4te.cache/*
|
||||||
scripts/*
|
scripts/*
|
||||||
configure
|
configure
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,11 @@ return: 0
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
TEST "Appconfig_test" Appconfig_test <<END
|
||||||
|
return: 0
|
||||||
|
END
|
||||||
|
|
||||||
|
|
||||||
TEST "CmdlineWrapper_test" CmdlineWrapper_test <<END
|
TEST "CmdlineWrapper_test" CmdlineWrapper_test <<END
|
||||||
out: wrapping cmdline:...
|
out: wrapping cmdline:...
|
||||||
out: -->
|
out: -->
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,13 @@ def treatPluginTestcase(env):
|
||||||
""" Special case: the test-plugin executable
|
""" Special case: the test-plugin executable
|
||||||
"""
|
"""
|
||||||
env = env.Clone()
|
env = env.Clone()
|
||||||
env.Append(CPPPATH='plugin')
|
env.Append(CPPPATH='plugin')
|
||||||
testplugin = env.SharedLibrary('.libs/example_plugin', 'plugin/example_plugin.c', SHLIBPREFIX='')
|
prfx = 'plugin/example_plugin'
|
||||||
|
oC = env.SharedObject(prfx, prfx+'.c')
|
||||||
|
oCPP = env.SharedObject(prfx+'_cpp', prfx+'.cpp')
|
||||||
|
testplugin = ( env.SharedLibrary('.libs/example_plugin', oC, SHLIBPREFIX='')
|
||||||
|
+ env.SharedLibrary('.libs/example_plugin_cpp', oCPP, SHLIBPREFIX='')
|
||||||
|
)
|
||||||
testExe = env.Program('test-plugin', ['plugin/plugin_main.c'] + corelib)
|
testExe = env.Program('test-plugin', ['plugin/plugin_main.c'] + corelib)
|
||||||
env.Depends(testExe, testplugin)
|
env.Depends(testExe, testplugin)
|
||||||
return testExe
|
return testExe
|
||||||
|
|
|
||||||
64
tests/components/common/appconfigtest.cpp
Normal file
64
tests/components/common/appconfigtest.cpp
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
/*
|
||||||
|
Appconfig(Test) - accessing the allwasy-available Appconfig singleton
|
||||||
|
|
||||||
|
Copyright (C) CinelerraCV
|
||||||
|
2007, 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 "nobugcfg.h"
|
||||||
|
|
||||||
|
#include "common/appconfig.hpp"
|
||||||
|
|
||||||
|
#include "common/test/run.hpp"
|
||||||
|
#include "common/util.hpp"
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
using std::cout;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace cinelerra
|
||||||
|
{
|
||||||
|
namespace test
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
class Appconfig_test : public Test
|
||||||
|
{
|
||||||
|
virtual void run (Arg arg)
|
||||||
|
{
|
||||||
|
testAccess("version");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @test accessing a value from cinelerra::Appconfig */
|
||||||
|
void testAccess (const string& key)
|
||||||
|
{
|
||||||
|
string ver = cinelerra::Appconfig::get(key);
|
||||||
|
ASSERT ( !util::isnil(ver));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LAUNCHER (Appconfig_test, "function common");
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace test
|
||||||
|
|
||||||
|
} // namespace util
|
||||||
|
|
||||||
Loading…
Reference in a new issue