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 --- .../gyp/test/toplevel-dir/gyptest-toplevel-dir.py | 31 ++++++++++++++++++++++ .../python/gyp/test/toplevel-dir/src/sub1/main.gyp | 18 +++++++++++++ .../python/gyp/test/toplevel-dir/src/sub1/prog1.c | 7 +++++ .../python/gyp/test/toplevel-dir/src/sub2/prog2.c | 7 +++++ .../gyp/test/toplevel-dir/src/sub2/prog2.gyp | 15 +++++++++++ 5 files changed, 78 insertions(+) create mode 100755 third_party/python/gyp/test/toplevel-dir/gyptest-toplevel-dir.py create mode 100644 third_party/python/gyp/test/toplevel-dir/src/sub1/main.gyp create mode 100644 third_party/python/gyp/test/toplevel-dir/src/sub1/prog1.c create mode 100644 third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.c create mode 100644 third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.gyp (limited to 'third_party/python/gyp/test/toplevel-dir') diff --git a/third_party/python/gyp/test/toplevel-dir/gyptest-toplevel-dir.py b/third_party/python/gyp/test/toplevel-dir/gyptest-toplevel-dir.py new file mode 100755 index 0000000000..9e69512dd3 --- /dev/null +++ b/third_party/python/gyp/test/toplevel-dir/gyptest-toplevel-dir.py @@ -0,0 +1,31 @@ +#!/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 building a subsidiary dependent target from a .gyp file in a +subdirectory, without specifying an explicit output build directory, +and using the subdirectory's solution or project file as the entry point. +""" + +import TestGyp +import errno + +test = TestGyp.TestGyp(formats=['ninja', 'make']) + +# We want our Makefile to be one dir up from main.gyp. +test.run_gyp('main.gyp', '--toplevel-dir=..', chdir='src/sub1') + +toplevel_dir = 'src' + +test.build('sub1/main.gyp', test.ALL, chdir=toplevel_dir) + +test.built_file_must_exist('prog1', type=test.EXECUTABLE, chdir=toplevel_dir) + +test.run_built_executable('prog1', + chdir=toplevel_dir, + stdout="Hello from prog1.c\n") + +test.pass_test() diff --git a/third_party/python/gyp/test/toplevel-dir/src/sub1/main.gyp b/third_party/python/gyp/test/toplevel-dir/src/sub1/main.gyp new file mode 100644 index 0000000000..33219010e4 --- /dev/null +++ b/third_party/python/gyp/test/toplevel-dir/src/sub1/main.gyp @@ -0,0 +1,18 @@ +# 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': 'prog1', + 'type': 'executable', + 'dependencies': [ + '<(DEPTH)/../sub2/prog2.gyp:prog2', + ], + 'sources': [ + 'prog1.c', + ], + }, + ], +} diff --git a/third_party/python/gyp/test/toplevel-dir/src/sub1/prog1.c b/third_party/python/gyp/test/toplevel-dir/src/sub1/prog1.c new file mode 100644 index 0000000000..218e99401c --- /dev/null +++ b/third_party/python/gyp/test/toplevel-dir/src/sub1/prog1.c @@ -0,0 +1,7 @@ +#include + +int main(void) +{ + printf("Hello from prog1.c\n"); + return 0; +} diff --git a/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.c b/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.c new file mode 100644 index 0000000000..12a31883b9 --- /dev/null +++ b/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.c @@ -0,0 +1,7 @@ +#include + +int main(void) +{ + printf("Hello from prog2.c\n"); + return 0; +} diff --git a/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.gyp b/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.gyp new file mode 100644 index 0000000000..5934548369 --- /dev/null +++ b/third_party/python/gyp/test/toplevel-dir/src/sub2/prog2.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': 'prog2', + 'type': 'executable', + 'sources': [ + 'prog2.c', + ], + }, + ], +} -- cgit v1.2.3