From fee63d8f06fea4c6f0125410930b3272ea91b235 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 25 Aug 2007 02:07:04 +0200 Subject: [PATCH] added C++ plugin to SCons build; added test for common/appconfig.hpp --- .gitignore | 1 + {src/bin => bin}/DIR_INFO | 0 tests/50components.tests | 5 ++ tests/SConscript | 9 +++- tests/components/common/appconfigtest.cpp | 64 +++++++++++++++++++++++ 5 files changed, 77 insertions(+), 2 deletions(-) rename {src/bin => bin}/DIR_INFO (100%) create mode 100644 tests/components/common/appconfigtest.cpp diff --git a/.gitignore b/.gitignore index ca2f40822..d55b1ba9f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ Buildhelper.pyc optcache Makefile.in build/* +bin/* autom4te.cache/* scripts/* configure diff --git a/src/bin/DIR_INFO b/bin/DIR_INFO similarity index 100% rename from src/bin/DIR_INFO rename to bin/DIR_INFO diff --git a/tests/50components.tests b/tests/50components.tests index 20bb036f1..a0104a255 100644 --- a/tests/50components.tests +++ b/tests/50components.tests @@ -9,6 +9,11 @@ return: 0 END +TEST "Appconfig_test" Appconfig_test < diff --git a/tests/SConscript b/tests/SConscript index dbb7e29a7..3bf0f7396 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -26,8 +26,13 @@ def treatPluginTestcase(env): """ Special case: the test-plugin executable """ env = env.Clone() - env.Append(CPPPATH='plugin') - testplugin = env.SharedLibrary('.libs/example_plugin', 'plugin/example_plugin.c', SHLIBPREFIX='') + env.Append(CPPPATH='plugin') + 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) env.Depends(testExe, testplugin) return testExe diff --git a/tests/components/common/appconfigtest.cpp b/tests/components/common/appconfigtest.cpp new file mode 100644 index 000000000..bf756701a --- /dev/null +++ b/tests/components/common/appconfigtest.cpp @@ -0,0 +1,64 @@ +/* + Appconfig(Test) - accessing the allwasy-available Appconfig singleton + + Copyright (C) CinelerraCV + 2007, 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 + 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 +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 +