summaryrefslogtreecommitdiff
path: root/deps/gyp/test/make
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-12-04 13:29:51 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-12-07 15:48:34 -0800
commitd467ae6e7867044b8d7b466776fb37089292c52b (patch)
tree730ee0656e6bf9f0dff33346f07acd800e83ab25 /deps/gyp/test/make
parent59ef8da69549cf6308078c6f656affba96e9439e (diff)
downloadqtlocation-mapboxgl-d467ae6e7867044b8d7b466776fb37089292c52b.tar.gz
[core] upgrade gyp to git commit 6fb8bd8
https://chromium.googlesource.com/external/gyp/+/6fb8bd829f0ca8fd432fd85ede788b6881c4f09f
Diffstat (limited to 'deps/gyp/test/make')
-rw-r--r--deps/gyp/test/make/dependencies.gyp15
-rwxr-xr-xdeps/gyp/test/make/gyptest-dependencies.py26
-rwxr-xr-xdeps/gyp/test/make/gyptest-noload.py57
-rw-r--r--deps/gyp/test/make/main.cc12
-rw-r--r--deps/gyp/test/make/main.h0
-rw-r--r--deps/gyp/test/make/noload/all.gyp18
-rw-r--r--deps/gyp/test/make/noload/lib/shared.c3
-rw-r--r--deps/gyp/test/make/noload/lib/shared.gyp16
-rw-r--r--deps/gyp/test/make/noload/lib/shared.h1
-rw-r--r--deps/gyp/test/make/noload/main.c9
10 files changed, 157 insertions, 0 deletions
diff --git a/deps/gyp/test/make/dependencies.gyp b/deps/gyp/test/make/dependencies.gyp
new file mode 100644
index 0000000000..e2bee24fce
--- /dev/null
+++ b/deps/gyp/test/make/dependencies.gyp
@@ -0,0 +1,15 @@
+# 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': 'main',
+ 'type': 'executable',
+ 'sources': [
+ 'main.cc',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/make/gyptest-dependencies.py b/deps/gyp/test/make/gyptest-dependencies.py
new file mode 100755
index 0000000000..d215f76782
--- /dev/null
+++ b/deps/gyp/test/make/gyptest-dependencies.py
@@ -0,0 +1,26 @@
+#!/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 .d files and all.deps are properly generated.
+"""
+
+import TestGyp
+
+# .d files are only used by the make build.
+test = TestGyp.TestGyp(formats=['make'])
+
+test.run_gyp('dependencies.gyp')
+
+test.build('dependencies.gyp', test.ALL)
+
+deps_file = test.built_file_path(".deps/out/Default/obj.target/main/main.o.d")
+test.must_contain(deps_file, "main.h")
+
+# Build a second time to make sure we generate all.deps.
+test.build('dependencies.gyp', test.ALL)
+
+test.pass_test()
diff --git a/deps/gyp/test/make/gyptest-noload.py b/deps/gyp/test/make/gyptest-noload.py
new file mode 100755
index 0000000000..1f5103315c
--- /dev/null
+++ b/deps/gyp/test/make/gyptest-noload.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2010 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.
+
+"""
+Tests the use of the NO_LOAD flag which makes loading sub .mk files
+optional.
+"""
+
+# Python 2.5 needs this for the with statement.
+from __future__ import with_statement
+
+import os
+import TestGyp
+
+test = TestGyp.TestGyp(formats=['make'])
+
+test.run_gyp('all.gyp', chdir='noload')
+
+test.relocate('noload', 'relocate/noload')
+
+test.build('build/all.gyp', test.ALL, chdir='relocate/noload')
+test.run_built_executable('exe', chdir='relocate/noload',
+ stdout='Hello from shared.c.\n')
+
+# Just sanity test that NO_LOAD=lib doesn't break anything.
+test.build('build/all.gyp', test.ALL, chdir='relocate/noload',
+ arguments=['NO_LOAD=lib'])
+test.run_built_executable('exe', chdir='relocate/noload',
+ stdout='Hello from shared.c.\n')
+test.build('build/all.gyp', test.ALL, chdir='relocate/noload',
+ arguments=['NO_LOAD=z'])
+test.run_built_executable('exe', chdir='relocate/noload',
+ stdout='Hello from shared.c.\n')
+
+# Make sure we can rebuild without reloading the sub .mk file.
+with open('relocate/noload/main.c', 'a') as src_file:
+ src_file.write("\n")
+test.build('build/all.gyp', test.ALL, chdir='relocate/noload',
+ arguments=['NO_LOAD=lib'])
+test.run_built_executable('exe', chdir='relocate/noload',
+ stdout='Hello from shared.c.\n')
+
+# Change shared.c, but verify that it doesn't get rebuild if we don't load it.
+with open('relocate/noload/lib/shared.c', 'w') as shared_file:
+ shared_file.write(
+ '#include "shared.h"\n'
+ 'const char kSharedStr[] = "modified";\n'
+ )
+test.build('build/all.gyp', test.ALL, chdir='relocate/noload',
+ arguments=['NO_LOAD=lib'])
+test.run_built_executable('exe', chdir='relocate/noload',
+ stdout='Hello from shared.c.\n')
+
+test.pass_test()
diff --git a/deps/gyp/test/make/main.cc b/deps/gyp/test/make/main.cc
new file mode 100644
index 0000000000..3b9a705c24
--- /dev/null
+++ b/deps/gyp/test/make/main.cc
@@ -0,0 +1,12 @@
+/* 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. */
+
+#include <stdio.h>
+
+#include "main.h"
+
+int main(void) {
+ printf("hello world\n");
+ return 0;
+}
diff --git a/deps/gyp/test/make/main.h b/deps/gyp/test/make/main.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/gyp/test/make/main.h
diff --git a/deps/gyp/test/make/noload/all.gyp b/deps/gyp/test/make/noload/all.gyp
new file mode 100644
index 0000000000..1617a9e97c
--- /dev/null
+++ b/deps/gyp/test/make/noload/all.gyp
@@ -0,0 +1,18 @@
+# Copyright (c) 2010 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': 'exe',
+ 'type': 'executable',
+ 'sources': [
+ 'main.c',
+ ],
+ 'dependencies': [
+ 'lib/shared.gyp:shared',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/make/noload/lib/shared.c b/deps/gyp/test/make/noload/lib/shared.c
new file mode 100644
index 0000000000..51776c5acf
--- /dev/null
+++ b/deps/gyp/test/make/noload/lib/shared.c
@@ -0,0 +1,3 @@
+#include "shared.h"
+
+const char kSharedStr[] = "shared.c";
diff --git a/deps/gyp/test/make/noload/lib/shared.gyp b/deps/gyp/test/make/noload/lib/shared.gyp
new file mode 100644
index 0000000000..8a8841b3a0
--- /dev/null
+++ b/deps/gyp/test/make/noload/lib/shared.gyp
@@ -0,0 +1,16 @@
+# 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': 'shared',
+ 'type': 'shared_library',
+ 'sources': [
+ 'shared.c',
+ 'shared.h',
+ ],
+ },
+ ],
+}
diff --git a/deps/gyp/test/make/noload/lib/shared.h b/deps/gyp/test/make/noload/lib/shared.h
new file mode 100644
index 0000000000..a21da7538b
--- /dev/null
+++ b/deps/gyp/test/make/noload/lib/shared.h
@@ -0,0 +1 @@
+extern const char kSharedStr[];
diff --git a/deps/gyp/test/make/noload/main.c b/deps/gyp/test/make/noload/main.c
new file mode 100644
index 0000000000..26ec1889ad
--- /dev/null
+++ b/deps/gyp/test/make/noload/main.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+#include "lib/shared.h"
+
+int main(void)
+{
+ printf("Hello from %s.\n", kSharedStr);
+ return 0;
+}