aboutsummaryrefslogtreecommitdiff
path: root/unittests/windowstests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-30 08:45:56 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2021-09-01 19:26:36 +0300
commitea02c1c48a8a11aab78bd535d18fb17fdf62ae33 (patch)
tree1730c491fbb73e07666aaa23ba0aebeb3f664d1c /unittests/windowstests.py
parent22c38a0006735c813000b7320b6c5a133fcab360 (diff)
downloadmeson-ea02c1c48a8a11aab78bd535d18fb17fdf62ae33.zip
meson-ea02c1c48a8a11aab78bd535d18fb17fdf62ae33.tar.gz
meson-ea02c1c48a8a11aab78bd535d18fb17fdf62ae33.tar.bz2
msvc: Assume UTF8 source by default
Currently every project that uses UTF8 for its source files must add '/utf-8' argument otherwise they don't work non-English locale MSVC. Since meson.build itself is assumed to be UTF8 by default, seems better to assume it for source files by default too. For example: - https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62 - https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
Diffstat (limited to 'unittests/windowstests.py')
-rw-r--r--unittests/windowstests.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/unittests/windowstests.py b/unittests/windowstests.py
index 9359642..1e5964c 100644
--- a/unittests/windowstests.py
+++ b/unittests/windowstests.py
@@ -360,3 +360,16 @@ class WindowsTests(BasePlatformTests):
self.init(os.path.join(self.unit_test_dir, '86 cpp modules'))
self.build()
+ def test_non_utf8_fails(self):
+ # FIXME: VS backend does not use flags from compiler.get_always_args()
+ # and thus it's missing /utf-8 argument. Was that intentional? This needs
+ # to be revisited.
+ if self.backend is not Backend.ninja:
+ raise SkipTest(f'This test only pass with ninja backend (not {self.backend.name}).')
+ testdir = os.path.join(self.platform_test_dir, '18 msvc charset')
+ env = get_fake_env(testdir, self.builddir, self.prefix)
+ cc = detect_c_compiler(env, MachineChoice.HOST)
+ if cc.get_argument_syntax() != 'msvc':
+ raise SkipTest('Not using MSVC')
+ self.init(testdir, extra_args=['-Dtest-failure=true'])
+ self.assertRaises(subprocess.CalledProcessError, self.build)