diff --git a/SConstruct b/SConstruct index 59ab06d15..9b11e379e 100644 --- a/SConstruct +++ b/SConstruct @@ -60,7 +60,7 @@ def setupBasicEnvironment(): env.Replace( VERSION=VERSION , SRCDIR=SRCDIR , BINDIR=BINDIR - , CPPPATH="#"+SRCDIR # used to find includes, "#" means always absolute to build-root + , CPPPATH=["#"+SRCDIR] # used to find includes, "#" means always absolute to build-root , CPPDEFINES=['-DCINELERRA_VERSION=\\"%s\\"' % VERSION ] # note: make it a list to append further defines , CCFLAGS='-Wall' ) @@ -224,15 +224,15 @@ def defineBuildTargets(env, artifacts): + srcSubtree(env,'$SRCDIR/common') + srcSubtree(env,'$SRCDIR/lib') ) - applobj = cinobj + env.Object('$SRCDIR/main.cpp') plugobj = srcSubtree(env,'$SRCDIR/plugin', isShared=True) + corelib = env.StaticLibrary('$BINDIR/core.la', cinobj) - artifacts['cinelerra'] = env.Program('$BINDIR/cinelerra', applobj) + artifacts['cinelerra'] = env.Program('$BINDIR/cinelerra', ['$SRCDIR/main.cpp']+ corelib ) artifacts['plugins'] = env.SharedLibrary('$BINDIR/cinelerra-plugin', plugobj) # call subdir SConscript(s) for independent components SConscript(dirs=[SRCDIR+'/tool'], exports='env artifacts') - SConscript(dirs=[TESTDIR], exports='env artifacts cinobj') + SConscript(dirs=[TESTDIR], exports='env artifacts corelib') def defineInstallTargets(env, artifacts): diff --git a/tests/10errorhandling.tests b/tests/10errorhandling.tests index 220e1da3d..2492869c5 100644 --- a/tests/10errorhandling.tests +++ b/tests/10errorhandling.tests @@ -1,5 +1,5 @@ -TESTING "Error handling" ./errortest +TESTING "Error handling" ./test-error TEST "no error" < + + 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 + +int main(int argc, char* argv[]) + { + printf("hello sunshine, noBugs whatsoever\n"); + return 0; + } diff --git a/tests/error/DIR_INFO b/tests/error/DIR_INFO new file mode 100644 index 000000000..f5c354ef8 --- /dev/null +++ b/tests/error/DIR_INFO @@ -0,0 +1,3 @@ +example (test) code for errorhandling +The test application to be built from this directory shows how +to use the various error handling features. diff --git a/tests/examples/errortest.c b/tests/error/errortest.c similarity index 100% rename from tests/examples/errortest.c rename to tests/error/errortest.c diff --git a/tests/examples/DIR_INFO b/tests/plugin/DIR_INFO similarity index 73% rename from tests/examples/DIR_INFO rename to tests/plugin/DIR_INFO index 2c5e28d26..19ed2b9e2 100644 --- a/tests/examples/DIR_INFO +++ b/tests/plugin/DIR_INFO @@ -1,3 +1,3 @@ -working example code +working example code for cinelerra's plugin system This directory contains example code which shows how to use specific features. All examples will be build and run as part of the testsuite diff --git a/tests/examples/Makefile.am b/tests/plugin/Makefile.am similarity index 92% rename from tests/examples/Makefile.am rename to tests/plugin/Makefile.am index 5ca03150a..3d29c0670 100644 --- a/tests/examples/Makefile.am +++ b/tests/plugin/Makefile.am @@ -15,11 +15,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -examples_srcdir = $(top_srcdir)/tests/examples -noinst_PROGRAMS += plugin_example +examples_srcdir = $(top_srcdir)/tests/plugin +noinst_PROGRAMS += test-plugin plugin_example_CFLAGS = $(CFLAGS) -std=gnu99 -Wall -Werror -plugin_example_CPPFLAGS = $(CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/lib/ +plugin_example_CPPFLAGS = $(CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/ plugin_example_LDADD = $(builddir)/libcin3.a -lnobugmt -lpthread -ldl plugin_example_SOURCES = $(examples_srcdir)/plugin_main.c diff --git a/tests/examples/example_plugin.c b/tests/plugin/example_plugin.c similarity index 100% rename from tests/examples/example_plugin.c rename to tests/plugin/example_plugin.c diff --git a/tests/examples/hello_interface.h b/tests/plugin/hello_interface.h similarity index 100% rename from tests/examples/hello_interface.h rename to tests/plugin/hello_interface.h diff --git a/tests/examples/plugin_main.c b/tests/plugin/plugin_main.c similarity index 98% rename from tests/examples/plugin_main.c rename to tests/plugin/plugin_main.c index c2346b8da..ff93e2e9f 100644 --- a/tests/examples/plugin_main.c +++ b/tests/plugin/plugin_main.c @@ -7,6 +7,8 @@ int main(int argc, char** argv) { + NOBUG_INIT; + /* we have a plugin 'hello_1' which provides us 2 hello interfaces, one for english and one for german output, open both try them, close them. diff --git a/wiki/index.html b/wiki/index.html index 7f11ae4f7..6b16c2ab8 100755 --- a/wiki/index.html +++ b/wiki/index.html @@ -2333,6 +2333,28 @@ I made this proposal 'final' now further details are likely better worked out in -- ["ct"] [[DateTime(2007-06-27T16:01:52Z)]] +
+
[SCons|http://www.scons.org/] is an //alternate build system// written in Python and using specific python-scripts for defining the buildprocess. These build scripts, called {{{SConstruct}}} and {{{SConsscript}}} are indeed //definitions//, not scripts for //doing// the build. If you are new to SCons (and familiar with make), you should really read the [Introduction of the users guide|http://www.scons.org/doc/0.97/HTML/scons-user/book1.html], because SCons is quite a different beast then make and the autotools.
+
+To learn how to use SCons and to get a better feeling of its strenghtes and weaknesses, Ichthyo started a SCons based build system for cinelerra in July 2007 and will maintain it for some time parallel to the automake system (maintained by Cehteh). Every build system looks good in theory and has some big advantages, but only in real use one can see how much effort is needed to keep up with the demands of a given project.
+
+!some Notes
+* we build always in the top level directory
+* at the moment, we use no separate build directory, rather we place the object files alongside with the sources
+* but we place the created executables and shared libraries into one $BINDIR (configurable in the top level {{{SConstruct}}})
+* note: for SCons, each file (which is buildable) and each directory (containing buildable files) is on itself a Target.
+* additionally, we provide some //aliasses//
+** build == $BINDIR
+** install places some of the created artifacts into $DESTDIR
+** testcode is an alias for all the executables comprising the testsuite
+** check == directory {{{tests}}} and runs the testsuite
+* run scons -h to get additional explanations.
+
+Typically, one would just write the necessary definitions as they come into one global scope. But because the buildscripts are actually Python scripts, ichthyo found it preferable to use some more structuring and break down the code into several python functions and pass all necessary variables as parameters. This may seem overkill at first look, but the cinelerra project is expected to become a large project.
+
+Moreover, one could simply list all needed files or break everything down into a hierarchical build. But instead, we use for most objects a helper function (located in {{{admin/scons/Buildhelper.py}}}) called {{{srcSubtree()}}}, which will scan a directory tree and add all {{{'*.c','*.cpp','*.cc'}}} - files as Object nodes to the build process. Besides that, we use the //hierarchical aproach rather reluctant//: at the moment, only the subtree for separate tools and the tests-directory have a separate buildscript. Probably, the subtree for plugins will get one as well at some point in the future.
+
+
~~This small Tiddler contains usefull Shortcuts, Info, Links~~
 
@@ -3472,7 +3494,7 @@ Portions written by Luke Blanshard are hereby released into the public domain.
 <!--}}}-->
 
