[cig-commits] r5249 - in long/3D/Gale/trunk: .
src/StGermain/Base/FlattenXML src/StGermain/Base/FlattenXML/src
src/StGermain/Base/FlattenXML/test
walter at geodynamics.org
walter at geodynamics.org
Mon Nov 13 13:24:45 PST 2006
Author: walter
Date: 2006-11-13 13:24:44 -0800 (Mon, 13 Nov 2006)
New Revision: 5249
Added:
long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/test/SConscript
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/SConstruct
long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/SConscript
long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/src/SConscript
Log:
r1066 at earth: boo | 2006-11-10 12:07:16 -0800
Add FlattenXML test
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1065
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1066
Modified: long/3D/Gale/trunk/SConstruct
===================================================================
--- long/3D/Gale/trunk/SConstruct 2006-11-13 21:24:41 UTC (rev 5248)
+++ long/3D/Gale/trunk/SConstruct 2006-11-13 21:24:44 UTC (rev 5249)
@@ -114,9 +114,10 @@
def execute_test_and_compare(test_args,expected,env):
current_dir=os.getcwd()
- # Replace build with src
- new_dir=os.path.dirname(os.path.abspath('src'+test_args[3][5:]))
test_args[3]=str(os.path.abspath(test_args[3]))
+ # replace build with src so that we can find all of the input files.
+ import re
+ new_dir=re.sub('build','src',env['TESTDIR'])
os.chdir(new_dir)
r,w,e=os.popen3(test_args)
e.readlines()
@@ -126,7 +127,9 @@
w.close()
if(env.has_key('OUTFILES')):
- outdir=env['OUTDIR']+"/"
+ outdir=""
+ if env.has_key('OUTDIR'):
+ outdir=env['OUTDIR']+"/"
output_file=[]
for out in env['OUTFILES']:
f=file(outdir+out)
@@ -144,6 +147,8 @@
if expected_file!=output_file:
print "expected and result",test_args, expected
+ print expected_file
+ print output_file
raise TestError
def gen_test_suffix(env, sources):
@@ -182,6 +187,7 @@
if not env.has_key('MPI_PROCS'):
env['MPI_PROCS']="1"
procs=env['MPI_PROCS']
+ env['TESTDIR']=os.getcwd()
for f in test_files:
if env.has_key('OUTFILES'):
if not env.has_key('OUTDIR'):
@@ -241,6 +247,7 @@
SConscript('build/StGermain/Base/Automation/SConscript')
SConscript('build/StGermain/Base/Container/SConscript')
SConscript('build/StGermain/Base/Foundation/SConscript')
+SConscript('build/StGermain/Base/FlattenXML/SConscript')
# We have to do a fake install of the headers, because otherwise the
# libraries won't build. We have to do a fake install of the
Modified: long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/SConscript 2006-11-13 21:24:41 UTC (rev 5248)
+++ long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/SConscript 2006-11-13 21:24:44 UTC (rev 5249)
@@ -15,5 +15,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
-SConscript('src/SConscript')
+Import('make_test_deps')
+if not make_test_deps:
+ SConscript('src/SConscript')
+else:
+ SConscript('test/SConscript')
Modified: long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/src/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/src/SConscript 2006-11-13 21:24:41 UTC (rev 5248)
+++ long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/src/SConscript 2006-11-13 21:24:44 UTC (rev 5249)
@@ -19,6 +19,9 @@
local_env=env.Copy()
-bin_objects+=[local_env.Program('FlattenXML',
- ['main.c',libs(shared_lib_objects,
- StGermain_static_objects)])]
+FlattenXML=local_env.Program('FlattenXML',
+ ['main.c',libs(shared_lib_objects,
+ StGermain_static_objects)])
+bin_objects+=[FlattenXML]
+
+Export('FlattenXML')
Added: long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/test/SConscript
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/test/SConscript 2006-11-13 21:24:41 UTC (rev 5248)
+++ long/3D/Gale/trunk/src/StGermain/Base/FlattenXML/test/SConscript 2006-11-13 21:24:44 UTC (rev 5249)
@@ -0,0 +1,31 @@
+# Copyright 2006 California Institute of Technology
+
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 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 Lesser General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA
+
+Import('env','tests','FlattenXML')
+
+local_env=env.Copy()
+
+local_env['TESTARGS']=['data/testInput.xml','-output_file=./output.xml']
+local_env['OUTFILES']=['output.xml']
+import os
+local_env['TESTDIR']=os.getcwd()
+flatten_test=local_env.GeneralTest([FlattenXML,"expected/testFlattenXML.0of1.output.xml.expected"])
+Depends(flatten_test,['data/include1-include.xml','data/include2.xml',
+ 'data/testInput.xml','data/include1.xml',
+ 'data/include3.xml'])
+tests+=[flatten_test]
+
More information about the cig-commits
mailing list