run_cross_test.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python3
  2. # Copyright 2013-2016 The Meson development team
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. # Unless required by applicable law or agreed to in writing, software
  8. # distributed under the License is distributed on an "AS IS" BASIS,
  9. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. # See the License for the specific language governing permissions and
  11. # limitations under the License.
  12. '''Runs the basic test suite through a cross compiler.
  13. This is now just a wrapper around run_project_tests.py with specific arguments
  14. '''
  15. import argparse
  16. import subprocess
  17. import sys
  18. from mesonbuild import mesonlib
  19. def runtests(cross_file, failfast):
  20. tests = ['--only', 'common']
  21. cmd = mesonlib.python_command + ['run_project_tests.py', '--backend', 'ninja'] + (['--failfast'] if failfast else []) + tests + ['--cross-file', cross_file]
  22. return subprocess.call(cmd)
  23. def main():
  24. parser = argparse.ArgumentParser()
  25. parser.add_argument('--failfast', action='store_true')
  26. parser.add_argument('cross_file')
  27. options = parser.parse_args()
  28. return runtests(options.cross_file, options.failfast)
  29. if __name__ == '__main__':
  30. sys.exit(main())