-
+
! The Test Script
 To drive the various tests, we use the script {{{tests/test.sh}}}. All tests are run under valgrind control if available unless {{{VALGRINDFLAGS=DISABLE}}} is defined. 
 * The SCons buildsystem will build and run the testcode when executing the target {{{scons tests}}}.
@@ -3495,7 +3517,7 @@ make check
 }}}
 
 ! Writing Tests
-Tests are written in files named {{{NNname.tests}}} in the {{{tests}}} dir, where NN is a number defining the order of the various test files, 'name' should be a descriptive name about whats going to be tested.
+~Test-Definitons are written in files named {{{NNname.tests}}} in the {{{tests}}} dir, where NN is a number defining the order of the various test files, 'name' should be a descriptive name about whats going to be tested.
 
 In a .tests file one has to define following:
 * {{{TESTING <description> <binary>}}} set the program binary to be tested to <binary>, <description> should be a string which is displayed as header before running following tests
@@ -3509,18 +3531,28 @@ If no {{{out:}}} or {{{err:}}} is given, stdout and stderr are not considered as
 
 
-
+
For running the automatic Tests, we use Cehteh's simple [[test.sh|TestSh]].
 
 This page is a proposal (by Ichthyo) how the various tests could be organized.
-* individual Testcases are classes, doing whatsoever and however they see fit.
-* it is up to the individual test classes to take care / handle / isolate themself form any dependencies (similar to the [[philosophy of TestNG|http://www.beust.com/weblog/archives/000082.html]])
-* Testcases are grouped together into thematic (Sub)-Testsuites. Each Testcase has an unique ID and can be tagged with several groupIDs
-* for each Testsuite (=distinct collection of tests) we build an executable linked against the test class objects.
-* moreover, for simple Tests, we can build separate stelf-contained executables or even use other scripts.
-* when we get several Testsuites at some point in the future, we may consider building a shared lib of the test objects.
-* the Testsuite executable should provide some command line magic to select individual tests.
-* Top-level Testsuites or ~Test-Collections for [[test.sh|TestSh]] contain calls to the different (sub)-Suites, together with the expected results/output
+* individual ''Testcases'' are classes, doing whatsoever and however they see fit.
+* it is up to the individual test classes to take care / handle / isolate themself form any ''dependencies'' (similar to the [[philosophy of TestNG|http://www.beust.com/weblog/archives/000082.html]])
+* Testcases are ''grouped'' together into thematic (Sub)-Testsuites. Each Testcase has an unique ID and can be tagged with several groupIDs
+* for running a ''Testsuite'' (=distinct collection of tests) we build an executable linked against the test class objects.
+* moreover, for ''simple Tests'', we can build separate stelf-contained executables or even use other scripts.
+* the Testsuite executable provides some command line magic to select individual tests.
+* Top-level Testsuites or ''~Test-Collections'' for [[test.sh|TestSh]] contain calls to the different (sub)-Suites, together with the expected results/output
+
+!conventions for the Buildsystem
+to help with automating the build, ichthyo would appreciate to have the following conventions.
+* in the {{{tests}}} directory are 
+** the testdefinitions together with {{{test.sh}}}
+** the test-executables, which should named according to the pattern {{{test-XXX}}}
+* below are the source directories for each of the aforementioned test-executables. When such a source directory is named "XXX", the corresponding executable is "test-XXX"
+* each of the source directories, which actually could be source trees, will be compiled and linked together with the cinelerra core classes and files. Thus, it needs to contain exactly //one// main(), but by using commandline parameters, one executable can drive a lot of different tests.
+
+-------
+//as of 18.8.2007, ichthyo has implemented this scheme for the SCons build//