2013-03-25 01:38:44 +08:00
|
|
|
#!/usr/bin/env python3
|
2012-12-26 23:05:04 +08:00
|
|
|
|
2017-02-07 19:52:18 +08:00
|
|
|
# Copyright 2012-2017 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.
|
|
|
|
|
2017-02-19 11:06:28 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import shutil
|
|
|
|
import subprocess
|
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-02-19 11:06:28 +08:00
|
|
|
# Running on a developer machine? Be nice!
|
|
|
|
if not mesonlib.is_windows() and 'TRAVIS' not in os.environ:
|
|
|
|
os.nice(20)
|
2017-01-30 05:49:41 +08:00
|
|
|
print('Running unittests.\n')
|
2017-02-07 19:52:18 +08:00
|
|
|
units = ['InternalTests', 'AllPlatformTests']
|
2016-10-08 19:44:01 +08:00
|
|
|
if mesonlib.is_linux():
|
2017-02-07 19:52:18 +08:00
|
|
|
units += ['LinuxlikeTests']
|
|
|
|
elif mesonlib.is_windows():
|
|
|
|
units += ['WindowsTests']
|
|
|
|
returncode += subprocess.call([sys.executable, 'run_unittests.py', '-v'] + units)
|
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)
|