2013-03-25 01:38:44 +08:00
|
|
|
#!/usr/bin/env python3
|
2012-12-26 23:05:04 +08:00
|
|
|
|
2016-01-16 06:04:57 +08:00
|
|
|
# Copyright 2012-2016 The Meson development team
|
2012-12-26 23:05:04 +08:00
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2016-12-21 06:28:57 +08:00
|
|
|
import subprocess, sys, shutil
|
2016-12-30 04:51:29 +08:00
|
|
|
import platform
|
2016-01-16 23:35:29 +08:00
|
|
|
from mesonbuild import mesonlib
|
2016-07-26 02:06:25 +08:00
|
|
|
|
2012-12-26 23:05:04 +08:00
|
|
|
if __name__ == '__main__':
|
2016-10-08 19:54:37 +08:00
|
|
|
returncode = 0
|
2017-01-30 05:49:41 +08:00
|
|
|
print('Running unittests.\n')
|
2016-10-08 19:44:01 +08:00
|
|
|
if mesonlib.is_linux():
|
2016-10-31 05:42:18 +08:00
|
|
|
returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'])
|
2017-01-30 05:49:41 +08:00
|
|
|
else:
|
2017-02-03 18:24:43 +08:00
|
|
|
returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v', 'InternalTests', 'AllPlatformTests'])
|
2016-12-30 04:51:29 +08:00
|
|
|
# Ubuntu packages do not have a binary without -6 suffix.
|
|
|
|
if shutil.which('arm-linux-gnueabihf-gcc-6') and not platform.machine().startswith('arm'):
|
2016-12-19 19:48:26 +08:00
|
|
|
print('Running cross compilation tests.\n')
|
|
|
|
returncode += subprocess.call([sys.executable, 'run_cross_test.py', 'cross/ubuntu-armhf.txt'])
|
2016-10-08 19:59:14 +08:00
|
|
|
returncode += subprocess.call([sys.executable, 'run_project_tests.py'] + sys.argv[1:])
|
2016-10-08 19:54:37 +08:00
|
|
|
sys.exit(returncode)
|