/[escript]/branches/domexper/doc/examples/SConscript
ViewVC logotype

Diff of /branches/domexper/doc/examples/SConscript

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3250 by jfenwick, Tue Aug 3 04:04:51 2010 UTC revision 3251 by jfenwick, Thu Oct 7 04:02:30 2010 UTC
# Line 14  Line 14 
14  from grouptest import *  from grouptest import *
15  import os  import os
16  Import('*')  Import('*')
17  example_files = example_files_allow_mpi + example_files_no_mpi  local_env = env.Clone()
18    
19    example_files = example_files_allow_mpi + example_files_no_mpi
20    
 local_env = clone_env(env)  
21  src_dir = local_env.Dir('.').srcnode().abspath  src_dir = local_env.Dir('.').srcnode().abspath
22  test_dir= Dir('test', local_env.Dir('.'))  test_dir= Dir('test', local_env.Dir('.'))
23  cc=Command(test_dir, [], Mkdir("$TARGET"))  cc=Command(test_dir, [], Mkdir("$TARGET"))
# Line 28  cc=Command(test_dir, [], Mkdir("$TARGET" Line 28  cc=Command(test_dir, [], Mkdir("$TARGET"
28  #  #
29  data_files=[]  data_files=[]
30  for i in example_files:  for i in example_files:
31    if not i.endswith('.py'):      if not i.endswith('.py'):
32      f_in=File(os.path.join(src_dir,i))          f_in=File(os.path.join(src_dir,i))
33      f_out=File(i,test_dir)          f_out=File(i,test_dir)
34      data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))          data_files.append(Command(f_out, f_in, Copy("$TARGET", "$SOURCE")))
35    
36  #We need this because of cblib.py which needs to be present for other tests to work  # We need this because of cblib.py which needs to be present for other tests
37    # to work
38  for i in example_deps:  for i in example_deps:
39      f_in=File(os.path.join(src_dir,i))      f_in=File(os.path.join(src_dir,i))
40      f_out=File(i,test_dir)      f_out=File(i,test_dir)
# Line 44  np=int(local_env['ENV']['ESCRIPT_NUM_NOD Line 45  np=int(local_env['ENV']['ESCRIPT_NUM_NOD
45  programs=[]  programs=[]
46  copies=[]  copies=[]
47  for i in example_files:  for i in example_files:
48    if i.endswith('.py') and (np==1 or not i in example_files_no_mpi):      if i.endswith('.py') and (np==1 or not i in example_files_no_mpi):
49      f_in=File(os.path.join(src_dir,i))          f_in=File(os.path.join(src_dir,i))
50      f_out=File(i, test_dir)          f_out=File(i, test_dir)
51      c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))          c=Command(f_out, f_in, Copy("$TARGET", "$SOURCE"))
52      copies+=c          copies+=c
53      programs+=local_env.RunPyUnitTest(c)          programs+=local_env.RunPyUnitTest(c)
54    
55  #env.Alias('build_py_tests', programs)  #env.Alias('build_py_tests', programs)
56  env.Alias('build_py_tests', data_files)  env.Alias('build_py_tests', data_files)
57  env.Alias('build_py_tests', copies)  env.Alias('build_py_tests', copies)
58  env.Alias('py_tests', programs)  env.Alias('py_tests', programs)
 Depends(programs, env['pyinstall'])  
59  Depends(programs, data_files)  Depends(programs, data_files)
60  Depends(cc, data_files)  Depends(cc, data_files)
61    
62  # Add a group of tests  # Add a group of tests
63  # find all directories:  # find all directories:
64  for single_processor_only in [True, False]:  for single_processor_only in [True, False]:
# Line 71  for single_processor_only in [True, Fals Line 73  for single_processor_only in [True, Fals
73        for i in example_files:        for i in example_files:
74            if i.startswith(d) and i.endswith('.py') and (single_processor_only == (i in example_files_no_mpi)): runs.append(os.path.split(i)[1])            if i.startswith(d) and i.endswith('.py') and (single_processor_only == (i in example_files_no_mpi)): runs.append(os.path.split(i)[1])
75        TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only))        TestGroups.append(GroupTest("$PYTHONRUNNER ",(),"",os.path.join("$BUILD_DIR/doc/examples/test",d),runs, single_processor_only=single_processor_only))
76    

Legend:
Removed from v.3250  
changed lines
  Added in v.3251

  ViewVC Help
Powered by ViewVC 1.1.26