From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../python/gyp/test/include_dirs/gyptest-all.py | 43 ++++++++++++++++++++++ .../gyp/test/include_dirs/gyptest-default.py | 43 ++++++++++++++++++++++ third_party/python/gyp/test/include_dirs/src/inc.h | 1 + .../gyp/test/include_dirs/src/inc1/include1.h | 1 + .../python/gyp/test/include_dirs/src/includes.c | 19 ++++++++++ .../python/gyp/test/include_dirs/src/includes.gyp | 27 ++++++++++++++ .../gyp/test/include_dirs/src/shadow1/shadow.h | 1 + .../gyp/test/include_dirs/src/shadow2/shadow.h | 1 + .../python/gyp/test/include_dirs/src/subdir/inc.h | 1 + .../test/include_dirs/src/subdir/inc2/include2.h | 1 + .../test/include_dirs/src/subdir/subdir_includes.c | 14 +++++++ .../include_dirs/src/subdir/subdir_includes.gyp | 20 ++++++++++ 12 files changed, 172 insertions(+) create mode 100755 third_party/python/gyp/test/include_dirs/gyptest-all.py create mode 100755 third_party/python/gyp/test/include_dirs/gyptest-default.py create mode 100644 third_party/python/gyp/test/include_dirs/src/inc.h create mode 100644 third_party/python/gyp/test/include_dirs/src/inc1/include1.h create mode 100644 third_party/python/gyp/test/include_dirs/src/includes.c create mode 100644 third_party/python/gyp/test/include_dirs/src/includes.gyp create mode 100644 third_party/python/gyp/test/include_dirs/src/shadow1/shadow.h create mode 100644 third_party/python/gyp/test/include_dirs/src/shadow2/shadow.h create mode 100644 third_party/python/gyp/test/include_dirs/src/subdir/inc.h create mode 100644 third_party/python/gyp/test/include_dirs/src/subdir/inc2/include2.h create mode 100644 third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.c create mode 100644 third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.gyp (limited to 'third_party/python/gyp/test/include_dirs') diff --git a/third_party/python/gyp/test/include_dirs/gyptest-all.py b/third_party/python/gyp/test/include_dirs/gyptest-all.py new file mode 100755 index 0000000000..d64bc6a9ca --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/gyptest-all.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# 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. + +""" +Verifies use of include_dirs when using an explicit build target of 'all'. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('includes.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +test.build('includes.gyp', test.ALL, chdir='relocate/src') + +expect = """\ +Hello from includes.c +Hello from inc.h +Hello from include1.h +Hello from subdir/inc2/include2.h +Hello from shadow2/shadow.h +""" +test.run_built_executable('includes', stdout=expect, chdir='relocate/src') + +if test.format == 'xcode': + chdir='relocate/src/subdir' +else: + chdir='relocate/src' + +expect = """\ +Hello from subdir/subdir_includes.c +Hello from subdir/inc.h +Hello from include1.h +Hello from subdir/inc2/include2.h +""" +test.run_built_executable('subdir_includes', stdout=expect, chdir=chdir) + +test.pass_test() diff --git a/third_party/python/gyp/test/include_dirs/gyptest-default.py b/third_party/python/gyp/test/include_dirs/gyptest-default.py new file mode 100755 index 0000000000..fc6141587e --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/gyptest-default.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +# 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. + +""" +Verifies use of include_dirs when using the default build target. +""" + +import TestGyp + +test = TestGyp.TestGyp() + +test.run_gyp('includes.gyp', chdir='src') + +test.relocate('src', 'relocate/src') + +test.build('includes.gyp', test.ALL, chdir='relocate/src') + +expect = """\ +Hello from includes.c +Hello from inc.h +Hello from include1.h +Hello from subdir/inc2/include2.h +Hello from shadow2/shadow.h +""" +test.run_built_executable('includes', stdout=expect, chdir='relocate/src') + +if test.format == 'xcode': + chdir='relocate/src/subdir' +else: + chdir='relocate/src' + +expect = """\ +Hello from subdir/subdir_includes.c +Hello from subdir/inc.h +Hello from include1.h +Hello from subdir/inc2/include2.h +""" +test.run_built_executable('subdir_includes', stdout=expect, chdir=chdir) + +test.pass_test() diff --git a/third_party/python/gyp/test/include_dirs/src/inc.h b/third_party/python/gyp/test/include_dirs/src/inc.h new file mode 100644 index 0000000000..0398d6915f --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/inc.h @@ -0,0 +1 @@ +#define INC_STRING "inc.h" diff --git a/third_party/python/gyp/test/include_dirs/src/inc1/include1.h b/third_party/python/gyp/test/include_dirs/src/inc1/include1.h new file mode 100644 index 0000000000..43356b5f47 --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/inc1/include1.h @@ -0,0 +1 @@ +#define INCLUDE1_STRING "include1.h" diff --git a/third_party/python/gyp/test/include_dirs/src/includes.c b/third_party/python/gyp/test/include_dirs/src/includes.c new file mode 100644 index 0000000000..6e2a23cdff --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/includes.c @@ -0,0 +1,19 @@ +#include + +#include "inc.h" +#include "include1.h" +#include "include2.h" +#include "shadow.h" + +int main(void) +{ + printf("Hello from includes.c\n"); + printf("Hello from %s\n", INC_STRING); + printf("Hello from %s\n", INCLUDE1_STRING); + printf("Hello from %s\n", INCLUDE2_STRING); + /* Test that include_dirs happen first: The gyp file has a -Ishadow1 + cflag and an include_dir of shadow2. Including shadow.h should get + the shadow.h from the include_dir. */ + printf("Hello from %s\n", SHADOW_STRING); + return 0; +} diff --git a/third_party/python/gyp/test/include_dirs/src/includes.gyp b/third_party/python/gyp/test/include_dirs/src/includes.gyp new file mode 100644 index 0000000000..3592690208 --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/includes.gyp @@ -0,0 +1,27 @@ +# 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': 'includes', + 'type': 'executable', + 'dependencies': [ + 'subdir/subdir_includes.gyp:subdir_includes', + ], + 'cflags': [ + '-Ishadow1', + ], + 'include_dirs': [ + '.', + 'inc1', + 'shadow2', + 'subdir/inc2', + ], + 'sources': [ + 'includes.c', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/include_dirs/src/shadow1/shadow.h b/third_party/python/gyp/test/include_dirs/src/shadow1/shadow.h new file mode 100644 index 0000000000..80f6de20b8 --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/shadow1/shadow.h @@ -0,0 +1 @@ +#define SHADOW_STRING "shadow1/shadow.h" diff --git a/third_party/python/gyp/test/include_dirs/src/shadow2/shadow.h b/third_party/python/gyp/test/include_dirs/src/shadow2/shadow.h new file mode 100644 index 0000000000..fad5ccd085 --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/shadow2/shadow.h @@ -0,0 +1 @@ +#define SHADOW_STRING "shadow2/shadow.h" diff --git a/third_party/python/gyp/test/include_dirs/src/subdir/inc.h b/third_party/python/gyp/test/include_dirs/src/subdir/inc.h new file mode 100644 index 0000000000..0a68d7b36a --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/subdir/inc.h @@ -0,0 +1 @@ +#define INC_STRING "subdir/inc.h" diff --git a/third_party/python/gyp/test/include_dirs/src/subdir/inc2/include2.h b/third_party/python/gyp/test/include_dirs/src/subdir/inc2/include2.h new file mode 100644 index 0000000000..721577effb --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/subdir/inc2/include2.h @@ -0,0 +1 @@ +#define INCLUDE2_STRING "subdir/inc2/include2.h" diff --git a/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.c b/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.c new file mode 100644 index 0000000000..4623543c43 --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.c @@ -0,0 +1,14 @@ +#include + +#include "inc.h" +#include "include1.h" +#include "include2.h" + +int main(void) +{ + printf("Hello from subdir/subdir_includes.c\n"); + printf("Hello from %s\n", INC_STRING); + printf("Hello from %s\n", INCLUDE1_STRING); + printf("Hello from %s\n", INCLUDE2_STRING); + return 0; +} diff --git a/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.gyp b/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.gyp new file mode 100644 index 0000000000..257d052c3c --- /dev/null +++ b/third_party/python/gyp/test/include_dirs/src/subdir/subdir_includes.gyp @@ -0,0 +1,20 @@ +# 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': 'subdir_includes', + 'type': 'executable', + 'include_dirs': [ + '.', + '../inc1', + 'inc2', + ], + 'sources': [ + 'subdir_includes.c', + ], + }, + ], +} -- cgit v1.2.3