summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/errors
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/python/gyp/test/errors
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/errors')
-rw-r--r--third_party/python/gyp/test/errors/dependency_cycle.gyp23
-rw-r--r--third_party/python/gyp/test/errors/duplicate_basenames.gyp13
-rw-r--r--third_party/python/gyp/test/errors/duplicate_node.gyp12
-rw-r--r--third_party/python/gyp/test/errors/duplicate_rule.gyp22
-rw-r--r--third_party/python/gyp/test/errors/duplicate_targets.gyp14
-rw-r--r--third_party/python/gyp/test/errors/error_command.gyp12
-rw-r--r--third_party/python/gyp/test/errors/file_cycle0.gyp17
-rw-r--r--third_party/python/gyp/test/errors/file_cycle1.gyp13
-rwxr-xr-xthird_party/python/gyp/test/errors/gyptest-errors.py80
-rw-r--r--third_party/python/gyp/test/errors/missing_command.gyp12
-rw-r--r--third_party/python/gyp/test/errors/missing_dep.gyp15
-rw-r--r--third_party/python/gyp/test/errors/missing_targets.gyp8
12 files changed, 241 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/errors/dependency_cycle.gyp b/third_party/python/gyp/test/errors/dependency_cycle.gyp
new file mode 100644
index 0000000000..eef44bc9eb
--- /dev/null
+++ b/third_party/python/gyp/test/errors/dependency_cycle.gyp
@@ -0,0 +1,23 @@
+# Copyright 2014 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'target0',
+ 'type': 'none',
+ 'dependencies': [ 'target1' ],
+ },
+ {
+ 'target_name': 'target1',
+ 'type': 'none',
+ 'dependencies': [ 'target2' ],
+ },
+ {
+ 'target_name': 'target2',
+ 'type': 'none',
+ 'dependencies': [ 'target0' ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/errors/duplicate_basenames.gyp b/third_party/python/gyp/test/errors/duplicate_basenames.gyp
new file mode 100644
index 0000000000..b3dceb3949
--- /dev/null
+++ b/third_party/python/gyp/test/errors/duplicate_basenames.gyp
@@ -0,0 +1,13 @@
+# Copyright (c) 2009 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo',
+ 'type': 'static_library',
+ 'sources': ['foo.c', 'foo.cc'],
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/duplicate_node.gyp b/third_party/python/gyp/test/errors/duplicate_node.gyp
new file mode 100644
index 0000000000..d6096096bd
--- /dev/null
+++ b/third_party/python/gyp/test/errors/duplicate_node.gyp
@@ -0,0 +1,12 @@
+# Copyright (c) 2011 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.
+
+{
+ 'targets': [
+ { 'target_name' : 'foo', 'type': 'executable' },
+ ],
+ 'targets': [
+ { 'target_name' : 'bar', 'type': 'executable' },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/duplicate_rule.gyp b/third_party/python/gyp/test/errors/duplicate_rule.gyp
new file mode 100644
index 0000000000..dab98e96c2
--- /dev/null
+++ b/third_party/python/gyp/test/errors/duplicate_rule.gyp
@@ -0,0 +1,22 @@
+# Copyright (c) 2011 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo',
+ 'type': 'executable',
+ 'rules': [
+ {
+ 'rule_name': 'bar',
+ 'extension': '',
+ },
+ {
+ 'rule_name': 'bar',
+ 'extension': '',
+ },
+ ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/errors/duplicate_targets.gyp b/third_party/python/gyp/test/errors/duplicate_targets.gyp
new file mode 100644
index 0000000000..aec470eefa
--- /dev/null
+++ b/third_party/python/gyp/test/errors/duplicate_targets.gyp
@@ -0,0 +1,14 @@
+# Copyright (c) 2009 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo'
+ },
+ {
+ 'target_name': 'foo'
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/error_command.gyp b/third_party/python/gyp/test/errors/error_command.gyp
new file mode 100644
index 0000000000..1736fc9882
--- /dev/null
+++ b/third_party/python/gyp/test/errors/error_command.gyp
@@ -0,0 +1,12 @@
+# Copyright (c) 2015 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo',
+ 'type': '<!(["python", "-c", "import sys; sys.exit(3)"])',
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/file_cycle0.gyp b/third_party/python/gyp/test/errors/file_cycle0.gyp
new file mode 100644
index 0000000000..3bfafb6cb3
--- /dev/null
+++ b/third_party/python/gyp/test/errors/file_cycle0.gyp
@@ -0,0 +1,17 @@
+# Copyright 2014 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'top',
+ 'type': 'none',
+ 'dependencies': [ 'file_cycle1.gyp:middle' ],
+ },
+ {
+ 'target_name': 'bottom',
+ 'type': 'none',
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/errors/file_cycle1.gyp b/third_party/python/gyp/test/errors/file_cycle1.gyp
new file mode 100644
index 0000000000..fbd7a0d167
--- /dev/null
+++ b/third_party/python/gyp/test/errors/file_cycle1.gyp
@@ -0,0 +1,13 @@
+# Copyright 2014 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'middle',
+ 'type': 'none',
+ 'dependencies': [ 'file_cycle0.gyp:bottom' ],
+ },
+ ],
+}
diff --git a/third_party/python/gyp/test/errors/gyptest-errors.py b/third_party/python/gyp/test/errors/gyptest-errors.py
new file mode 100755
index 0000000000..0296f800f5
--- /dev/null
+++ b/third_party/python/gyp/test/errors/gyptest-errors.py
@@ -0,0 +1,80 @@
+#!/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.
+
+"""
+Test that two targets with the same name generates an error.
+"""
+
+import os
+import sys
+
+import TestGyp
+import TestCmd
+
+# TODO(sbc): Remove the use of match_re below, done because scons
+# error messages were not consistent with other generators.
+# Also remove input.py:generator_wants_absolute_build_file_paths.
+
+test = TestGyp.TestGyp()
+
+stderr = ('gyp: Duplicate target definitions for '
+ '.*duplicate_targets.gyp:foo#target\n')
+test.run_gyp('duplicate_targets.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re)
+
+stderr = ('.*: Unable to find targets in build file .*missing_targets.gyp.*')
+test.run_gyp('missing_targets.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+stderr = ('gyp: rule bar exists in duplicate, target '
+ '.*duplicate_rule.gyp:foo#target\n')
+test.run_gyp('duplicate_rule.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re)
+
+stderr = ("gyp: Key 'targets' repeated at level 1 with key path '' while "
+ "reading .*duplicate_node.gyp.*")
+test.run_gyp('duplicate_node.gyp', '--check', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+stderr = (".*target0.*target1.*target2.*target0.*")
+test.run_gyp('dependency_cycle.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+stderr = (".*file_cycle0.*file_cycle1.*file_cycle0.*")
+test.run_gyp('file_cycle0.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+stderr = 'gyp: Duplicate basenames in sources section, see list above\n'
+test.run_gyp('duplicate_basenames.gyp', status=1, stderr=stderr)
+
+# Check if '--no-duplicate-basename-check' works.
+if ((test.format == 'make' and sys.platform == 'darwin') or
+ (test.format == 'msvs' and
+ int(os.environ.get('GYP_MSVS_VERSION', 2010)) < 2010)):
+ stderr = 'gyp: Duplicate basenames in sources section, see list above\n'
+ test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check',
+ status=1, stderr=stderr)
+else:
+ test.run_gyp('duplicate_basenames.gyp', '--no-duplicate-basename-check')
+
+stderr = ("gyp: Dependency '.*missing_dep.gyp:missing.gyp#target' not found "
+ "while trying to load target .*missing_dep.gyp:foo#target\n")
+test.run_gyp('missing_dep.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re)
+
+# Make sure invalid <!() command invocations say what command it was and
+# mention the gyp file name. Use a "random" command name to trigger an ENOENT.
+stderr = (".*invalid-command-name-egtyevNif3.*netDurj9.*missing_command.gyp.*")
+test.run_gyp('missing_command.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+# Make sure <!() commands that error out result in a message that mentions
+# the command and gyp file name
+stderr = (".*python.*-c.*import sys.*sys.exit.*3.*error_command.gyp.*")
+test.run_gyp('error_command.gyp', status=1, stderr=stderr,
+ match=TestCmd.match_re_dotall)
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/errors/missing_command.gyp b/third_party/python/gyp/test/errors/missing_command.gyp
new file mode 100644
index 0000000000..c93d9542c6
--- /dev/null
+++ b/third_party/python/gyp/test/errors/missing_command.gyp
@@ -0,0 +1,12 @@
+# Copyright (c) 2015 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo',
+ 'type': '<!(["invalid-command-name-egtyevNif3", "netDurj9"])',
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/missing_dep.gyp b/third_party/python/gyp/test/errors/missing_dep.gyp
new file mode 100644
index 0000000000..08746be3d7
--- /dev/null
+++ b/third_party/python/gyp/test/errors/missing_dep.gyp
@@ -0,0 +1,15 @@
+# Copyright (c) 2011 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'foo',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'missing.gyp'
+ ]
+ },
+ ]
+}
diff --git a/third_party/python/gyp/test/errors/missing_targets.gyp b/third_party/python/gyp/test/errors/missing_targets.gyp
new file mode 100644
index 0000000000..13d4f924c1
--- /dev/null
+++ b/third_party/python/gyp/test/errors/missing_targets.gyp
@@ -0,0 +1,8 @@
+# Copyright (c) 2011 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.
+
+{
+ 'target_defaults': {
+ },
+}