[simplectest-dev] SF.net SVN: simplectest:[29] trunk/examples
Brought to you by:
jevonwright
|
From: <ml...@us...> - 2011-03-07 02:18:13
|
Revision: 29
http://simplectest.svn.sourceforge.net/simplectest/?rev=29&view=rev
Author: mlg7
Date: 2011-03-07 02:18:07 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
added a scons example project
Added Paths:
-----------
trunk/examples/scons/
trunk/examples/scons/SConstruct
Property changes on: trunk/examples/scons
___________________________________________________________________
Added: svn:externals
+ ../../aux-shared/hello-test/whatWasGenerated whatWasGenerated
../../aux-shared/hello-test/tests tests
../../aux-shared/hello-test/main.cpp main.cpp
../../aux-shared/hello-test/add.cpp add.cpp
../../aux-shared/hello-test/sub.cpp sub.cpp
../../aux-shared/hello-test/add.h add.h
../../aux-shared/hello-test/sub.h sub.h
../../aux-shared/hello-test/read.me read.me
../../src/license.txt license.txt
../../src/genmaintest.readme genmaintest.readme
../../src/genmaintest.py genmaintest.py
../../src/tests.h tests/tests.h
Added: trunk/examples/scons/SConstruct
===================================================================
--- trunk/examples/scons/SConstruct (rev 0)
+++ trunk/examples/scons/SConstruct 2011-03-07 02:18:07 UTC (rev 29)
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+from genmaintest import genMainTest
+
+sources = Split("""
+ add
+ sub
+ main
+""")
+sources_cpp = map((lambda x:x+".cpp"),sources)
+sources_cpp_but_main = map((lambda x:x+".cpp"),filter((lambda x:x!='main'),sources))
+
+test_main_cpp = 'tests/testmain.cpp'
+test_sources_cpp = map(str,Glob('tests/*.cpp'))
+if test_main_cpp in test_sources_cpp:
+ test_sources_cpp.remove(test_main_cpp)
+
+env = Environment()
+env.AppendUnique(CCFLAGS = Split('-Wall -Wextra -O3'))
+
+main = env.Program('main', sources_cpp)
+env.Default(main)
+
+#gtm = env.Command(test_main_cpp, test_sources_cpp, './genmaintest.py $TARGET $SOURCES')
+def do_generation(target, source, env):
+ if len(target) != 1:
+ raise Exception("must specify exactly one target")
+ genMainTest(str(target[0]),map(str, source))
+
+gtm = env.Command(test_main_cpp, test_sources_cpp, do_generation)
+test = env.Program('test', test_sources_cpp + sources_cpp_but_main + [gtm])
+env.NoClean(gtm)
+env.Precious(gtm)
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|