summaryrefslogtreecommitdiffstats
path: root/third_party/python/gyp/test/home_dot_gyp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/gyp/test/home_dot_gyp
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/gyp/test/home_dot_gyp')
-rwxr-xr-xthird_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py31
-rwxr-xr-xthird_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py33
-rwxr-xr-xthird_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py44
-rwxr-xr-xthird_party/python/gyp/test/home_dot_gyp/gyptest-home-includes.py30
-rw-r--r--third_party/python/gyp/test/home_dot_gyp/home/.gyp/include.gypi5
-rw-r--r--third_party/python/gyp/test/home_dot_gyp/home2/.gyp/include.gypi5
-rw-r--r--third_party/python/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi5
-rw-r--r--third_party/python/gyp/test/home_dot_gyp/src/all.gyp22
-rw-r--r--third_party/python/gyp/test/home_dot_gyp/src/printfoo.c7
9 files changed, 182 insertions, 0 deletions
diff --git a/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py
new file mode 100755
index 0000000000..82e39f9d07
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-arg.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2013 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 inclusion of $HOME/.gyp/include.gypi works when --config-dir is
+specified.
+"""
+
+import os
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+os.environ['HOME'] = os.path.abspath('home2')
+
+test.run_gyp('all.gyp', '--config-dir=~/.gyp_new', chdir='src')
+
+# After relocating, we should still be able to build (build file shouldn't
+# contain relative reference to ~/.gyp/include.gypi)
+test.relocate('src', 'relocate/src')
+
+test.build('all.gyp', test.ALL, chdir='relocate/src')
+
+test.run_built_executable('printfoo',
+ chdir='relocate/src',
+ stdout='FOO is fromhome3\n')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py
new file mode 100755
index 0000000000..6f4b299ede
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-config-env.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2013 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 inclusion of $HOME/.gyp_new/include.gypi works when GYP_CONFIG_DIR
+is set.
+"""
+
+import os
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+os.environ['HOME'] = os.path.abspath('home')
+os.environ['GYP_CONFIG_DIR'] = os.path.join(os.path.abspath('home2'),
+ '.gyp_new')
+
+test.run_gyp('all.gyp', chdir='src')
+
+# After relocating, we should still be able to build (build file shouldn't
+# contain relative reference to ~/.gyp_new/include.gypi)
+test.relocate('src', 'relocate/src')
+
+test.build('all.gyp', test.ALL, chdir='relocate/src')
+
+test.run_built_executable('printfoo',
+ chdir='relocate/src',
+ stdout='FOO is fromhome3\n')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py
new file mode 100755
index 0000000000..fdf8b14464
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py
@@ -0,0 +1,44 @@
+#!/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 inclusion of $HOME/.gyp/include.gypi works properly with relocation
+and with regeneration.
+"""
+
+import os
+import TestGyp
+
+# Regenerating build files when a gyp file changes is currently only supported
+# by the make generator.
+test = TestGyp.TestGyp(formats=['make'])
+
+os.environ['HOME'] = os.path.abspath('home')
+
+test.run_gyp('all.gyp', chdir='src')
+
+# After relocating, we should still be able to build (build file shouldn't
+# contain relative reference to ~/.gyp/include.gypi)
+test.relocate('src', 'relocate/src')
+
+test.build('all.gyp', test.ALL, chdir='relocate/src')
+
+test.run_built_executable('printfoo',
+ chdir='relocate/src',
+ stdout='FOO is fromhome\n')
+
+# Building should notice any changes to ~/.gyp/include.gypi and regyp.
+test.sleep()
+
+test.write('home/.gyp/include.gypi', test.read('home2/.gyp/include.gypi'))
+
+test.build('all.gyp', test.ALL, chdir='relocate/src')
+
+test.run_built_executable('printfoo',
+ chdir='relocate/src',
+ stdout='FOO is fromhome2\n')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes.py b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes.py
new file mode 100755
index 0000000000..8ad52556be
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/gyptest-home-includes.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+# 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.
+
+"""
+Verifies inclusion of $HOME/.gyp/include.gypi works.
+"""
+
+import os
+import TestGyp
+
+test = TestGyp.TestGyp()
+
+os.environ['HOME'] = os.path.abspath('home')
+
+test.run_gyp('all.gyp', chdir='src')
+
+# After relocating, we should still be able to build (build file shouldn't
+# contain relative reference to ~/.gyp/include.gypi)
+test.relocate('src', 'relocate/src')
+
+test.build('all.gyp', test.ALL, chdir='relocate/src')
+
+test.run_built_executable('printfoo',
+ chdir='relocate/src',
+ stdout='FOO is fromhome\n')
+
+test.pass_test()
diff --git a/third_party/python/gyp/test/home_dot_gyp/home/.gyp/include.gypi b/third_party/python/gyp/test/home_dot_gyp/home/.gyp/include.gypi
new file mode 100644
index 0000000000..fcfb39befd
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/home/.gyp/include.gypi
@@ -0,0 +1,5 @@
+{
+ 'variables': {
+ 'foo': '"fromhome"',
+ },
+}
diff --git a/third_party/python/gyp/test/home_dot_gyp/home2/.gyp/include.gypi b/third_party/python/gyp/test/home_dot_gyp/home2/.gyp/include.gypi
new file mode 100644
index 0000000000..f0d84b31ad
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/home2/.gyp/include.gypi
@@ -0,0 +1,5 @@
+{
+ 'variables': {
+ 'foo': '"fromhome2"',
+ },
+}
diff --git a/third_party/python/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi b/third_party/python/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi
new file mode 100644
index 0000000000..4094dfd2f8
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/home2/.gyp_new/include.gypi
@@ -0,0 +1,5 @@
+{
+ 'variables': {
+ 'foo': '"fromhome3"',
+ },
+}
diff --git a/third_party/python/gyp/test/home_dot_gyp/src/all.gyp b/third_party/python/gyp/test/home_dot_gyp/src/all.gyp
new file mode 100644
index 0000000000..14b6aea285
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/src/all.gyp
@@ -0,0 +1,22 @@
+# 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.
+
+{
+ 'variables': {
+ 'foo%': '"fromdefault"',
+ },
+ 'targets': [
+ {
+ 'target_name': 'printfoo',
+ 'type': 'executable',
+ 'sources': [
+ 'printfoo.c',
+ ],
+ 'defines': [
+ 'FOO=<(foo)',
+ ],
+ },
+ ],
+}
+
diff --git a/third_party/python/gyp/test/home_dot_gyp/src/printfoo.c b/third_party/python/gyp/test/home_dot_gyp/src/printfoo.c
new file mode 100644
index 0000000000..9bb67181b9
--- /dev/null
+++ b/third_party/python/gyp/test/home_dot_gyp/src/printfoo.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("FOO is %s\n", FOO);
+ return 0;
+}