| 1 | # -*- Mode:Python -*- |
|---|
| 2 | |
|---|
| 3 | ########################################################################## |
|---|
| 4 | # # |
|---|
| 5 | # This file is part of AVANGO. # |
|---|
| 6 | # # |
|---|
| 7 | # Copyright 1997 - 2009 Fraunhofer-Gesellschaft zur Foerderung der # |
|---|
| 8 | # angewandten Forschung (FhG), Munich, Germany. # |
|---|
| 9 | # # |
|---|
| 10 | # AVANGO is free software: you can redistribute it and/or modify # |
|---|
| 11 | # it under the terms of the GNU Lesser General Public License as # |
|---|
| 12 | # published by the Free Software Foundation, version 3. # |
|---|
| 13 | # # |
|---|
| 14 | # AVANGO is distributed in the hope that it will be useful, # |
|---|
| 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # |
|---|
| 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
|---|
| 17 | # GNU General Public License for more details. # |
|---|
| 18 | # # |
|---|
| 19 | # You should have received a copy of the GNU Lesser General Public # |
|---|
| 20 | # License along with AVANGO. If not, see <http://www.gnu.org/licenses/>. # |
|---|
| 21 | # # |
|---|
| 22 | ########################################################################## |
|---|
| 23 | |
|---|
| 24 | import avango.build |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | Alias('check', Alias('check-connect')) |
|---|
| 28 | Alias('check-connect', Alias('check-connect-python')) |
|---|
| 29 | Alias('check-connect', Alias('check-connect-csharp')) |
|---|
| 30 | |
|---|
| 31 | test_package_dir = 'python/test_package/' |
|---|
| 32 | avango.build.Environment.prepend_python_path(Dir(test_package_dir).abspath) |
|---|
| 33 | |
|---|
| 34 | connect_files = Split(""" |
|---|
| 35 | python/avango/connect/_MFInt.py |
|---|
| 36 | python/avango/connect/_MFMatrix.py |
|---|
| 37 | python/avango/connect/_MFString.py |
|---|
| 38 | python/avango/connect/_MFVec2.py |
|---|
| 39 | python/avango/connect/_MFVec3.py |
|---|
| 40 | python/avango/connect/_SFBool.py |
|---|
| 41 | python/avango/connect/_SFDouble.py |
|---|
| 42 | python/avango/connect/_SFFloat.py |
|---|
| 43 | python/avango/connect/_SFInt.py |
|---|
| 44 | python/avango/connect/_SFMatrix.py |
|---|
| 45 | python/avango/connect/_SFString.py |
|---|
| 46 | python/avango/connect/_SFVec4.py |
|---|
| 47 | python/avango/connect/__init__.py |
|---|
| 48 | python/avango/connect/_io.py |
|---|
| 49 | python/avango/connect/_nodes.py |
|---|
| 50 | python/avango/connect/_pipe.py |
|---|
| 51 | python/avango/connect/_registry.py |
|---|
| 52 | python/avango/connect/_server.py |
|---|
| 53 | """) |
|---|
| 54 | |
|---|
| 55 | av_connect = Install(avango.build.get_python_path('avango/connect'), connect_files) |
|---|
| 56 | Alias('connect', av_connect) |
|---|
| 57 | Alias('install-connect', avango.build.get_python_path('avango/connect')) |
|---|
| 58 | |
|---|
| 59 | Alias('all', Alias('connect')) |
|---|
| 60 | Alias('check', Alias('check-connect')) |
|---|
| 61 | Alias('install', Alias('install-connect')) |
|---|
| 62 | |
|---|
| 63 | connect_test_files = Split(""" |
|---|
| 64 | python/tests/TestField.py |
|---|
| 65 | python/tests/TestNodes.py |
|---|
| 66 | python/tests/TestPipe.py |
|---|
| 67 | python/tests/TestServer.py |
|---|
| 68 | python/tests/runtests.py |
|---|
| 69 | """) |
|---|
| 70 | avango.build.install_python(test_package_dir+'avango/connect', connect_files) |
|---|
| 71 | avango.build.install_python(test_package_dir+'tests/', connect_test_files) |
|---|
| 72 | Install(test_package_dir+'tests/', "python/tests/fielddata") |
|---|
| 73 | local_test_env = avango.build.TestEnvironment() |
|---|
| 74 | check = local_test_env.Alias('test-connect-python', test_package_dir+'tests/runtests.pyc', 'python $SOURCE') |
|---|
| 75 | AlwaysBuild(check) |
|---|
| 76 | Alias('check-connect-python', check) |
|---|
| 77 | Depends(check, test_package_dir) |
|---|
| 78 | |
|---|
| 79 | if local_test_env['CONNECT_CSHARP_SUPPORT']: |
|---|
| 80 | csharp_files = Split(""" |
|---|
| 81 | csharp/connect/Connection.cs |
|---|
| 82 | csharp/connect/Field.cs |
|---|
| 83 | csharp/connect/IntField.cs |
|---|
| 84 | csharp/connect/StringField.cs |
|---|
| 85 | csharp/connect/MultiStringField.cs |
|---|
| 86 | csharp/connect/BoolField.cs |
|---|
| 87 | csharp/connect/DoubleField.cs |
|---|
| 88 | csharp/connect/MultiVec2Field.cs |
|---|
| 89 | csharp/connect/MultiVec3Field.cs |
|---|
| 90 | """) |
|---|
| 91 | csharp_tests = Split(""" |
|---|
| 92 | csharp/tests/TestFields.cs |
|---|
| 93 | csharp/tests/TestThreads.cs |
|---|
| 94 | """) |
|---|
| 95 | |
|---|
| 96 | csharp_env = Environment(tools=['default', 'CLI'], toolpath=['tools']) |
|---|
| 97 | csharp_env.Append(CSCFLAGS='-debug') |
|---|
| 98 | |
|---|
| 99 | connect_dll = csharp_env.CLILibrary('csharp/connect/connect.dll', csharp_files) |
|---|
| 100 | |
|---|
| 101 | csharp_test_env = csharp_env.Clone() |
|---|
| 102 | csharp_test_env.Append(CILPKGS=['nunit']) |
|---|
| 103 | csharp_test_env.Append(CILLIBS=['connect'], CILLIBPATH=Dir('csharp/connect').abspath) |
|---|
| 104 | test_dll = csharp_test_env.CLILibrary('csharp/tests/tests.dll', csharp_tests) |
|---|
| 105 | Depends(test_dll, connect_dll) # FIXME builder should do this automatically |
|---|
| 106 | |
|---|
| 107 | # FIXME We need to force the v2 runtime library, as nunit is compiled against v1 ... |
|---|
| 108 | csharp_testrun_env = avango.build.TestEnvironment() |
|---|
| 109 | csharp_testrun_env['ENV']['MONO_PATH'] = Dir('csharp/connect').abspath |
|---|
| 110 | csharp_testrun_env['ENV']['TEST_DATA_PATH'] = Dir('python/tests').abspath |
|---|
| 111 | check_sharp = csharp_testrun_env.Alias('test-connect-sharp', test_dll, |
|---|
| 112 | "mono --debug --runtime=v2.0.50727" |
|---|
| 113 | " /usr/lib/nunit/nunit-console.exe" |
|---|
| 114 | " $SOURCE") |
|---|
| 115 | AlwaysBuild(check_sharp) |
|---|
| 116 | Alias('check-connect-csharp', check_sharp) |
|---|