diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-07 20:09:43 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-07 20:09:43 +0300 |
commit | 7c03bfb46340995687354f478ad02d6751d80bd1 (patch) | |
tree | c2dcf8963bb64822570e1094dbd68ed9c952a8b7 /run_unittests.py | |
parent | b6dbb4ecc6eae8b177df2f3a78fc754002b22493 (diff) | |
parent | b32c757073c3227a05d770ec56d953f5aac663d0 (diff) | |
download | meson-7c03bfb46340995687354f478ad02d6751d80bd1.zip meson-7c03bfb46340995687354f478ad02d6751d80bd1.tar.gz meson-7c03bfb46340995687354f478ad02d6751d80bd1.tar.bz2 |
Merged needs_exe_wrapper branch.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 63f6def..496c6bc 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -22,6 +22,7 @@ import os import shutil import sys import unittest +from configparser import ConfigParser from glob import glob from pathlib import PurePath import mesonbuild.compilers @@ -346,6 +347,35 @@ class InternalTests(unittest.TestCase): cmd = ['@OUTPUT@.out', 'ordinary', 'strings'] self.assertRaises(ME, substfunc, cmd, d) + def test_needs_exe_wrapper_override(self): + config = ConfigParser() + config['binaries'] = { + 'c': '\'/usr/bin/gcc\'', + } + config['host_machine'] = { + 'system': '\'linux\'', + 'cpu_family': '\'arm\'', + 'cpu': '\'armv7\'', + 'endian': '\'little\'', + } + + with tempfile.NamedTemporaryFile(mode='w+') as configfile: + config.write(configfile) + configfile.flush() + detected_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() + + desired_value = not detected_value + config['properties'] = { + 'needs_exe_wrapper': 'true' if desired_value else 'false' + } + + with tempfile.NamedTemporaryFile(mode='w+') as configfile: + config.write(configfile) + configfile.flush() + forced_value = mesonbuild.environment.CrossBuildInfo(configfile.name).need_exe_wrapper() + + self.assertEqual(forced_value, desired_value) + class BasePlatformTests(unittest.TestCase): def setUp(self): |