aboutsummaryrefslogtreecommitdiff
path: root/run_unittests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-06-07 20:09:43 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2017-06-07 20:09:43 +0300
commit7c03bfb46340995687354f478ad02d6751d80bd1 (patch)
treec2dcf8963bb64822570e1094dbd68ed9c952a8b7 /run_unittests.py
parentb6dbb4ecc6eae8b177df2f3a78fc754002b22493 (diff)
parentb32c757073c3227a05d770ec56d953f5aac663d0 (diff)
downloadmeson-7c03bfb46340995687354f478ad02d6751d80bd1.zip
meson-7c03bfb46340995687354f478ad02d6751d80bd1.tar.gz
meson-7c03bfb46340995687354f478ad02d6751d80bd1.tar.bz2
Merged needs_exe_wrapper branch.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-xrun_unittests.py30
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):