summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/mac/gyptest-app-error.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/python/gyp/test/mac/gyptest-app-error.py
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/mac/gyptest-app-error.py')
-rwxr-xr-xthird_party/python/gyp/test/mac/gyptest-app-error.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/mac/gyptest-app-error.py b/third_party/python/gyp/test/mac/gyptest-app-error.py
new file mode 100755
index 0000000000..df0781d455
--- /dev/null
+++ b/third_party/python/gyp/test/mac/gyptest-app-error.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2012 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies that invalid strings files cause the build to fail.
+"""
+
+from __future__ import print_function
+
+import TestCmd
+import TestGyp
+
+import sys
+
+if sys.platform == 'darwin':
+ print("This test is currently disabled: https://crbug.com/483696.")
+ sys.exit(0)
+
+ expected_error = 'Old-style plist parser: missing semicolon in dictionary'
+ saw_expected_error = [False] # Python2 has no "nonlocal" keyword.
+ def match(a, b):
+ if a == b:
+ return True
+ if not TestCmd.is_List(a):
+ a = a.split('\n')
+ if not TestCmd.is_List(b):
+ b = b.split('\n')
+ if expected_error in '\n'.join(a) + '\n'.join(b):
+ saw_expected_error[0] = True
+ return True
+ return False
+ test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'], match=match)
+
+ test.run_gyp('test-error.gyp', chdir='app-bundle')
+
+ test.build('test-error.gyp', test.ALL, chdir='app-bundle')
+
+ # Ninja pipes stderr of subprocesses to stdout.
+ if test.format in ['ninja', 'xcode-ninja'] \
+ and expected_error in test.stdout():
+ saw_expected_error[0] = True
+
+ if saw_expected_error[0]:
+ test.pass_test()
+ else:
+ test.fail_test()