diff options
Diffstat (limited to 'media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir')
5 files changed, 77 insertions, 0 deletions
diff --git a/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.gyp new file mode 100644 index 000000000..328fc306c --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_1/test_1.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. + +{ + 'variables': { + 'expected_value': 'dir_1', + 'target_name': 'target_1', + }, + 'includes': [ + '../repeated_command_common.gypi', + ], +} diff --git a/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.gyp new file mode 100644 index 000000000..18e0c62c9 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/dir_2/test_2.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. + +{ + 'variables': { + 'expected_value': 'dir_2', + 'target_name': 'target_2', + }, + 'includes': [ + '../repeated_command_common.gypi', + ], +} diff --git a/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/main.gyp b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/main.gyp new file mode 100644 index 000000000..5beeeb724 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/main.gyp @@ -0,0 +1,16 @@ +# 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': 'main', + 'type': 'none', + 'dependencies': [ + 'dir_1/test_1.gyp:target_1', + 'dir_2/test_2.gyp:target_2', + ], + }, + ], +} diff --git a/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py new file mode 100755 index 000000000..ace9ed6b8 --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/print_cwd_basename.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python + +# 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. + +import os +import os.path + +print os.path.basename(os.getcwd()) diff --git a/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi new file mode 100644 index 000000000..74366771a --- /dev/null +++ b/media/webrtc/trunk/tools/gyp/test/variables/commands/repeated_multidir/repeated_command_common.gypi @@ -0,0 +1,25 @@ +# 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. + +{ + 'variables': { + # This command will be run from the directories of the .gyp files that + # include this .gypi, the subdirectories dir_1 and dir_2, so use a + # relative path from those directories to the script. + 'observed_value': '<!(python ../print_cwd_basename.py)', + }, + 'targets': [ + { + 'target_name': '<(target_name)', + 'type': 'none', + 'conditions': [ + ['observed_value != expected_value', { + # Attempt to expand an undefined variable. This triggers a GYP + # error. + 'assertion': '<(observed_value_must_equal_expected_value)', + }], + ], + }, + ], +} |