* compile and all test pass on linux
[hkl.git] / test / SConscript
blob601c5fa1e0b6d7e248b86a314a0d24e9e88edd31
1 # vi:filetype=python:expandtab:tabstop=2:shiftwidth=2
2 import os
4 Import('env')
6 sources = Split("""
7                 svecmat_test.cpp
8                 quaternion_test.cpp
9                 mystring_test.cpp
10                 object_test.cpp
11                 value_test.cpp
12                 range_test.cpp
13                 interval_test.cpp
14                 parameter_test.cpp
15                 axe_rotation_test.cpp
16                 hklobject_test.cpp
17                 source_test.cpp
18                 fitparameter_test.cpp
19                 lattice_test.cpp
20                 holder_test.cpp
21                 holderlist_test.cpp
22                 geometry_test.cpp
23                 geometry_twoC_test.cpp
24                 geometry_eulerian4C_test.cpp
25                 geometry_eulerian6C_test.cpp
26                 geometry_kappa4C_test.cpp
27                 geometry_kappa6C_test.cpp
28                 reflection_test.cpp
29                 reflectionlist_test.cpp
30                 sample_test.cpp
31                 samplelist_test.cpp
32                 affinement_simplex_test.cpp
33                 mode_twoC_test.cpp
34                 mode_eulerian4C_test.cpp
35                 mode_kappa4C_test.cpp
36                 mode_kappa6C_test.cpp
37                 pseudoaxe_twoC_test.cpp
38                 pseudoaxe_eulerian4C_test.cpp
39                 pseudoaxe_kappa4C_test.cpp
40                 pseudoaxe_eulerian6C_test.cpp
41                 pseudoaxe_kappa6C_test.cpp
42                 diffractometer_twoC_test.cpp
43                 diffractometer_eulerian4C_test.cpp
44                 diffractometer_kappa4C_test.cpp
45                 diffractometer_kappa6C_test.cpp
46                 main.cpp
47                 """)
49 """
51                 """
53 includes = ['#include/hkl']
55 libpath = ['../src']
57 libs = ['hkl', 'cppunit']
59 if env.has_key('test') and env['test']:
60   lenv = env.Copy()
61   if env.has_key('cppunit_lib_path') and env['cppunit_lib_path']:
62     lenv.AppendUnique(LIBPATH = lenv['cppunit_lib_path'])
63   if env.has_key('cppunit_inc_path') and env['cppunit_inc_path']:
64     lenv.AppendUnique(CPPPATH = lenv['cppunit_inc_path'])
65   conf = lenv.Configure()
66   if not conf.CheckLibWithHeader('cppunit', 'cppunit/TextTestRunner.h', 'c++', 'CppUnit::TextTestRunner runner;' ):
67     print 'Please install cppunit or set cppunit_inc_path and cppunit_lib_path'
68     Exit(1)
69   lenv = conf.Finish()
70   if lenv['profile']:
71     lenv.AppendUnique(CPPDEFINES='PROFILE')
73   lenv.AppendUnique(CPPPATH = includes)
74   lenv.AppendUnique(LIBS = libs)
75   lenv.AppendUnique(LIBPATH = libpath)
77   test = lenv.Program(target = 'test', source = sources)
78   lenv.Test("test.passed", test)
79   Default(lenv.Alias("check", "test.passed"))