diff options
Diffstat (limited to 'other-licenses/gyp-deps/tools/gyp/test/win')
341 files changed, 9857 insertions, 0 deletions
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/asm-files.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/asm-files.gyp new file mode 100644 index 000000000..b1f132cee --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/asm-files.gyp @@ -0,0 +1,17 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'sources_with_asm', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'b.s', + 'c.S', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/b.s b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/b.s new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/b.s diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/c.S b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/c.S new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/c.S diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/hello.cc new file mode 100644 index 000000000..1711567ef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/asm-files/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/batch-file-action.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/batch-file-action.gyp new file mode 100644 index 000000000..e4db9af9d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/batch-file-action.gyp @@ -0,0 +1,21 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_batch', + 'type': 'none', + 'actions': [ + { + 'action_name': 'copy_to_output', + 'inputs': ['infile'], + 'outputs': ['outfile'], + 'action': ['somecmd.bat', 'infile', 'outfile'], + 'msvs_cygwin_shell': 0, + } + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/infile b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/infile new file mode 100644 index 000000000..3f9177e45 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/infile @@ -0,0 +1 @@ +input diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/somecmd.bat b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/somecmd.bat new file mode 100644 index 000000000..d48775374 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/batch-file-action/somecmd.bat @@ -0,0 +1,5 @@ +@echo off
+:: The redirs to nul are important. %2 can end up being an unterminated "'d
+:: string, so the remainder of the command line becomes the target file name,
+:: which in turn fails because it's a filename containing >, nul, etc.
+copy /y %1 %2 >nul 2>nul
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/a.S b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/a.S new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/a.S diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/bat with spaces.bat b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/bat with spaces.bat new file mode 100644 index 000000000..dc3508f9a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/bat with spaces.bat @@ -0,0 +1,7 @@ +@echo off + +:: 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. + +copy %1 %2 diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/command-quote.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/command-quote.gyp new file mode 100644 index 000000000..faf724674 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/command-quote.gyp @@ -0,0 +1,79 @@ +# 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. + +{ + 'target_defaults': { + 'msvs_cygwin_dirs': ['../../../../../<(DEPTH)/third_party/cygwin'], + }, + 'targets': [ + { + 'target_name': 'test_batch', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output.obj'], + 'action': ['call go.bat', '<(RULE_INPUT_PATH)', 'output.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_call_separate', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch2', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output2.obj'], + 'action': ['call', 'go.bat', '<(RULE_INPUT_PATH)', 'output2.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_spaces', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output3.obj'], + 'action': ['bat with spaces.bat', '<(RULE_INPUT_PATH)', 'output3.obj'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_double_quotes', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 1, + 'extension': 'S', + 'outputs': ['output4.obj'], + 'arguments': ['-v'], + 'action': ['python', '-c', 'import shutil; ' + 'shutil.copy("<(RULE_INPUT_PATH)", "output4.obj")'], + },], + 'sources': ['a.S'], + }, + { + 'target_name': 'test_with_single_quotes', + 'type': 'none', + 'rules': [ + { + 'rule_name': 'build_with_batch3', + 'msvs_cygwin_shell': 1, + 'extension': 'S', + 'outputs': ['output5.obj'], + 'action': ['python', '-c', "import shutil; " + "shutil.copy('<(RULE_INPUT_PATH)', 'output5.obj')"], + },], + 'sources': ['a.S'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/go.bat b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/go.bat new file mode 100644 index 000000000..dc3508f9a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/go.bat @@ -0,0 +1,7 @@ +@echo off + +:: 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. + +copy %1 %2 diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp new file mode 100644 index 000000000..3dff4c40b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/command-quote/subdir/and/another/in-subdir.gyp @@ -0,0 +1,27 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_batch_depth', + 'type': 'none', + 'variables': { + # Taken from native_client/build/common.gypi. Seems unintentional (a + # string in a 1 element list)? But since it works on other generators, + # I guess it should work here too. + 'filepath': [ 'call <(DEPTH)/../../../go.bat' ], + }, + 'rules': [ + { + 'rule_name': 'build_with_batch4', + 'msvs_cygwin_shell': 0, + 'extension': 'S', + 'outputs': ['output4.obj'], + 'action': ['<@(filepath)', '<(RULE_INPUT_PATH)', 'output4.obj'], + },], + 'sources': ['<(DEPTH)\\..\\..\\..\\a.S'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.cc new file mode 100644 index 000000000..f1e11dd12 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.cc @@ -0,0 +1,10 @@ +// 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. + +// No path qualification to test compiler include dir specification. +#include "header.h" + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.gyp new file mode 100644 index 000000000..42c7e849f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-include-dirs.gyp @@ -0,0 +1,20 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_incs', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalIncludeDirectories': [ + 'subdir', + ], + } + }, + 'sources': ['additional-include-dirs.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.cc new file mode 100644 index 000000000..c79572baf --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.cc @@ -0,0 +1,10 @@ +// 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. + +int main() { + // Generate a warning that will appear at level 4, but not level 1 + // (truncation and unused local). + char c = 123456; + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.gyp new file mode 100644 index 000000000..6a365a206 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/additional-options.gyp @@ -0,0 +1,31 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_additional_none', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + } + }, + 'sources': ['additional-options.cc'], + }, + { + 'target_name': 'test_additional_one', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + 'AdditionalOptions': [ '/W1' ], + } + }, + 'sources': ['additional-options.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/analysis.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/analysis.gyp new file mode 100644 index 000000000..97e942258 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/analysis.gyp @@ -0,0 +1,40 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_analysis_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnablePREfast': 'true', + 'WarnAsError': 'true', + }, + }, + 'sources': ['uninit.cc'], + }, + { + 'target_name': 'test_analysis_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnablePREfast': 'false', + 'WarnAsError': 'true', + }, + }, + 'sources': ['uninit.cc'], + }, + { + 'target_name': 'test_analysis_unspec', + 'type': 'executable', + 'sources': ['uninit.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security-check.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security-check.gyp new file mode 100644 index 000000000..cc5a12b95 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security-check.gyp @@ -0,0 +1,51 @@ +# 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. + +{ + 'targets': [ + # Turn debug information on so that we can see the name of the buffer + # security check cookie in the disassembly. + { + 'target_name': 'test_bsc_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + { + 'target_name': 'test_bsc_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'BufferSecurityCheck': 'false', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + { + 'target_name': 'test_bsc_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'BufferSecurityCheck': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['buffer-security.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security.cc new file mode 100644 index 000000000..e8a48a2a6 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/buffer-security.cc @@ -0,0 +1,12 @@ +// 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. + +#include <malloc.h> +#include <string.h> + +int main() { + char* stuff = reinterpret_cast<char*>(_alloca(256)); + strcpy(stuff, "blah"); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-cdecl.def b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-cdecl.def new file mode 100644 index 000000000..dc1dba055 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-cdecl.def @@ -0,0 +1,6 @@ +; Copyright (c) 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. + +EXPORTS + foo diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-fastcall.def b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-fastcall.def new file mode 100644 index 000000000..2c61afe20 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-fastcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 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. + +EXPORTS + @foo@0 diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-stdcall.def b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-stdcall.def new file mode 100644 index 000000000..6c7e05e9e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-stdcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 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. + +EXPORTS + _foo@0 diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-vectorcall.def b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-vectorcall.def new file mode 100644 index 000000000..4ef119c3e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention-vectorcall.def @@ -0,0 +1,6 @@ +; Copyright (c) 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. + +EXPORTS + foo@@0 diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.cc new file mode 100644 index 000000000..0d78a0cc0 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.cc @@ -0,0 +1,6 @@ +// Copyright (c) 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. + +extern "C" void foo() { +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.gyp new file mode 100644 index 000000000..5069c552b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/calling-convention.gyp @@ -0,0 +1,66 @@ +# Copyright (c) 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': 'test_cdecl', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 0, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-cdecl.def', + ], + }, + { + 'target_name': 'test_fastcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 1, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-fastcall.def', + ], + }, + { + 'target_name': 'test_stdcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 2, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-stdcall.def', + ], + }, + ], + 'conditions': [ + ['MSVS_VERSION[0:4]>="2013"', { + 'targets': [ + { + 'target_name': 'test_vectorcall', + 'type': 'loadable_module', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CallingConvention': 3, + }, + }, + 'sources': [ + 'calling-convention.cc', + 'calling-convention-vectorcall.def', + ], + }, + ], + }], + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-mbcs.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-mbcs.cc new file mode 100644 index 000000000..328630473 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-mbcs.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _MBCS +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-unicode.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-unicode.cc new file mode 100644 index 000000000..32e69724a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set-unicode.cc @@ -0,0 +1,15 @@ +// 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. + +#ifndef _UNICODE +#error +#endif + +#ifndef UNICODE +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set.gyp new file mode 100644 index 000000000..3dc45557d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/character-set.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_cs_notset', + 'product_name': 'test_cs_notset', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '0' + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_cs_unicode', + 'product_name': 'test_cs_unicode', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '1' + }, + 'sources': ['character-set-unicode.cc'], + }, + { + 'target_name': 'test_cs_mbcs', + 'product_name': 'test_cs_mbcs', + 'type': 'executable', + 'msvs_configuration_attributes': { + 'CharacterSet': '2' + }, + 'sources': ['character-set-mbcs.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.cc new file mode 100644 index 000000000..a29c71ee1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2015 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 <vcclr.h> + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.gyp new file mode 100644 index 000000000..3bacbbc13 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-managed.gyp @@ -0,0 +1,29 @@ +# Copyright (c) 2015 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': 'test-compile-as-managed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CompileAsManaged': 'true', + 'ExceptionHandling': '0' # /clr is incompatible with /EHs + } + }, + 'sources': ['compile-as-managed.cc'], + }, + { + 'target_name': 'test-compile-as-unmanaged', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'CompileAsManaged': 'false', + } + }, + 'sources': ['compile-as-managed.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.cc new file mode 100644 index 000000000..da9954f8f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.cc @@ -0,0 +1,12 @@ +// Copyright (c) 2016 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. + +using namespace Platform; + +int main() { + wchar_t msg[] = L"Test"; + String^ str1 = ref new String(msg); + auto str2 = String::Concat(str1, " Concat"); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.gyp new file mode 100644 index 000000000..8978e5059 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/compile-as-winrt.gyp @@ -0,0 +1,20 @@ +# Copyright (c) 2016 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': 'test-compile-as-winrt', + 'type': 'executable', + 'msvs_windows_sdk_version': 'v10.0', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalUsingDirectories': ['$(VCInstallDir)vcpackages;$(WindowsSdkDir)UnionMetadata;%(AdditionalUsingDirectories)'], + 'CompileAsWinRT': 'true' + } + }, + 'sources': ['compile-as-winrt.cc'] + } + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/debug-format.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/debug-format.gyp new file mode 100644 index 000000000..daaed23ff --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/debug-format.gyp @@ -0,0 +1,48 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test-debug-format-off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-oldstyle', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-pdb', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test-debug-format-editcontinue', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '4' + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.cc new file mode 100644 index 000000000..beeca2aa1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.cc @@ -0,0 +1,15 @@ +// 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. + +template <bool> +struct CompileAssert { +}; + +#define COMPILE_ASSERT(expr, msg) \ + typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +int main() { + COMPILE_ASSERT(char(-1) > 0, default_char_is_unsigned); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp new file mode 100644 index 000000000..941e5810d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/default-char-is-unsigned.gyp @@ -0,0 +1,20 @@ +# 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': 'test_default_char_is_unsigned', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DefaultCharIsUnsigned': 'true', + }, + }, + 'sources': [ + 'default-char-is-unsigned.cc', + ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.cc new file mode 100644 index 000000000..d312f5f48 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.cc @@ -0,0 +1,9 @@ +// 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. + +int main() { + // Causes level 1 warning (C4700) + int i; + return i; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.gyp new file mode 100644 index 000000000..d81d694c6 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/disable-specific-warnings.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_disable_specific_warnings_set', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + 'DisableSpecificWarnings': ['4700'] + } + }, + 'sources': ['disable-specific-warnings.cc'] + }, + { + 'target_name': 'test_disable_specific_warnings_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true' + } + }, + 'sources': ['disable-specific-warnings.cc'] + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc new file mode 100644 index 000000000..432ef54ed --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.cc @@ -0,0 +1,28 @@ +// Copyright (c) 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. + +#include <stdio.h> + +static const char* GetArchOption() { +#if _M_IX86_FP == 0 + return "IA32"; +#elif _M_IX86_FP == 1 + return "SSE"; +#elif _M_IX86_FP == 2 +# if defined(__AVX2__) + return "AVX2"; +# elif defined(__AVX__) + return "AVX"; +# else + return "SSE2"; +# endif +#else + return "UNSUPPORTED OPTION"; +#endif +} + +int main() { + printf("/arch:%s\n", GetArchOption()); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp new file mode 100644 index 000000000..9c49edc7f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/enable-enhanced-instruction-set.gyp @@ -0,0 +1,68 @@ +# Copyright (c) 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': 'sse_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '1', # StreamingSIMDExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + { + 'target_name': 'sse2_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '2', # StreamingSIMDExtensions2 + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + 'conditions': [ + ['MSVS_VERSION[0:4]>"2010"', { + 'targets': [ + { + 'target_name': 'avx_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '3', # AdvancedVectorExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + { + 'target_name': 'no_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '4', # NoExtensions + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + }], + ['MSVS_VERSION[0:4]>="2013"', { + 'targets': [ + { + 'target_name': 'avx2_extensions', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableEnhancedInstructionSet': '5', # AdvancedVectorExtensions2 + } + }, + 'sources': ['enable-enhanced-instruction-set.cc'], + }, + ], + }], + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling-on.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling-on.cc new file mode 100644 index 000000000..5d9a3af77 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling-on.cc @@ -0,0 +1,24 @@ +// 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. + +#include <excpt.h> +#include <stdlib.h> + +void fail() { + try { + int i = 0, j = 1; + j /= i; + } catch(...) { + exit(1); + } +} + +int main() { + __try { + fail(); + } __except(EXCEPTION_EXECUTE_HANDLER) { + return 2; + } + return 3; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling.gyp new file mode 100644 index 000000000..c266768dd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/exception-handling.gyp @@ -0,0 +1,46 @@ +# 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. + +{ + 'targets': [ + # Optimization disabled so that the exception-causing code is not removed + # (divide by zero was getting optimized away in VS2010). + { + 'target_name': 'test_eh_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '0', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + { + 'target_name': 'test_eh_s', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '1', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + { + 'target_name': 'test_eh_a', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ExceptionHandling': '2', + 'WarnAsError': 'true', + 'Optimization': '0', + } + }, + 'sources': ['exception-handling-on.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-fast.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-fast.cc new file mode 100644 index 000000000..9d22152f5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-fast.cc @@ -0,0 +1,19 @@ +// Copyright (c) 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. + +#ifdef _M_FP_PRECISE +#error +#endif + +#ifdef _M_FP_STRICT +#error +#endif + +#ifndef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-precise.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-precise.cc new file mode 100644 index 000000000..1191a74ed --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-precise.cc @@ -0,0 +1,19 @@ +// Copyright (c) 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. + +#ifndef _M_FP_PRECISE +#error +#endif + +#ifdef _M_FP_STRICT +#error +#endif + +#ifdef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-strict.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-strict.cc new file mode 100644 index 000000000..1ffde36e0 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model-strict.cc @@ -0,0 +1,19 @@ +// Copyright (c) 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. + +#ifdef _M_FP_PRECISE +#error +#endif + +#ifndef _M_FP_STRICT +#error +#endif + +#ifdef _M_FP_FAST +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model.gyp new file mode 100644 index 000000000..857b275a8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/floating-point-model.gyp @@ -0,0 +1,43 @@ +# Copyright (c) 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': 'test-floating-point-model-default', + 'type': 'executable', + 'sources': ['floating-point-model-precise.cc'], + }, + { + 'target_name': 'test-floating-point-model-precise', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '0' + } + }, + 'sources': ['floating-point-model-precise.cc'], + }, + { + 'target_name': 'test-floating-point-model-strict', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '1' + } + }, + 'sources': ['floating-point-model-strict.cc'], + }, + { + 'target_name': 'test-floating-point-model-fast', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FloatingPointModel': '2' + } + }, + 'sources': ['floating-point-model-fast.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc new file mode 100644 index 000000000..85cb0f32a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files-with-precompiled.cc @@ -0,0 +1,10 @@ +// 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. + +#include <stdio.h> + +int main() { + std::string s; + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.cc new file mode 100644 index 000000000..4a93de55d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.cc @@ -0,0 +1,8 @@ +// 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. + +int main() { + std::list<std::vector<std::string> > l; + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.gyp new file mode 100644 index 000000000..2031546cc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/force-include-files.gyp @@ -0,0 +1,36 @@ +# 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': 'test_force_include_files', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ForcedIncludeFiles': ['string', 'vector', 'list'], + }, + }, + 'sources': [ + 'force-include-files.cc', + ], + }, + { + 'target_name': 'test_force_include_with_precompiled', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'ForcedIncludeFiles': ['string'], + }, + }, + 'msvs_precompiled_header': 'stdio.h', + 'msvs_precompiled_source': 'precomp.cc', + 'msvs_disabled_warnings': [ 4530, ], + 'sources': [ + 'force-include-files-with-precompiled.cc', + 'precomp.cc', + ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.cc new file mode 100644 index 000000000..495227281 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.cc @@ -0,0 +1,11 @@ +// 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. + +int comdat_function() { + return 1; +} + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.gyp new file mode 100644 index 000000000..5858586a2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/function-level-linking.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_fll_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'false' + } + }, + 'sources': ['function-level-linking.cc'], + }, + { + 'target_name': 'test_fll_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + } + }, + 'sources': ['function-level-linking.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/hello.cc new file mode 100644 index 000000000..1711567ef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/optimizations.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/optimizations.gyp new file mode 100644 index 000000000..e63096f0f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/optimizations.gyp @@ -0,0 +1,207 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_opt_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_size', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_speed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_lev_max', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '3' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fpo', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'OmitFramePointers': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fpo_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'OmitFramePointers': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_intrinsic', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableIntrinsicFunctions': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_intrinsic_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableIntrinsicFunctions': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_manual', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_inline_auto', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'InlineFunctionExpansion': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_neither', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '0' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_speed', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_size', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'FavorSizeOrSpeed': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_wpo', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_sp', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'StringPooling': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_sp_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'StringPooling': 'false' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fso', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFiberSafeOptimizations': 'true' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_opt_fso_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFiberSafeOptimizations': 'false' + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname-override.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname-override.gyp new file mode 100644 index 000000000..dad20e01f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname-override.gyp @@ -0,0 +1,26 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_pdbname', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'pdbname.cc', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'ProgramDataBaseFileName': '<(PRODUCT_DIR)/compiler_generated.pdb', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/linker_generated.pdb', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.cc new file mode 100644 index 000000000..0fe05d5af --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.gyp new file mode 100644 index 000000000..8fcf75472 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/pdbname.gyp @@ -0,0 +1,24 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_pdbname', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'pdbname.cc', + ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/precomp.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/precomp.cc new file mode 100644 index 000000000..d16bac890 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/precomp.cc @@ -0,0 +1,6 @@ +// Copyright 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. + +#include <windows.h> +#include <stdio.h> diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti-on.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti-on.cc new file mode 100644 index 000000000..2d3ad03ae --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti-on.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _CPPRTTI +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti.gyp new file mode 100644 index 000000000..704cd58f5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/rtti.gyp @@ -0,0 +1,37 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_rtti_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'false', + 'WarnAsError': 'true' + } + }, + 'sources': ['rtti-on.cc'], + }, + { + 'target_name': 'test_rtti_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeTypeInfo': 'true', + 'WarnAsError': 'true' + } + }, + 'sources': ['rtti-on.cc'], + }, + { + 'target_name': 'test_rtti_unset', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['rtti-on.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.cc new file mode 100644 index 000000000..fdb811da8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef __MSVC_RUNTIME_CHECKS +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.gyp new file mode 100644 index 000000000..8ea309205 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-checks.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_brc_none', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + } + }, + 'sources': ['runtime-checks.cc'], + }, + { + 'target_name': 'test_brc_1', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'Optimization': '0', + 'BasicRuntimeChecks': '3' + } + }, + 'sources': ['runtime-checks.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-md.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-md.cc new file mode 100644 index 000000000..87c83021d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-md.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifdef _DEBUG +#error +#endif + +#ifndef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mdd.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mdd.cc new file mode 100644 index 000000000..9f175e493 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mdd.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifndef _DEBUG +#error +#endif + +#ifndef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mt.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mt.cc new file mode 100644 index 000000000..27e62b63d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mt.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifdef _DEBUG +#error +#endif + +#ifdef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mtd.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mtd.cc new file mode 100644 index 000000000..a9921db9e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library-mtd.cc @@ -0,0 +1,19 @@ +// 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. + +#ifndef _MT +#error +#endif + +#ifndef _DEBUG +#error +#endif + +#ifdef _DLL +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library.gyp new file mode 100644 index 000000000..04afc391c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/runtime-library.gyp @@ -0,0 +1,48 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_rl_md', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '2' + } + }, + 'sources': ['runtime-library-md.cc'], + }, + { + 'target_name': 'test_rl_mdd', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '3' + } + }, + 'sources': ['runtime-library-mdd.cc'], + }, + { + 'target_name': 'test_rl_mt', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '0' + } + }, + 'sources': ['runtime-library-mt.cc'], + }, + { + 'target_name': 'test_rl_mtd', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'RuntimeLibrary': '1' + } + }, + 'sources': ['runtime-library-mtd.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/subdir/header.h b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/subdir/header.h new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/subdir/header.h diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp new file mode 100644 index 000000000..456fe047d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type.gyp @@ -0,0 +1,33 @@ +# 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': 'test_treat_wchar_t_as_built_in_type_negative', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'TreatWChar_tAsBuiltInType': 'false', + }, + }, + 'sources': [ + 'treat-wchar-t-as-built-in-type1.cc', + ], + }, + { + 'target_name': 'test_treat_wchar_t_as_built_in_type_positive', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'TreatWChar_tAsBuiltInType': 'true', + }, + }, + 'sources': [ + 'treat-wchar-t-as-built-in-type2.cc', + ], + }, + + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc new file mode 100644 index 000000000..fc1ed0b7e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc @@ -0,0 +1,11 @@ +// 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. + +#ifdef _NATIVE_WCHAR_T_DEFINED +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc new file mode 100644 index 000000000..28ab94f74 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc @@ -0,0 +1,11 @@ +// 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. + +#ifndef _NATIVE_WCHAR_T_DEFINED +#error +#endif + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/uninit.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/uninit.cc new file mode 100644 index 000000000..a9d5f5d48 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/uninit.cc @@ -0,0 +1,13 @@ +// 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. + +// Should trigger C6001: using uninitialized memory <variable> for |i|. +int f(bool b) { + int i; + if (b) + i = 0; + return i; +} + +int main() {} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.cc new file mode 100644 index 000000000..fd2130aca --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.cc @@ -0,0 +1,9 @@ +// 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. + +int main() { + // Cause a warning, even at /W1 + int export; + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.gyp new file mode 100644 index 000000000..d71f26114 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-as-error.gyp @@ -0,0 +1,37 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_warn_as_error_false', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'false' + } + }, + 'sources': ['warning-as-error.cc'] + }, + { + 'target_name': 'test_warn_as_error_true', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true' + } + }, + 'sources': ['warning-as-error.cc'] + }, + { + 'target_name': 'test_warn_as_error_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['warning-as-error.cc'] + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level.gyp new file mode 100644 index 000000000..2297aa7ca --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level.gyp @@ -0,0 +1,115 @@ +# 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. + +{ + 'targets': [ + # Level 1 + { + 'target_name': 'test_wl1_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '1', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level1.cc'], + }, + { + 'target_name': 'test_wl1_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '1', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level2.cc'], + }, + + # Level 2 + { + 'target_name': 'test_wl2_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '2', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level2.cc'], + }, + { + 'target_name': 'test_wl2_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '2', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level3.cc'], + }, + + # Level 3 + { + 'target_name': 'test_wl3_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level3.cc'], + }, + { + 'target_name': 'test_wl3_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level4.cc'], + }, + + + # Level 4 + { + 'target_name': 'test_wl4_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level4.cc'], + }, + + # Default level + { + 'target_name': 'test_def_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarnAsError': 'true', + } + }, + 'sources': ['warning-level1.cc'], + }, + { + 'target_name': 'test_def_pass', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + } + }, + 'sources': ['warning-level2.cc'], + }, + + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level1.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level1.cc new file mode 100644 index 000000000..119578d69 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level1.cc @@ -0,0 +1,8 @@ +// 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. + +int main() { + int export; // Cause a level 1 warning (C4237). + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level2.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level2.cc new file mode 100644 index 000000000..9a2670318 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level2.cc @@ -0,0 +1,14 @@ +// 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. + +int f(int x) { + return 0; +} + +int main() { + double x = 10.1; + // Cause a level 2 warning (C4243). + return f(x); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level3.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level3.cc new file mode 100644 index 000000000..e0a9f3cdd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level3.cc @@ -0,0 +1,11 @@ +// 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. + +// Cause a level 3 warning (C4359). +struct __declspec(align(8)) C8 { __int64 i; }; +struct __declspec(align(4)) C4 { C8 m8; }; + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level4.cc b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level4.cc new file mode 100644 index 000000000..48a4fb701 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/compiler-flags/warning-level4.cc @@ -0,0 +1,10 @@ +// 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. + +int main() { + const int i = -1; + // Cause a level 4 warning (C4245). + unsigned int j = i; + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/dllmain.cc b/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/dllmain.cc new file mode 100644 index 000000000..dedd83c3f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/dllmain.cc @@ -0,0 +1,30 @@ +// 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. + +#include <windows.h> +#include <wrl.h> +#include <wrl/wrappers/corewrappers.h> +#include <windows.graphics.display.h> + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr<IDisplayPropertiesStatics> dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/enable-winrt.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/enable-winrt.gyp new file mode 100644 index 000000000..69f70189d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/enable-winrt/enable-winrt.gyp @@ -0,0 +1,39 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_missing_dll', + 'type': 'shared_library', + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_winphone_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_enable_winphone': 1, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + '%(AdditionalDependencies)', + ], + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py new file mode 100644 index 000000000..8c8c365d5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py @@ -0,0 +1,44 @@ +#!/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. + +""" +Test that the generator output can be written to a different drive on Windows. +""" + +import os +import TestGyp +import string +import subprocess +import sys + + +if sys.platform == 'win32': + import win32api + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + def GetFirstFreeDriveLetter(): + """ Returns the first unused Windows drive letter in [A, Z] """ + all_letters = [c for c in string.uppercase] + in_use = win32api.GetLogicalDriveStrings() + free = list(set(all_letters) - set(in_use)) + return free[0] + + output_dir = os.path.join('different-drive', 'output') + if not os.path.isdir(os.path.abspath(output_dir)): + os.makedirs(os.path.abspath(output_dir)) + output_drive = GetFirstFreeDriveLetter() + subprocess.call(['subst', '%c:' % output_drive, os.path.abspath(output_dir)]) + try: + test.run_gyp('prog.gyp', '--generator-output=%s' % ( + os.path.join(output_drive, 'output'))) + test.build('prog.gyp', test.ALL, chdir=os.path.join(output_drive, 'output')) + test.built_file_must_exist('program', chdir=os.path.join(output_drive, + 'output'), + type=test.EXECUTABLE) + test.pass_test() + finally: + subprocess.call(['subst', '%c:' % output_drive, '/D']) diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.c b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.c new file mode 100644 index 000000000..7937f5d07 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.c @@ -0,0 +1,10 @@ +// Copyright 2013 The Chromium Authors. 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> + +int main(void) { + printf("Hello from prog.c\n"); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.gyp new file mode 100644 index 000000000..92f53e5da --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/generator-output-different-drive/prog.gyp @@ -0,0 +1,15 @@ +# Copyright 2013 The Chromium Authors. 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': 'program', + 'type': 'executable', + 'sources': [ + 'prog.c', + ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-asm-files.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-asm-files.py new file mode 100644 index 000000000..007b52eb2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-asm-files.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. + +""" +Make sure .s files aren't passed to cl. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'asm-files' + test.run_gyp('asm-files.gyp', chdir=CHDIR) + # The compiler will error out if it's passed the .s files, so just make sure + # the build succeeds. The compiler doesn't directly support building + # assembler files on Windows, they have to be built explicitly with a + # third-party tool. + test.build('asm-files.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-include-dirs.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-include-dirs.py new file mode 100644 index 000000000..1fabfa975 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-include-dirs.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure additional include dirs are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('additional-include-dirs.gyp', chdir=CHDIR) + test.build('additional-include-dirs.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-options.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-options.py new file mode 100644 index 000000000..e9aea10dc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-additional-options.py @@ -0,0 +1,28 @@ +#!/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. + +""" +Make sure additional manual compiler flags are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('additional-options.gyp', chdir=CHDIR) + + # Warning level not overidden, must fail. + test.build('additional-options.gyp', 'test_additional_none', chdir=CHDIR, + status=1) + + # Warning level is overridden, must succeed. + test.build('additional-options.gyp', 'test_additional_one', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-analysis.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-analysis.py new file mode 100644 index 000000000..7b3b9897f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-analysis.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure PREfast (code analysis) setting is extracted properly. +""" + +import TestGyp + +import os +import sys + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2012): + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('analysis.gyp', chdir=CHDIR) + + # Analysis enabled, should fail. + test.build('analysis.gyp', 'test_analysis_on', chdir=CHDIR, status=1) + + # Analysis not enabled, or unspecified, should pass. + test.build('analysis.gyp', 'test_analysis_off', chdir=CHDIR) + test.build('analysis.gyp', 'test_analysis_unspec', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-buffer-security-check.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-buffer-security-check.py new file mode 100644 index 000000000..e22869c3d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-buffer-security-check.py @@ -0,0 +1,53 @@ +#!/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. + +""" +Make sure buffer security check setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('buffer-security-check.gyp', chdir=CHDIR) + test.build('buffer-security-check.gyp', chdir=CHDIR) + + def GetDisassemblyOfMain(exe): + # The standard library uses buffer security checks independent of our + # buffer security settings, so we extract just our code (i.e. main()) to + # check against. + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/disasm', full_path) + result = [] + in_main = False + for line in output.splitlines(): + if line == '_main:': + in_main = True + elif in_main: + # Disassembly of next function starts. + if line.startswith('_'): + break + result.append(line) + return '\n'.join(result) + + # Buffer security checks are on by default, make sure security_cookie + # appears in the disassembly of our code. + if 'security_cookie' not in GetDisassemblyOfMain('test_bsc_unset.exe'): + test.fail_test() + + # Explicitly on. + if 'security_cookie' not in GetDisassemblyOfMain('test_bsc_on.exe'): + test.fail_test() + + # Explicitly off, shouldn't be a reference to the security cookie. + if 'security_cookie' in GetDisassemblyOfMain('test_bsc_off.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-calling-convention.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-calling-convention.py new file mode 100644 index 000000000..b5fdc4774 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-calling-convention.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure calling convention setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('calling-convention.gyp', chdir=CHDIR) + test.build('calling-convention.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-character-set.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-character-set.py new file mode 100644 index 000000000..7fabb6722 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-character-set.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure character set setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('character-set.gyp', chdir=CHDIR) + test.build('character-set.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-managed.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-managed.py new file mode 100644 index 000000000..0d7b42048 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-managed.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure compile as managed (clr) settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('compile-as-managed.gyp', chdir=CHDIR) + test.build('compile-as-managed.gyp', "test-compile-as-managed", chdir=CHDIR) + # Must fail. + test.build('compile-as-managed.gyp', "test-compile-as-unmanaged", + chdir=CHDIR, status=1) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-winrt.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-winrt.py new file mode 100644 index 000000000..3e0168b67 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-compile-as-winrt.py @@ -0,0 +1,20 @@ +# Copyright (c) 2016 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 TestGyp + +import os +import sys + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2015): + test = TestGyp.TestGyp(formats=['msvs']) + + CHDIR = 'compiler-flags' + + test.run_gyp('compile-as-winrt.gyp', chdir=CHDIR) + + test.build('compile-as-winrt.gyp', 'test-compile-as-winrt', chdir=CHDIR) + + test.pass_test()
\ No newline at end of file diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-debug-format.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-debug-format.py new file mode 100644 index 000000000..6c68a619b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-debug-format.py @@ -0,0 +1,43 @@ +#!/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. + +""" +Make sure debug format settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('debug-format.gyp', chdir=CHDIR) + + # While there's ways to via .pdb contents, the .pdb doesn't include + # which style the debug information was created from, so we resort to just + # verifying the flags are correct on the command line. + + ninja_file = test.built_file_path('obj/test-debug-format-off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/Z7') + test.must_not_contain(ninja_file, '/Zi') + test.must_not_contain(ninja_file, '/ZI') + + ninja_file = test.built_file_path('obj/test-debug-format-oldstyle.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Z7') + + ninja_file = test.built_file_path('obj/test-debug-format-pdb.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Zi') + + ninja_file = test.built_file_path('obj/test-debug-format-editcontinue.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/ZI') + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-default-char-is-unsigned.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-default-char-is-unsigned.py new file mode 100644 index 000000000..d20f6742f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-default-char-is-unsigned.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure DefaultCharIsUnsigned option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('default-char-is-unsigned.gyp', chdir=CHDIR) + test.build('default-char-is-unsigned.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-disable-specific-warnings.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-disable-specific-warnings.py new file mode 100644 index 000000000..cb253aff6 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-disable-specific-warnings.py @@ -0,0 +1,32 @@ +#!/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. + +""" +Make sure disable specific warnings is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('disable-specific-warnings.gyp', chdir=CHDIR) + + # The source file contains a warning, so if WarnAsError is true and + # DisableSpecificWarnings for the warning in question is set, then the build + # should succeed, otherwise it must fail. + + test.build('disable-specific-warnings.gyp', + 'test_disable_specific_warnings_set', + chdir=CHDIR) + test.build('disable-specific-warnings.gyp', + 'test_disable_specific_warnings_unset', + chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py new file mode 100644 index 000000000..78a924aba --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-enable-enhanced-instruction-set.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Test VCCLCompilerTool EnableEnhancedInstructionSet setting. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('enable-enhanced-instruction-set.gyp', chdir=CHDIR) + + test.build('enable-enhanced-instruction-set.gyp', test.ALL, chdir=CHDIR) + + test.run_built_executable('sse_extensions', chdir=CHDIR, + stdout='/arch:SSE\n') + test.run_built_executable('sse2_extensions', chdir=CHDIR, + stdout='/arch:SSE2\n') + + # /arch:AVX introduced in VS2010, but MSBuild support lagged until 2012. + if os.path.exists(test.built_file_path('avx_extensions')): + test.run_built_executable('avx_extensions', chdir=CHDIR, + stdout='/arch:AVX\n') + + # /arch:IA32 introduced in VS2012. + if os.path.exists(test.built_file_path('no_extensions')): + test.run_built_executable('no_extensions', chdir=CHDIR, + stdout='/arch:IA32\n') + + # /arch:AVX2 introduced in VS2013r2. + if os.path.exists(test.built_file_path('avx2_extensions')): + test.run_built_executable('avx2_extensions', chdir=CHDIR, + stdout='/arch:AVX2\n') + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-exception-handling.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-exception-handling.py new file mode 100644 index 000000000..5738a5407 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-exception-handling.py @@ -0,0 +1,33 @@ +#!/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. + +""" +Make sure exception handling settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('exception-handling.gyp', chdir=CHDIR) + + # Must fail. + test.build('exception-handling.gyp', 'test_eh_off', chdir=CHDIR, + status=1) + + # Must succeed. + test.build('exception-handling.gyp', 'test_eh_s', chdir=CHDIR) + test.build('exception-handling.gyp', 'test_eh_a', chdir=CHDIR) + + # Error code must be 1 if EHa, and 2 if EHsc. + test.run_built_executable('test_eh_a', chdir=CHDIR, status=1) + test.run_built_executable('test_eh_s', chdir=CHDIR, status=2) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-floating-point-model.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-floating-point-model.py new file mode 100644 index 000000000..86ff4785a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-floating-point-model.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure floating point model settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('floating-point-model.gyp', chdir=CHDIR) + test.build('floating-point-model.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-force-include-files.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-force-include-files.py new file mode 100644 index 000000000..b73b8bd50 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-force-include-files.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure ForcedIncludeFiles option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('force-include-files.gyp', chdir=CHDIR) + test.build('force-include-files.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-function-level-linking.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-function-level-linking.py new file mode 100644 index 000000000..17c29e235 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-function-level-linking.py @@ -0,0 +1,52 @@ +#!/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. + +""" +Make sure function-level linking setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('function-level-linking.gyp', chdir=CHDIR) + test.build('function-level-linking.gyp', test.ALL, chdir=CHDIR) + + def CheckForSectionString(binary, search_for, should_exist): + output = test.run_dumpbin('/headers', binary) + if should_exist and search_for not in output: + print 'Did not find "%s" in %s' % (search_for, binary) + test.fail_test() + elif not should_exist and search_for in output: + print 'Found "%s" in %s (and shouldn\'t have)' % (search_for, binary) + test.fail_test() + + def Object(proj, obj): + sep = '.' if test.format == 'ninja' else '\\' + return 'obj\\%s%s%s' % (proj, sep, obj) + + look_for = '''COMDAT; sym= "int __cdecl comdat_function''' + + # When function level linking is on, the functions should be listed as + # separate comdat entries. + + CheckForSectionString( + test.built_file_path(Object('test_fll_on', 'function-level-linking.obj'), + chdir=CHDIR), + look_for, + should_exist=True) + + CheckForSectionString( + test.built_file_path(Object('test_fll_off', 'function-level-linking.obj'), + chdir=CHDIR), + look_for, + should_exist=False) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-optimizations.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-optimizations.py new file mode 100644 index 000000000..31341f7dd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-optimizations.py @@ -0,0 +1,105 @@ +#!/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. + +""" +Make sure optimization settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('optimizations.gyp', chdir=CHDIR) + + # It's hard to map flags to output contents in a non-fragile way (especially + # handling both 2008/2010), so just verify the correct ninja command line + # contents. + + ninja_file = test.built_file_path('obj/test_opt_off.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /Od') + + ninja_file = test.built_file_path('obj/test_opt_lev_size.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /O1') + + ninja_file = test.built_file_path('obj/test_opt_lev_speed.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /O2') + + ninja_file = test.built_file_path('obj/test_opt_lev_max.ninja', chdir=CHDIR) + test.must_contain(ninja_file, 'cflags = /Ox') + + ninja_file = test.built_file_path('obj/test_opt_unset.ninja', chdir=CHDIR) + test.must_not_contain(ninja_file, '/Od') + test.must_not_contain(ninja_file, '/O1') + test.must_not_contain(ninja_file, '/Ox') + # Set by default if none specified. + test.must_contain(ninja_file, '/O2') + + ninja_file = test.built_file_path('obj/test_opt_fpo.ninja', chdir=CHDIR) + test.must_contain(ninja_file, '/Oy') + test.must_not_contain(ninja_file, '/Oy-') + + ninja_file = test.built_file_path('obj/test_opt_fpo_off.ninja', chdir=CHDIR) + test.must_contain(ninja_file, '/Oy-') + + ninja_file = test.built_file_path('obj/test_opt_intrinsic.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Oi') + test.must_not_contain(ninja_file, '/Oi-') + + ninja_file = test.built_file_path('obj/test_opt_intrinsic_off.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Oi-') + + ninja_file = test.built_file_path('obj/test_opt_inline_off.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob0') + + ninja_file = test.built_file_path('obj/test_opt_inline_manual.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob1') + + ninja_file = test.built_file_path('obj/test_opt_inline_auto.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ob2') + + ninja_file = test.built_file_path('obj/test_opt_neither.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/Os') + test.must_not_contain(ninja_file, '/Ot') + + ninja_file = test.built_file_path('obj/test_opt_size.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Os') + + ninja_file = test.built_file_path('obj/test_opt_speed.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/Ot') + + ninja_file = test.built_file_path('obj/test_opt_wpo.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GL') + + ninja_file = test.built_file_path('obj/test_opt_sp.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GF') + + ninja_file = test.built_file_path('obj/test_opt_sp_off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/GF') + + ninja_file = test.built_file_path('obj/test_opt_fso.ninja', + chdir=CHDIR) + test.must_contain(ninja_file, '/GT') + + ninja_file = test.built_file_path('obj/test_opt_fso_off.ninja', + chdir=CHDIR) + test.must_not_contain(ninja_file, '/GT') + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname-override.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname-override.py new file mode 100644 index 000000000..da9b49af1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname-override.py @@ -0,0 +1,27 @@ +#!/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. + +""" +Make sure pdb is named as expected (shared between .cc files). +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'compiler-flags' + test.run_gyp('pdbname-override.gyp', chdir=CHDIR) + test.build('pdbname-override.gyp', test.ALL, chdir=CHDIR) + + # Confirm that the pdb generated by the compiler was renamed (and we also + # have the linker generated one). + test.built_file_must_exist('compiler_generated.pdb', chdir=CHDIR) + test.built_file_must_exist('linker_generated.pdb', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname.py new file mode 100644 index 000000000..f09ac233c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-pdbname.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure pdb is named as expected (shared between .cc files). +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('pdbname.gyp', chdir=CHDIR) + test.build('pdbname.gyp', test.ALL, chdir=CHDIR) + + # Confirm that the default behaviour is to name the .pdb per-target (rather + # than per .cc file). + test.built_file_must_exist('obj/test_pdbname.cc.pdb', chdir=CHDIR) + + # Confirm that there should be a .pdb alongside the executable. + test.built_file_must_exist('test_pdbname.exe', chdir=CHDIR) + test.built_file_must_exist('test_pdbname.exe.pdb', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-rtti.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-rtti.py new file mode 100644 index 000000000..d49a09437 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-rtti.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure RTTI setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('rtti.gyp', chdir=CHDIR) + + # Must fail. + test.build('rtti.gyp', 'test_rtti_off', chdir=CHDIR, status=1) + + # Must succeed. + test.build('rtti.gyp', 'test_rtti_on', chdir=CHDIR) + + # Must succeed. + test.build('rtti.gyp', 'test_rtti_unset', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-checks.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-checks.py new file mode 100644 index 000000000..4fd529f89 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-checks.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure RTC setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('runtime-checks.gyp', chdir=CHDIR) + + # Runtime checks disabled, should fail. + test.build('runtime-checks.gyp', 'test_brc_none', chdir=CHDIR, status=1) + + # Runtime checks enabled, should pass. + test.build('runtime-checks.gyp', 'test_brc_1', chdir=CHDIR) + + # TODO(scottmg): There are other less frequently used/partial options, but + # it's not clear how to verify them, so ignore for now. + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-library.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-library.py new file mode 100644 index 000000000..53c149297 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-runtime-library.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure runtime C library setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('runtime-library.gyp', chdir=CHDIR) + test.build('runtime-library.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py new file mode 100644 index 000000000..ca35fb55a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-treat-wchar-t-as-built-in-type.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure TreatWChar_tAsBuiltInType option is functional. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('treat-wchar-t-as-built-in-type.gyp', chdir=CHDIR) + test.build('treat-wchar-t-as-built-in-type.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-as-error.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-as-error.py new file mode 100644 index 000000000..d4ef1b362 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-as-error.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure warning-as-error is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('warning-as-error.gyp', chdir=CHDIR) + + # The source file contains a warning, so if WarnAsError is false (or + # default, which is also false), then the build should succeed, otherwise it + # must fail. + + test.build('warning-as-error.gyp', 'test_warn_as_error_false', chdir=CHDIR) + test.build('warning-as-error.gyp', 'test_warn_as_error_unset', chdir=CHDIR) + test.build('warning-as-error.gyp', 'test_warn_as_error_true', chdir=CHDIR, + status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-level.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-level.py new file mode 100644 index 000000000..62a5b39b6 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-cl-warning-level.py @@ -0,0 +1,41 @@ +#!/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. + +""" +Make sure warning level is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'compiler-flags' + test.run_gyp('warning-level.gyp', chdir=CHDIR) + + # A separate target for each warning level: one pass (compiling a file + # containing a warning that's above the specified level); and one fail + # (compiling a file at the specified level). No pass for 4 of course, + # because it would have to have no warnings. The default warning level is + # equivalent to level 1. + + test.build('warning-level.gyp', 'test_wl1_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl1_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl2_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl2_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl3_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_wl3_pass', chdir=CHDIR) + + test.build('warning-level.gyp', 'test_wl4_fail', chdir=CHDIR, status=1) + + test.build('warning-level.gyp', 'test_def_fail', chdir=CHDIR, status=1) + test.build('warning-level.gyp', 'test_def_pass', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-command-quote.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-command-quote.py new file mode 100644 index 000000000..bd93ac5e9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-command-quote.py @@ -0,0 +1,40 @@ +#!/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. + +""" + +Make sure the program in a command can be a called batch file, or an +application in the path. Specifically, this means not quoting something like +"call x.bat", lest the shell look for a program named "call x.bat", rather +than calling "x.bat". +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'command-quote' + test.run_gyp('command-quote.gyp', chdir=CHDIR) + + test.build('command-quote.gyp', 'test_batch', chdir=CHDIR) + test.build('command-quote.gyp', 'test_call_separate', chdir=CHDIR) + test.build('command-quote.gyp', 'test_with_double_quotes', chdir=CHDIR) + test.build('command-quote.gyp', 'test_with_single_quotes', chdir=CHDIR) + + # We confirm that this fails because other generators don't handle spaces in + # inputs so it's preferable to not have it work here. + test.build('command-quote.gyp', 'test_with_spaces', chdir=CHDIR, status=1) + + CHDIR = 'command-quote/subdir/and/another' + test.run_gyp('in-subdir.gyp', chdir=CHDIR) + test.build('in-subdir.gyp', 'test_batch_depth', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-crosscompile-ar.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-crosscompile-ar.py new file mode 100644 index 000000000..dc75d96a8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-crosscompile-ar.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Copyright 2015 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 ar_host is set correctly when enabling cross-compile on windows. +""" + +import TestGyp + +import sys +import os + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'lib-crosscompile' + oldenv = os.environ.copy() + try: + os.environ['GYP_CROSSCOMPILE'] = '1' + test.run_gyp('use_host_ar.gyp', chdir=CHDIR) + finally: + os.environ.clear() + os.environ.update(oldenv) + + test.build('use_host_ar.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-lib-ltcg.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-lib-ltcg.py new file mode 100644 index 000000000..d1d7bad84 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-lib-ltcg.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure LTCG setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'lib-flags' + test.run_gyp('ltcg.gyp', chdir=CHDIR) + test.build('ltcg.gyp', test.ALL, chdir=CHDIR) + test.must_not_contain_any_line(test.stdout(), ['restarting link with /LTCG']) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-deps.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-deps.py new file mode 100644 index 000000000..62c57366f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-deps.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure additional library dependencies are handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('additional-deps.gyp', chdir=CHDIR) + test.build('additional-deps.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-options.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-options.py new file mode 100644 index 000000000..7e57ae476 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-additional-options.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure additional options are handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('additional-options.gyp', chdir=CHDIR) + test.build('additional-options.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-aslr.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-aslr.py new file mode 100644 index 000000000..e765017d3 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-aslr.py @@ -0,0 +1,35 @@ +#!/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. + +""" +Make sure aslr setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('aslr.gyp', chdir=CHDIR) + test.build('aslr.gyp', test.ALL, chdir=CHDIR) + + def HasDynamicBase(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/headers', full_path) + return ' Dynamic base' in output + + # Default is to be on. + if not HasDynamicBase('test_aslr_default.exe'): + test.fail_test() + if HasDynamicBase('test_aslr_no.exe'): + test.fail_test() + if not HasDynamicBase('test_aslr_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-base-address.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-base-address.py new file mode 100644 index 000000000..d58527ad7 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-base-address.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# Copyright 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. + +""" +Make sure the base address setting is extracted properly. +""" + +import TestGyp + +import re +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('base-address.gyp', chdir=CHDIR) + test.build('base-address.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + return test.run_dumpbin('/headers', full_path) + + # Extract the image base address from the headers output. + image_base_reg_ex = re.compile(r'.*\s+([0-9]+) image base.*', re.DOTALL) + + exe_headers = GetHeaders('test_base_specified_exe.exe') + exe_match = image_base_reg_ex.match(exe_headers) + + if not exe_match or not exe_match.group(1): + test.fail_test() + if exe_match.group(1) != '420000': + test.fail_test() + + dll_headers = GetHeaders('test_base_specified_dll.dll') + dll_match = image_base_reg_ex.match(dll_headers) + + if not dll_match or not dll_match.group(1): + test.fail_test() + if dll_match.group(1) != '10420000': + test.fail_test() + + default_exe_headers = GetHeaders('test_base_default_exe.exe') + default_exe_match = image_base_reg_ex.match(default_exe_headers) + + if not default_exe_match or not default_exe_match.group(1): + test.fail_test() + if default_exe_match.group(1) != '400000': + test.fail_test() + + default_dll_headers = GetHeaders('test_base_default_dll.dll') + default_dll_match = image_base_reg_ex.match(default_dll_headers) + + if not default_dll_match or not default_dll_match.group(1): + test.fail_test() + if default_dll_match.group(1) != '10000000': + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-debug-info.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-debug-info.py new file mode 100644 index 000000000..33e8ac48b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-debug-info.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. + +""" +Make sure debug info setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('debug-info.gyp', chdir=CHDIR) + test.build('debug-info.gyp', test.ALL, chdir=CHDIR) + + suffix = '.exe.pdb' if test.format == 'ninja' else '.pdb' + test.built_file_must_not_exist('test_debug_off%s' % suffix, chdir=CHDIR) + test.built_file_must_exist('test_debug_on%s' % suffix, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-default-libs.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-default-libs.py new file mode 100644 index 000000000..5edf46791 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-default-libs.py @@ -0,0 +1,22 @@ +#!/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. + +""" +Make sure we include the default libs. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('no-default-libs.gyp', chdir=CHDIR) + test.build('no-default-libs.gyp', test.ALL, chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-deffile.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-deffile.py new file mode 100644 index 000000000..94df874f8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-deffile.py @@ -0,0 +1,43 @@ +#!/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. + +""" +Make sure a .def file is handled in the link. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + + # Multiple .def files doesn't make any sense, should fail at generate time. + test.run_gyp('deffile-multiple.gyp', chdir=CHDIR, stderr=None, status=1) + + test.run_gyp('deffile.gyp', chdir=CHDIR) + test.build('deffile.gyp', test.ALL, chdir=CHDIR) + + def HasExport(binary, export): + full_path = test.built_file_path(binary, chdir=CHDIR) + output = test.run_dumpbin('/exports', full_path) + return export in output + + # Make sure we only have the export when the .def file is in use. + + if HasExport('test_deffile_dll_notexported.dll', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + + if HasExport('test_deffile_exe_notexported.exe', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_exe_ok.exe', 'AnExportedFunction'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-defrelink.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-defrelink.py new file mode 100644 index 000000000..cec0ea187 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-defrelink.py @@ -0,0 +1,54 @@ +#!/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. + +""" +Make sure a relink is performed when a .def file is touched. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + target = 'test_deffile_dll_ok' + def_contents = test.read('linker-flags/deffile.def') + + # This first build makes sure everything is up to date. + test.run_gyp('deffile.gyp', chdir=CHDIR) + test.build('deffile.gyp', target, chdir=CHDIR) + test.up_to_date('deffile.gyp', target, chdir=CHDIR) + + def HasExport(binary, export): + full_path = test.built_file_path(binary, chdir=CHDIR) + output = test.run_dumpbin('/exports', full_path) + return export in output + + # Verify that only one function is exported. + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + if HasExport('test_deffile_dll_ok.dll', 'AnotherExportedFunction'): + test.fail_test() + + # Add AnotherExportedFunction to the def file, then rebuild. If it doesn't + # relink the DLL, then the subsequent check for AnotherExportedFunction will + # fail. + new_def_contents = def_contents + "\n AnotherExportedFunction" + test.write('linker-flags/deffile.def', new_def_contents) + test.build('deffile.gyp', target, chdir=CHDIR) + test.up_to_date('deffile.gyp', target, chdir=CHDIR) + + if not HasExport('test_deffile_dll_ok.dll', 'AnExportedFunction'): + test.fail_test() + if not HasExport('test_deffile_dll_ok.dll', 'AnotherExportedFunction'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-delay-load-dlls.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-delay-load-dlls.py new file mode 100644 index 000000000..3880247b4 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-delay-load-dlls.py @@ -0,0 +1,35 @@ +#!/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. + +""" +Make sure delay load setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('delay-load-dlls.gyp', chdir=CHDIR) + test.build('delay-load-dlls.gyp', test.ALL, chdir=CHDIR) + + prefix = 'contains the following delay load imports:' + shell32_look_for = prefix + '\r\n\r\n SHELL32.dll' + + output = test.run_dumpbin( + '/all', test.built_file_path('test_dld_none.exe', chdir=CHDIR)) + if prefix in output: + test.fail_test() + + output = test.run_dumpbin( + '/all', test.built_file_path('test_dld_shell32.exe', chdir=CHDIR)) + if shell32_look_for not in output: + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-embed-manifest.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-embed-manifest.py new file mode 100644 index 000000000..5b9d2c25b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-embed-manifest.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python + +# Copyright (c) 2013 Yandex LLC. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +Make sure manifests are embedded in binaries properly. Handling of +AdditionalManifestFiles is tested too. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('embed-manifest.gyp', chdir=CHDIR) + test.build('embed-manifest.gyp', test.ALL, chdir=CHDIR) + + # The following binaries must contain a manifest embedded. + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_exe.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_exe_inc.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_dll.dll', chdir=CHDIR), 2)) + test.fail_test(not extract_manifest(test.built_file_path( + 'test_manifest_dll_inc.dll', chdir=CHDIR), 2)) + + # Must contain the Win7 support GUID, but not the Vista one (from + # extra2.manifest). + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra1.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' in + extract_manifest(test.built_file_path('test_manifest_extra1.exe', + chdir=CHDIR), 1)) + # Must contain both. + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra2.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' not in + extract_manifest(test.built_file_path('test_manifest_extra2.exe', + chdir=CHDIR), 1)) + + # Same as extra2, but using list syntax instead. + test.fail_test( + '35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in + extract_manifest(test.built_file_path('test_manifest_extra_list.exe', + chdir=CHDIR), 1)) + test.fail_test( + 'e2011457-1546-43c5-a5fe-008deee3d3f0' not in + extract_manifest(test.built_file_path('test_manifest_extra_list.exe', + chdir=CHDIR), 1)) + + # Test that incremental linking doesn't force manifest embedding. + test.fail_test(extract_manifest(test.built_file_path( + 'test_manifest_exe_inc_no_embed.exe', chdir=CHDIR), 1)) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-uac.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-uac.py new file mode 100644 index 000000000..131e07ec1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-uac.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python + +# Copyright 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 that embedding UAC information into the manifest works. +""" + +import TestGyp + +import sys +from xml.dom.minidom import parseString + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('enable-uac.gyp', chdir=CHDIR) + test.build('enable-uac.gyp', test.ALL, chdir=CHDIR) + + # The following binaries must contain a manifest embedded. + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac_no.exe', chdir=CHDIR), 1)) + test.fail_test(not extract_manifest(test.built_file_path( + 'enable_uac_admin.exe', chdir=CHDIR), 1)) + + # Verify that <requestedExecutionLevel level="asInvoker" uiAccess="false" /> + # is present. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 1) + execution_level = execution_level[0].attributes + test.fail_test(not ( + execution_level.has_key('level') and + execution_level.has_key('uiAccess') and + execution_level['level'].nodeValue == 'asInvoker' and + execution_level['uiAccess'].nodeValue == 'false')) + + # Verify that <requestedExecutionLevel> is not in the menifest. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac_no.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 0) + + # Verify that <requestedExecutionLevel level="requireAdministrator" + # uiAccess="true" /> is present. + manifest = parseString(extract_manifest( + test.built_file_path('enable_uac_admin.exe', chdir=CHDIR), 1)) + execution_level = manifest.getElementsByTagName('requestedExecutionLevel') + test.fail_test(len(execution_level) != 1) + execution_level = execution_level[0].attributes + test.fail_test(not ( + execution_level.has_key('level') and + execution_level.has_key('uiAccess') and + execution_level['level'].nodeValue == 'requireAdministrator' and + execution_level['uiAccess'].nodeValue == 'true')) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-app-revision.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-app-revision.py new file mode 100644 index 000000000..e5c5a7133 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-app-revision.py @@ -0,0 +1,41 @@ +#!/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. + +""" +Make sure msvs_application_type_revision works correctly. +""" + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'winrt-app-type-revision' + +print 'This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466' +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2013): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('winrt-app-type-revision.gyp', chdir=CHDIR) + + test.build('winrt-app-type-revision.gyp', 'enable_winrt_81_revision_dll', + chdir=CHDIR) + + # Revision is set to 8.2 which is invalid for 2013 projects so compilation + # must fail. + test.build('winrt-app-type-revision.gyp', 'enable_winrt_82_revision_dll', + chdir=CHDIR, status=1) + + # Revision is set to an invalid value for 2013 projects so compilation + # must fail. + test.build('winrt-app-type-revision.gyp', 'enable_winrt_invalid_revision_dll', + chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py new file mode 100644 index 000000000..cd9244ed0 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt-target-platform-version.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure msvs_target_platform_version works correctly. +""" + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'winrt-target-platform-version' + +print 'This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466' +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2015): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('winrt-target-platform-version.gyp', chdir=CHDIR) + + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_10_platversion_dll', chdir=CHDIR) + + # Target Platform without Minimum Target Platform version defaults to a valid + # Target Platform and compiles. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_10_platversion_nominver_dll', chdir=CHDIR) + + # Target Platform is set to 9.0 which is invalid for 2015 projects so + # compilation must fail. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_9_platversion_dll', chdir=CHDIR, status=1) + + # Missing Target Platform for 2015 projects must fail. + test.build('winrt-target-platform-version.gyp', + 'enable_winrt_missing_platversion_dll', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt.py new file mode 100644 index 000000000..283863ced --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-enable-winrt.py @@ -0,0 +1,35 @@ +#!/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. + +""" +Make sure msvs_enable_winrt works correctly. +""" + +import TestGyp + +import os +import sys +import struct + +CHDIR = 'enable-winrt' + +print 'This test is not currently working on the bots: https://code.google.com/p/gyp/issues/detail?id=466' +sys.exit(0) + +if (sys.platform == 'win32' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) >= 2013): + test = TestGyp.TestGyp(formats=['msvs']) + + test.run_gyp('enable-winrt.gyp', chdir=CHDIR) + + test.build('enable-winrt.gyp', 'enable_winrt_dll', chdir=CHDIR) + + test.build('enable-winrt.gyp', 'enable_winrt_missing_dll', chdir=CHDIR, + status=1) + + test.build('enable-winrt.gyp', 'enable_winrt_winphone_dll', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-entrypointsymbol.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-entrypointsymbol.py new file mode 100644 index 000000000..e88174a08 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-entrypointsymbol.py @@ -0,0 +1,24 @@ +#!/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. + +""" +Make sure entrypointsymbol setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('entrypointsymbol.gyp', chdir=CHDIR) + + test.build('entrypointsymbol.gyp', 'test_ok', chdir=CHDIR) + test.build('entrypointsymbol.gyp', 'test_fail', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-fixed-base.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-fixed-base.py new file mode 100644 index 000000000..725a87028 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-fixed-base.py @@ -0,0 +1,40 @@ +#!/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. + +""" +Make sure fixed base setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('fixed-base.gyp', chdir=CHDIR) + test.build('fixed-base.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + return test.run_dumpbin('/headers', full_path) + + # For exe, default is fixed, for dll, it's not fixed. + if 'Relocations stripped' not in GetHeaders('test_fixed_default_exe.exe'): + test.fail_test() + if 'Relocations stripped' in GetHeaders('test_fixed_default_dll.dll'): + test.fail_test() + + # Explicitly not fixed. + if 'Relocations stripped' in GetHeaders('test_fixed_no.exe'): + test.fail_test() + + # Explicitly fixed. + if 'Relocations stripped' not in GetHeaders('test_fixed_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-force-symbol-reference.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-force-symbol-reference.py new file mode 100644 index 000000000..235e94f71 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-force-symbol-reference.py @@ -0,0 +1,26 @@ +#!/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. + +""" +Make sure ForceSymbolReference is translated properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('force-symbol-reference.gyp', chdir=CHDIR) + test.build('force-symbol-reference.gyp', test.ALL, chdir=CHDIR) + + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_force_reference.exe', chdir=CHDIR)) + if '?x@@YAHXZ:' not in output or '?y@@YAHXZ:' not in output: + test.fail_test() + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-generate-manifest.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-generate-manifest.py new file mode 100644 index 000000000..77c9228ee --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-generate-manifest.py @@ -0,0 +1,127 @@ +#!/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. + +""" +Make sure we generate a manifest file when linking binaries, including +handling AdditionalManifestFiles. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('generate-manifest.gyp', chdir=CHDIR) + test.build('generate-manifest.gyp', test.ALL, chdir=CHDIR) + + # Make sure that generation of .generated.manifest does not cause a relink. + test.run_gyp('generate-manifest.gyp', chdir=CHDIR) + test.up_to_date('generate-manifest.gyp', test.ALL, chdir=CHDIR) + + def test_manifest(filename, generate_manifest, embedded_manifest, + extra_manifest): + exe_file = test.built_file_path(filename, chdir=CHDIR) + if not generate_manifest: + test.must_not_exist(exe_file + '.manifest') + manifest = extract_manifest(exe_file, 1) + test.fail_test(manifest) + return + if embedded_manifest: + manifest = extract_manifest(exe_file, 1) + test.fail_test(not manifest) + else: + test.must_exist(exe_file + '.manifest') + manifest = test.read(exe_file + '.manifest') + test.fail_test(not manifest) + test.fail_test(extract_manifest(exe_file, 1)) + if generate_manifest: + test.must_contain_any_line(manifest, 'requestedExecutionLevel') + if extra_manifest: + test.must_contain_any_line(manifest, + '35138b9a-5d96-4fbd-8e2d-a2440225f93a') + test.must_contain_any_line(manifest, + 'e2011457-1546-43c5-a5fe-008deee3d3f0') + + test_manifest('test_generate_manifest_true.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_false.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_default.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=False) + test_manifest('test_generate_manifest_true_as_embedded.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_false_as_embedded.exe', + generate_manifest=False, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_default_as_embedded.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test_manifest('test_generate_manifest_true_with_extra_manifest.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_false_with_extra_manifest.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_true_with_extra_manifest_list.exe', + generate_manifest=True, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_false_with_extra_manifest_list.exe', + generate_manifest=False, + embedded_manifest=False, + extra_manifest=True) + test_manifest('test_generate_manifest_default_embed_default.exe', + generate_manifest=True, + embedded_manifest=True, + extra_manifest=False) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-incremental.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-incremental.py new file mode 100644 index 000000000..e7184e162 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-incremental.py @@ -0,0 +1,37 @@ +#!/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. + +""" +Make sure incremental linking setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('incremental.gyp', chdir=CHDIR) + test.build('incremental.gyp', test.ALL, chdir=CHDIR) + + def HasILTTables(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/disasm', full_path) + return '@ILT+' in output + + # Default or unset is to be on. + if not HasILTTables('test_incremental_unset.exe'): + test.fail_test() + if not HasILTTables('test_incremental_default.exe'): + test.fail_test() + if HasILTTables('test_incremental_no.exe'): + test.fail_test() + if not HasILTTables('test_incremental_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-address-aware.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-address-aware.py new file mode 100644 index 000000000..ea433f209 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-address-aware.py @@ -0,0 +1,35 @@ +#!/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. + +""" +Make sure largeaddressaware setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('large-address-aware.gyp', chdir=CHDIR) + test.build('large-address-aware.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + + MARKER = 'Application can handle large (>2GB) addresses' + + # Explicitly off. + if MARKER in GetHeaders('test_large_address_aware_no.exe'): + test.fail_test() + + # Explicitly on. + if MARKER not in GetHeaders('test_large_address_aware_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-pdb.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-pdb.py new file mode 100644 index 000000000..4604745d1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-large-pdb.py @@ -0,0 +1,74 @@ +#!/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. + +""" +Make sure msvs_large_pdb works correctly. +""" + +import TestGyp + +import struct +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + +CHDIR = 'large-pdb' + + +def CheckImageAndPdb(test, image_basename, expected_page_size, + pdb_basename=None): + if not pdb_basename: + pdb_basename = image_basename + '.pdb' + test.built_file_must_exist(image_basename, chdir=CHDIR) + test.built_file_must_exist(pdb_basename, chdir=CHDIR) + + # We expect the PDB to have the given page size. For full details of the + # header look here: https://code.google.com/p/pdbparser/wiki/MSF_Format + # We read the little-endian 4-byte unsigned integer at position 32 of the + # file. + pdb_path = test.built_file_path(pdb_basename, chdir=CHDIR) + pdb_file = open(pdb_path, 'rb') + pdb_file.seek(32, 0) + page_size = struct.unpack('<I', pdb_file.read(4))[0] + if page_size != expected_page_size: + print "Expected page size of %d, got %d for PDB file `%s'." % ( + expected_page_size, page_size, pdb_path) + + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + test.run_gyp('large-pdb.gyp', chdir=CHDIR) + + test.build('large-pdb.gyp', 'large_pdb_exe', chdir=CHDIR) + CheckImageAndPdb(test, 'large_pdb_exe.exe', 4096) + + test.build('large-pdb.gyp', 'small_pdb_exe', chdir=CHDIR) + CheckImageAndPdb(test, 'small_pdb_exe.exe', 1024) + + test.build('large-pdb.gyp', 'large_pdb_dll', chdir=CHDIR) + CheckImageAndPdb(test, 'large_pdb_dll.dll', 4096) + + test.build('large-pdb.gyp', 'small_pdb_dll', chdir=CHDIR) + CheckImageAndPdb(test, 'small_pdb_dll.dll', 1024) + + test.build('large-pdb.gyp', 'large_pdb_implicit_exe', chdir=CHDIR) + CheckImageAndPdb(test, 'large_pdb_implicit_exe.exe', 4096) + + # This target has a different PDB name because it uses an + # 'msvs_large_pdb_path' variable. + test.build('large-pdb.gyp', 'large_pdb_variable_exe', chdir=CHDIR) + CheckImageAndPdb(test, 'large_pdb_variable_exe.exe', 4096, + pdb_basename='foo.pdb') + + # This target has a different output name because it uses 'product_name'. + test.build('large-pdb.gyp', 'large_pdb_product_exe', chdir=CHDIR) + CheckImageAndPdb(test, 'bar.exe', 4096) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-adjust.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-adjust.py new file mode 100644 index 000000000..71d1c0936 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-adjust.py @@ -0,0 +1,21 @@ +#!/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. + +""" +Make sure link_settings containing -lblah.lib is remapped to just blah.lib. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('library-adjust.gyp', chdir=CHDIR) + test.build('library-adjust.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-directories.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-directories.py new file mode 100644 index 000000000..8308e14fc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-library-directories.py @@ -0,0 +1,35 @@ +#!/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. + +""" +Make sure libpath is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + + # Build subdirectory library. + test.run_gyp('subdir/library.gyp', chdir=CHDIR) + test.build('subdir/library.gyp', test.ALL, chdir=CHDIR) + + # And then try to link the main project against the library using only + # LIBPATH to find it. + test.run_gyp('library-directories.gyp', chdir=CHDIR) + + # Without additional paths specified, should fail. + test.build('library-directories.gyp', 'test_libdirs_none', chdir=CHDIR, + status=1) + + # With the additional library directory, should pass. + test.build('library-directories.gyp', 'test_libdirs_with', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ltcg.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ltcg.py new file mode 100644 index 000000000..5271e099d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ltcg.py @@ -0,0 +1,44 @@ +#!/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. + +""" +Make sure LTCG is working properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('ltcg.gyp', chdir=CHDIR) + + # Here we expect LTCG is able to inline functions beyond compile unit. + # Note: This marker is embedded in 'inline_test_main.cc' + INLINE_MARKER = '==== inlined ====' + + # link.exe generates following lines when LTCG is enabled. + # Note: Future link.exe may or may not generate them. Update as needed. + LTCG_LINKER_MESSAGES = ['Generating code', 'Finished generating code'] + + # test 'LinkTimeCodeGenerationOptionDefault' + test.build('ltcg.gyp', 'test_ltcg_off', chdir=CHDIR) + test.run_built_executable('test_ltcg_off', chdir=CHDIR) + test.must_not_contain_any_line(test.stdout(), [INLINE_MARKER]) + + # test 'LinkTimeCodeGenerationOptionUse' + test.build('ltcg.gyp', 'test_ltcg_on', chdir=CHDIR) + if test.format == 'ninja': + # Make sure ninja win_tool.py filters out noisy lines. + test.must_not_contain_any_line(test.stdout(), LTCG_LINKER_MESSAGES) + elif test.format == 'msvs': + test.must_contain_any_line(test.stdout(), LTCG_LINKER_MESSAGES) + test.run_built_executable('test_ltcg_on', chdir=CHDIR) + test.must_contain_any_line(test.stdout(), [INLINE_MARKER]) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-mapfile.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-mapfile.py new file mode 100644 index 000000000..00c1dea9e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-mapfile.py @@ -0,0 +1,44 @@ +#!/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. + +""" +Make sure mapfile settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('mapfile.gyp', chdir=CHDIR) + test.build('mapfile.gyp', test.ALL, chdir=CHDIR) + + map_file = test.built_file_path('test_mapfile_unset.map', chdir=CHDIR) + test.must_not_exist(map_file) + + map_file = test.built_file_path('test_mapfile_generate.map', chdir=CHDIR) + test.must_exist(map_file) + test.must_contain(map_file, '?AnExportedFunction@@YAXXZ') + test.must_not_contain(map_file, 'void __cdecl AnExportedFunction(void)') + + map_file = test.built_file_path('test_mapfile_generate_exports.map', + chdir=CHDIR) + test.must_exist(map_file) + test.must_contain(map_file, 'void __cdecl AnExportedFunction(void)') + + map_file = test.built_file_path('test_mapfile_generate_filename.map', + chdir=CHDIR) + test.must_not_exist(map_file) + + map_file = test.built_file_path('custom_file_name.map', chdir=CHDIR) + test.must_exist(map_file) + test.must_contain(map_file, '?AnExportedFunction@@YAXXZ') + test.must_not_contain(map_file, 'void __cdecl AnExportedFunction(void)') + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nodefaultlib.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nodefaultlib.py new file mode 100644 index 000000000..f00760b88 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nodefaultlib.py @@ -0,0 +1,24 @@ +#!/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. + +""" +Make sure nodefaultlib setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('nodefaultlib.gyp', chdir=CHDIR) + + test.build('nodefaultlib.gyp', 'test_ok', chdir=CHDIR) + test.build('nodefaultlib.gyp', 'test_fail', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-noimportlib.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-noimportlib.py new file mode 100644 index 000000000..d12e0ad3e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-noimportlib.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure that the (custom) NoImportLibrary flag is handled correctly. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'importlib' + test.run_gyp('noimplib.gyp', chdir=CHDIR) + test.build('noimplib.gyp', test.ALL, chdir=CHDIR) + + # The target has an entry point, but no exports. Ordinarily, ninja expects + # all DLLs to export some symbols (with the exception of /NOENTRY resource- + # only DLLs). When the NoImportLibrary flag is set, this is suppressed. If + # this is not working correctly, the expected .lib will never be generated + # but will be expected, so the build will not be up to date. + test.up_to_date('noimplib.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nxcompat.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nxcompat.py new file mode 100644 index 000000000..660074397 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-nxcompat.py @@ -0,0 +1,37 @@ +#!/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. + +""" +Make sure nxcompat setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('nxcompat.gyp', chdir=CHDIR) + test.build('nxcompat.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + + # NXCOMPAT is on by default. + if 'NX compatible' not in GetHeaders('test_nxcompat_default.exe'): + test.fail_test() + + # Explicitly off, should not be marked NX compatiable. + if 'NX compatible' in GetHeaders('test_nxcompat_no.exe'): + test.fail_test() + + # Explicitly on. + if 'NX compatible' not in GetHeaders('test_nxcompat_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-icf.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-icf.py new file mode 100644 index 000000000..3c48ef6eb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-icf.py @@ -0,0 +1,41 @@ +#!/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. + +""" +Make sure comdat folding optimization setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('opt-icf.gyp', chdir=CHDIR) + test.build('opt-icf.gyp', chdir=CHDIR) + + # We're specifying /DEBUG so the default is to not merge identical + # functions, so all of the similar_functions should be preserved. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_opticf_default.exe', chdir=CHDIR)) + if output.count('similar_function') != 6: # 3 definitions, 3 calls. + test.fail_test() + + # Explicitly off, all functions preserved seperately. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_opticf_no.exe', chdir=CHDIR)) + if output.count('similar_function') != 6: # 3 definitions, 3 calls. + test.fail_test() + + # Explicitly on, all but one removed. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_opticf_yes.exe', chdir=CHDIR)) + if output.count('similar_function') != 4: # 1 definition, 3 calls. + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-ref.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-ref.py new file mode 100644 index 000000000..586b7afcd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-opt-ref.py @@ -0,0 +1,40 @@ +#!/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. + +""" +Make sure reference optimization setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('opt-ref.gyp', chdir=CHDIR) + test.build('opt-ref.gyp', chdir=CHDIR) + + # We're specifying /DEBUG so the default is to not remove unused functions. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_optref_default.exe', chdir=CHDIR)) + if 'unused_function' not in output: + test.fail_test() + + # Explicitly off, unused_function preserved. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_optref_no.exe', chdir=CHDIR)) + if 'unused_function' not in output: + test.fail_test() + + # Explicitly on, should be removed. + output = test.run_dumpbin( + '/disasm', test.built_file_path('test_optref_yes.exe', chdir=CHDIR)) + if 'unused_function' in output: + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ordering.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ordering.py new file mode 100644 index 000000000..a2527fa3b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-ordering.py @@ -0,0 +1,101 @@ +#!/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. + +""" +Make sure the link order of object files is the same between msvs and ninja. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('link-ordering.gyp', chdir=CHDIR) + test.build('link-ordering.gyp', test.ALL, chdir=CHDIR) + + def GetDisasm(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + # Get disassembly and drop int3 padding between functions. + return '\n'.join( + x for x in test.run_dumpbin('/disasm', full_path).splitlines() + if 'CC' not in x) + + # This is the full dump that we expect. The source files in the .gyp match + # this order which is what determines the ordering in the binary. + + expected_disasm_basic = ''' +_mainCRTStartup: + 00401000: B8 05 00 00 00 mov eax,5 + 00401005: C3 ret +?z@@YAHXZ: + 00401010: B8 03 00 00 00 mov eax,3 + 00401015: C3 ret +?x@@YAHXZ: + 00401020: B8 01 00 00 00 mov eax,1 + 00401025: C3 ret +?y@@YAHXZ: + 00401030: B8 02 00 00 00 mov eax,2 + 00401035: C3 ret +_main: + 00401040: 33 C0 xor eax,eax + 00401042: C3 ret +''' + + if expected_disasm_basic not in GetDisasm('test_ordering_exe.exe'): + print GetDisasm('test_ordering_exe.exe') + test.fail_test() + + # Similar to above. The VS generator handles subdirectories differently. + + expected_disasm_subdirs = ''' +_mainCRTStartup: + 00401000: B8 05 00 00 00 mov eax,5 + 00401005: C3 ret +_main: + 00401010: 33 C0 xor eax,eax + 00401012: C3 ret +?y@@YAHXZ: + 00401020: B8 02 00 00 00 mov eax,2 + 00401025: C3 ret +?z@@YAHXZ: + 00401030: B8 03 00 00 00 mov eax,3 + 00401035: C3 ret +''' + + if expected_disasm_subdirs not in GetDisasm('test_ordering_subdirs.exe'): + print GetDisasm('test_ordering_subdirs.exe') + test.fail_test() + + # Similar, but with directories mixed into folders (crt and main at the same + # level, but with a subdir in the middle). + + expected_disasm_subdirs_mixed = ''' +_mainCRTStartup: + 00401000: B8 05 00 00 00 mov eax,5 + 00401005: C3 ret +?x@@YAHXZ: + 00401010: B8 01 00 00 00 mov eax,1 + 00401015: C3 ret +_main: + 00401020: 33 C0 xor eax,eax + 00401022: C3 ret +?z@@YAHXZ: + 00401030: B8 03 00 00 00 mov eax,3 + 00401035: C3 ret +?y@@YAHXZ: + 00401040: B8 02 00 00 00 mov eax,2 + 00401045: C3 ret +''' + + if (expected_disasm_subdirs_mixed not in + GetDisasm('test_ordering_subdirs_mixed.exe')): + print GetDisasm('test_ordering_subdirs_mixed.exe') + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-outputfile.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-outputfile.py new file mode 100644 index 000000000..b98cdff0f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-outputfile.py @@ -0,0 +1,28 @@ +#!/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. + +""" +Make sure linker OutputFile setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('outputfile.gyp', chdir=CHDIR) + test.build('outputfile.gyp', test.ALL, chdir=CHDIR) + + test.built_file_must_exist('blorp.exe', chdir=CHDIR) + test.built_file_must_exist('blorp.dll', chdir=CHDIR) + test.built_file_must_exist('subdir/blorp.exe', chdir=CHDIR) + test.built_file_must_exist('blorp.lib', chdir=CHDIR) + test.built_file_must_exist('subdir/blorp.lib', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-no-output.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-no-output.py new file mode 100644 index 000000000..6da0aeae9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-no-output.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Ensure that when debug information is not output, a pdb is not expected. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + CHDIR = 'linker-flags' + test.run_gyp('pdb-output.gyp', chdir=CHDIR) + test.build('pdb-output.gyp', 'test_pdb_output_disabled', chdir=CHDIR) + # Make sure that the build doesn't expect a PDB to be generated when there + # will be none. + test.up_to_date('pdb-output.gyp', 'test_pdb_output_disabled', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-output.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-output.py new file mode 100644 index 000000000..27245f7ec --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb-output.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Ensure that ninja includes the .pdb as an output file from linking. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + CHDIR = 'linker-flags' + test.run_gyp('pdb-output.gyp', chdir=CHDIR) + # Note, building the pdbs rather than ALL or gyp target. + test.build('pdb-output.gyp', 'output_exe.pdb', chdir=CHDIR) + test.build('pdb-output.gyp', 'output_dll.pdb', chdir=CHDIR) + + def FindFile(pdb): + full_path = test.built_file_path(pdb, chdir=CHDIR) + return os.path.isfile(full_path) + + if not FindFile('output_exe.pdb'): + test.fail_test() + if not FindFile('output_dll.pdb'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb.py new file mode 100644 index 000000000..26d744d0b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pdb.py @@ -0,0 +1,35 @@ +#!/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 the 'ProgramDatabaseFile' attribute in VCLinker is extracted +properly. +""" + +import TestGyp + +import os +import sys + + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('program-database.gyp', chdir=CHDIR) + test.build('program-database.gyp', test.ALL, chdir=CHDIR) + + def FindFile(pdb): + full_path = test.built_file_path(pdb, chdir=CHDIR) + return os.path.isfile(full_path) + + # Verify the specified PDB is created when ProgramDatabaseFile + # is provided. + if not FindFile('name_outdir.pdb'): + test.fail_test() + if not FindFile('name_proddir.pdb'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pgo.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pgo.py new file mode 100644 index 000000000..d742047ac --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-pgo.py @@ -0,0 +1,75 @@ +#!/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. + +""" +Make sure PGO is working properly. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('pgo.gyp', chdir=CHDIR) + + def IsPGOAvailable(): + """Returns true if the Visual Studio available here supports PGO.""" + test.build('pgo.gyp', 'gen_linker_option', chdir=CHDIR) + tmpfile = test.read(test.built_file_path('linker_options.txt', chdir=CHDIR)) + return any(line.find('PGOPTIMIZE') for line in tmpfile) + + # Test generated build files look fine. + if test.format == 'ninja': + ninja = test.built_file_path('obj/test_pgo_instrument.ninja', chdir=CHDIR) + test.must_contain(ninja, '/LTCG:PGINSTRUMENT') + test.must_contain(ninja, 'test_pgo.pgd') + ninja = test.built_file_path('obj/test_pgo_optimize.ninja', chdir=CHDIR) + test.must_contain(ninja, '/LTCG:PGOPTIMIZE') + test.must_contain(ninja, 'test_pgo.pgd') + ninja = test.built_file_path('obj/test_pgo_update.ninja', chdir=CHDIR) + test.must_contain(ninja, '/LTCG:PGUPDATE') + test.must_contain(ninja, 'test_pgo.pgd') + elif test.format == 'msvs': + LTCG_FORMAT = '<LinkTimeCodeGeneration>%s</LinkTimeCodeGeneration>' + vcproj = test.workpath('linker-flags/test_pgo_instrument.vcxproj') + test.must_contain(vcproj, LTCG_FORMAT % 'PGInstrument') + test.must_contain(vcproj, 'test_pgo.pgd') + vcproj = test.workpath('linker-flags/test_pgo_optimize.vcxproj') + test.must_contain(vcproj, LTCG_FORMAT % 'PGOptimization') + test.must_contain(vcproj, 'test_pgo.pgd') + vcproj = test.workpath('linker-flags/test_pgo_update.vcxproj') + test.must_contain(vcproj, LTCG_FORMAT % 'PGUpdate') + test.must_contain(vcproj, 'test_pgo.pgd') + + # When PGO is available, try building binaries with PGO. + if IsPGOAvailable(): + pgd_path = test.built_file_path('test_pgo.pgd', chdir=CHDIR) + + # Test if 'PGInstrument' generates PGD (Profile-Guided Database) file. + if os.path.exists(pgd_path): + test.unlink(pgd_path) + test.must_not_exist(pgd_path) + test.build('pgo.gyp', 'test_pgo_instrument', chdir=CHDIR) + test.must_exist(pgd_path) + + # Test if 'PGOptimize' works well + test.build('pgo.gyp', 'test_pgo_optimize', chdir=CHDIR) + test.must_contain_any_line(test.stdout(), ['profiled functions']) + + # Test if 'PGUpdate' works well + test.build('pgo.gyp', 'test_pgo_update', chdir=CHDIR) + # With 'PGUpdate', linker should not complain that sources are changed after + # the previous training run. + test.touch(test.workpath('linker-flags/inline_test_main.cc')) + test.unlink(test.built_file_path('test_pgo_update.exe', chdir=CHDIR)) + test.build('pgo.gyp', 'test_pgo_update', chdir=CHDIR) + test.must_contain_any_line(test.stdout(), ['profiled functions']) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-profile.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-profile.py new file mode 100644 index 000000000..4dbc9ae4c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-profile.py @@ -0,0 +1,37 @@ +#!/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 the 'Profile' attribute in VCLinker is extracted properly. +""" + +import TestGyp + +import os +import sys + + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + CHDIR = 'linker-flags' + test.run_gyp('profile.gyp', chdir=CHDIR) + test.build('profile.gyp', test.ALL, chdir=CHDIR) + + def GetSummary(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + return test.run_dumpbin(full_path) + + # '.idata' section will be missing when /PROFILE is enabled. + if '.idata' in GetSummary('test_profile_true.exe'): + test.fail_test() + + if not '.idata' in GetSummary('test_profile_false.exe'): + test.fail_test() + + if not '.idata' in GetSummary('test_profile_default.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-restat-importlib.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-restat-importlib.py new file mode 100644 index 000000000..76b5c3cdb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-restat-importlib.py @@ -0,0 +1,45 @@ +#!/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. + +""" +Make sure we don't cause unnecessary builds due to import libs appearing +to be out of date. +""" + +import TestGyp + +import os +import sys +import time + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + if not os.environ.get('ProgramFiles(x86)'): + # TODO(scottmg) + print 'Skipping test on x86, http://crbug.com/365833' + test.pass_test() + + CHDIR = 'importlib' + test.run_gyp('importlib.gyp', chdir=CHDIR) + test.build('importlib.gyp', test.ALL, chdir=CHDIR) + + # Delay briefly so that there's time for this touch not to have the + # timestamp as the previous run. + test.sleep() + + # Touch the .cc file; the .dll will rebuild, but the import libs timestamp + # won't be updated. + test.touch('importlib/has-exports.cc') + test.build('importlib.gyp', 'test_importlib', chdir=CHDIR) + + # This is the important part. The .dll above will relink and have an updated + # timestamp, however the import .libs timestamp won't be updated. So, we + # have to handle restating inputs in ninja so the final binary doesn't + # continually relink (due to thinking the .lib isn't up to date). + test.up_to_date('importlib.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-safeseh.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-safeseh.py new file mode 100644 index 000000000..31a25673f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-safeseh.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure safeseh setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp() + + CHDIR = 'linker-flags' + test.run_gyp('safeseh.gyp', chdir=CHDIR) + test.build('safeseh.gyp', test.ALL, chdir=CHDIR) + + def HasSafeExceptionHandlers(exe): + full_path = test.built_file_path(exe, chdir=CHDIR) + output = test.run_dumpbin('/LOADCONFIG', full_path) + return ' Safe Exception Handler Table' in output + + # From MSDN: http://msdn.microsoft.com/en-us/library/9a89h429.aspx + # If /SAFESEH is not specified, the linker will produce an image with a + # table of safe exceptions handlers if all modules are compatible with + # the safe exception handling feature. If any modules were not + # compatible with safe exception handling feature, the resulting image + # will not contain a table of safe exception handlers. + # However, the msvs IDE passes /SAFESEH to the linker by default, if + # ImageHasSafeExceptionHandlers is not set to false in the vcxproj file. + # We emulate this behavior in msvs_emulation.py, so 'test_safeseh_default' + # and 'test_safeseh_yes' are built identically. + if not HasSafeExceptionHandlers('test_safeseh_default.exe'): + test.fail_test() + if HasSafeExceptionHandlers('test_safeseh_no.exe'): + test.fail_test() + if not HasSafeExceptionHandlers('test_safeseh_yes.exe'): + test.fail_test() + if HasSafeExceptionHandlers('test_safeseh_x64.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-shard.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-shard.py new file mode 100644 index 000000000..9af93284a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-shard.py @@ -0,0 +1,30 @@ +#!/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. + +""" +Make sure msvs_shard works correctly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'shard' + test.run_gyp('shard.gyp', chdir=CHDIR) + test.build('shard.gyp', test.ALL, chdir=CHDIR) + + test.built_file_must_exist('shard_0.lib', chdir=CHDIR) + test.built_file_must_exist('shard_1.lib', chdir=CHDIR) + test.built_file_must_exist('shard_2.lib', chdir=CHDIR) + test.built_file_must_exist('shard_3.lib', chdir=CHDIR) + + test.run_gyp('shard_ref.gyp', chdir=CHDIR) + test.build('shard_ref.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-stacksize.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-stacksize.py new file mode 100644 index 000000000..2e952d2c7 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-stacksize.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure StackReserveSize and StackCommitSize settings are extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('stacksize.gyp', chdir=CHDIR) + test.build('stacksize.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + + # Verify default sizes as reported by dumpbin: + # 100000h = 1MB + # 1000h = 4KB + default_headers = GetHeaders('test_default.exe') + if '100000 size of stack reserve' not in default_headers: + test.fail_test() + if '1000 size of stack commit' not in default_headers: + test.fail_test() + + # Verify that reserved size is changed, but commit size is unchanged: + # 200000h = 2MB + # 1000h = 4KB + set_reserved_size_headers = GetHeaders('test_set_reserved_size.exe') + if '200000 size of stack reserve' not in set_reserved_size_headers: + test.fail_test() + if '1000 size of stack commit' not in set_reserved_size_headers: + test.fail_test() + + # Verify that setting the commit size, without the reserve size, has no + # effect: + # 100000h = 1MB + # 1000h = 4KB + set_commit_size_headers = GetHeaders('test_set_commit_size.exe') + if '100000 size of stack reserve' not in set_commit_size_headers: + test.fail_test() + if '1000 size of stack commit' not in set_commit_size_headers: + test.fail_test() + + # Verify that setting both works: + # 200000h = 2MB + # 2000h = 8KB + set_both_headers = GetHeaders('test_set_both.exe') + if '200000 size of stack reserve' not in set_both_headers: + test.fail_test() + if '2000 size of stack commit' not in set_both_headers: + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-subsystem.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-subsystem.py new file mode 100644 index 000000000..a94ba3685 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-subsystem.py @@ -0,0 +1,38 @@ +#!/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. + +""" +Make sure subsystem setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('subsystem.gyp', chdir=CHDIR) + + test.build('subsystem.gyp', 'test_console_ok', chdir=CHDIR) + test.build('subsystem.gyp', 'test_console_fail', chdir=CHDIR, status=1) + test.build('subsystem.gyp', 'test_windows_ok', chdir=CHDIR) + test.build('subsystem.gyp', 'test_windows_fail', chdir=CHDIR, status=1) + + test.build('subsystem.gyp', 'test_console_xp', chdir=CHDIR) + test.build('subsystem.gyp', 'test_windows_xp', chdir=CHDIR) + # Make sure we are targeting XP. + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + if '5.01 subsystem version' not in GetHeaders('test_console_xp.exe'): + test.fail_test() + if '5.01 subsystem version' not in GetHeaders('test_windows_xp.exe'): + test.fail_test() + + # TODO(scottmg): There are other subsystems (WinCE, etc.) that we don't use. + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-target-machine.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-target-machine.py new file mode 100644 index 000000000..5a15f3f4d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-target-machine.py @@ -0,0 +1,28 @@ +#!/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. + +""" +Make sure TargetMachine setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('target-machine.gyp', chdir=CHDIR) + # The .cc file is compiled as x86 (the default), so the link/libs that are + # x64 need to fail. + test.build('target-machine.gyp', 'test_target_link_x86', chdir=CHDIR) + test.build( + 'target-machine.gyp', 'test_target_link_x64', chdir=CHDIR, status=1) + test.build('target-machine.gyp', 'test_target_lib_x86', chdir=CHDIR) + test.build('target-machine.gyp', 'test_target_lib_x64', chdir=CHDIR, status=1) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-tsaware.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-tsaware.py new file mode 100644 index 000000000..d34b3c24a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-tsaware.py @@ -0,0 +1,33 @@ +#!/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. + +""" +Make sure tsaware setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('tsaware.gyp', chdir=CHDIR) + test.build('tsaware.gyp', test.ALL, chdir=CHDIR) + + def GetHeaders(exe): + return test.run_dumpbin('/headers', test.built_file_path(exe, chdir=CHDIR)) + + # Explicitly off, should not be marked NX compatiable. + if 'Terminal Server Aware' in GetHeaders('test_tsaware_no.exe'): + test.fail_test() + + # Explicitly on. + if 'Terminal Server Aware' not in GetHeaders('test_tsaware_yes.exe'): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi-depending-on-module.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi-depending-on-module.py new file mode 100644 index 000000000..75c9503dc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi-depending-on-module.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +# Copyright (c) 2015 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. + +""" +Make sure that when ULDI is on, we link cause downstream modules to get built +when we depend on the component objs. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'uldi' + test.run_gyp('uldi-depending-on-module.gyp', chdir=CHDIR) + test.build('uldi-depending-on-module.gyp', 'an_exe', chdir=CHDIR) + test.built_file_must_exist('a_module.dll', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi.py new file mode 100644 index 000000000..62c5892c5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-uldi.py @@ -0,0 +1,28 @@ +#!/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. + +""" +Make sure that when ULDI is on, we link .objs that make up .libs rather than +the .libs themselves. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'uldi' + test.run_gyp('uldi.gyp', chdir=CHDIR) + # When linking with ULDI, the duplicated function from the lib will be an + # error. + test.build('uldi.gyp', 'final_uldi', chdir=CHDIR, status=1) + # And when in libs, the duplicated function will be silently dropped, so the + # build succeeds. + test.build('uldi.gyp', 'final_no_uldi', chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-unsupported-manifest.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-unsupported-manifest.py new file mode 100644 index 000000000..8f7e12bc8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-unsupported-manifest.py @@ -0,0 +1,27 @@ +#!/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. + +""" +Make sure we error out if #pragma comments are used to modify manifests. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + # This assertion only applies to the ninja build. + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('unsupported-manifest.gyp', chdir=CHDIR) + + # Just needs to fail to build. + test.build('unsupported-manifest.gyp', + 'test_unsupported', chdir=CHDIR, status=1) + test.must_not_exist(test.built_file_path('test_unsupported.exe', chdir=CHDIR)) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-update-manifest.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-update-manifest.py new file mode 100644 index 000000000..4f8b2b911 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-update-manifest.py @@ -0,0 +1,103 @@ +#!/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. + +""" +Make sure binary is relinked when manifest settings are changed. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + import pywintypes + import win32api + import winerror + + RT_MANIFEST = 24 + + class LoadLibrary(object): + """Context manager for loading and releasing binaries in Windows. + Yields the handle of the binary loaded.""" + def __init__(self, path): + self._path = path + self._handle = None + + def __enter__(self): + self._handle = win32api.LoadLibrary(self._path) + return self._handle + + def __exit__(self, type, value, traceback): + win32api.FreeLibrary(self._handle) + + def extract_manifest(path, resource_name): + """Reads manifest from |path| and returns it as a string. + Returns None is there is no such manifest.""" + with LoadLibrary(path) as handle: + try: + return win32api.LoadResource(handle, RT_MANIFEST, resource_name) + except pywintypes.error as error: + if error.args[0] == winerror.ERROR_RESOURCE_DATA_NOT_FOUND: + return None + else: + raise + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + + gyp_template = ''' +{ + 'targets': [ + { + 'target_name': 'test_update_manifest', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'UACExecutionLevel': '%(uac_execution_level)d', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': '%(additional_manifest_files)s', + }, + }, + }, + ], +} +''' + + gypfile = 'update-manifest.gyp' + + def WriteAndUpdate(uac_execution_level, additional_manifest_files, do_build): + with open(os.path.join(CHDIR, gypfile), 'wb') as f: + f.write(gyp_template % { + 'uac_execution_level': uac_execution_level, + 'additional_manifest_files': additional_manifest_files, + }) + test.run_gyp(gypfile, chdir=CHDIR) + if do_build: + test.build(gypfile, chdir=CHDIR) + exe_file = test.built_file_path('test_update_manifest.exe', chdir=CHDIR) + return extract_manifest(exe_file, 1) + + manifest = WriteAndUpdate(0, '', True) + test.fail_test('asInvoker' not in manifest) + test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' in manifest) + + # Make sure that updating .gyp and regenerating doesn't cause a rebuild. + WriteAndUpdate(0, '', False) + test.up_to_date(gypfile, test.ALL, chdir=CHDIR) + + # But make sure that changing a manifest property does cause a relink. + manifest = WriteAndUpdate(2, '', True) + test.fail_test('requireAdministrator' not in manifest) + + # Adding a manifest causes a rebuild. + manifest = WriteAndUpdate(2, 'extra.manifest', True) + test.fail_test('35138b9a-5d96-4fbd-8e2d-a2440225f93a' not in manifest) diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-warnings-as-errors.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-warnings-as-errors.py new file mode 100644 index 000000000..d6a64736f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-link-warnings-as-errors.py @@ -0,0 +1,24 @@ +#!/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. + +""" +Make sure linker warnings-as-errors setting is extracted properly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'linker-flags' + test.run_gyp('warn-as-error.gyp', chdir=CHDIR) + + test.build('warn-as-error.gyp', 'test_on', chdir=CHDIR, status=1) + test.build('warn-as-error.gyp', 'test_off', chdir=CHDIR) + test.build('warn-as-error.gyp', 'test_default', chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-long-command-line.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-long-command-line.py new file mode 100644 index 000000000..8f8b7a3bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-long-command-line.py @@ -0,0 +1,23 @@ +#!/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. + +""" +Make sure long command lines work. +""" + +import TestGyp + +import subprocess +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja', 'msvs']) + + CHDIR = 'long-command-line' + test.run_gyp('long-command-line.gyp', chdir=CHDIR) + test.build('long-command-line.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-projectname.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-projectname.py new file mode 100644 index 000000000..e411cc04a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-projectname.py @@ -0,0 +1,24 @@ +#!/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. + +""" +Make sure macro expansion of $(ProjectName) is handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('projectname.gyp', chdir=CHDIR) + test.build('projectname.gyp', test.ALL, chdir=CHDIR) + test.built_file_must_exist('test_expansions_plus_something.exe', chdir=CHDIR) + test.built_file_must_exist( + 'test_with_product_name_plus_something.exe', chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetext.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetext.py new file mode 100644 index 000000000..450710d63 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetext.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure macro expansion of $(TargetExt) is handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('targetext.gyp', chdir=CHDIR) + test.build('targetext.gyp', test.ALL, chdir=CHDIR) + test.built_file_must_exist('executable.exe', chdir=CHDIR) + test.built_file_must_exist('loadable_module.dll', chdir=CHDIR) + test.built_file_must_exist('shared_library.dll', chdir=CHDIR) + test.built_file_must_exist('static_library.lib', chdir=CHDIR) + test.built_file_must_exist('product_extension.library', chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetfilename.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetfilename.py new file mode 100644 index 000000000..be4b637e9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetfilename.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure macro expansion of $(TargetFileName) is handled. +""" + +import TestGyp + +import os +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + if not (test.format == 'msvs' and + int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2013): + CHDIR = 'vs-macros' + test.run_gyp('targetfilename.gyp', chdir=CHDIR) + test.build('targetfilename.gyp', test.ALL, chdir=CHDIR) + test.built_file_must_exist('test_targetfilename_executable.exe', chdir=CHDIR) + test.built_file_must_exist('test_targetfilename_loadable_module.dll', + chdir=CHDIR) + test.built_file_must_exist('test_targetfilename_shared_library.dll', + chdir=CHDIR) + test.built_file_must_exist('test_targetfilename_static_library.lib', + chdir=CHDIR) + test.built_file_must_exist('test_targetfilename_product_extension.foo', + chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetname.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetname.py new file mode 100644 index 000000000..b1118019a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetname.py @@ -0,0 +1,29 @@ +#!/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. + +""" +Make sure macro expansion of $(TargetName) and $(TargetDir) are handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('targetname.gyp', chdir=CHDIR) + test.build('targetname.gyp', test.ALL, chdir=CHDIR) + test.built_file_must_exist('test_targetname_plus_something1.exe', + chdir=CHDIR) + test.built_file_must_exist( + 'prod_prefixtest_targetname_with_prefix_plus_something2.exe', + chdir=CHDIR) + test.built_file_must_exist('prod_name_plus_something3.exe', chdir=CHDIR) + test.built_file_must_exist('prod_prefixprod_name_plus_something4.exe', + chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetpath.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetpath.py new file mode 100644 index 000000000..fe7eac183 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-targetpath.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure macro expansion of $(TargetPath) is handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('targetpath.gyp', chdir=CHDIR) + test.build('targetpath.gyp', test.ALL, chdir=CHDIR) + test.built_file_must_exist('test_targetpath_executable.exe', chdir=CHDIR) + test.built_file_must_exist('test_targetpath_loadable_module.dll', + chdir=CHDIR) + test.built_file_must_exist('test_targetpath_shared_library.dll', + chdir=CHDIR) + test.built_file_must_exist('test_targetpath_static_library.lib', + chdir=CHDIR) + test.built_file_must_exist('test_targetpath_product_extension.foo', + chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-vcinstalldir.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-vcinstalldir.py new file mode 100644 index 000000000..37396e161 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macro-vcinstalldir.py @@ -0,0 +1,24 @@ +#!/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. + +""" +Make sure macro expansion of $(VCInstallDir) is handled, and specifically +always / terminated for compatibility. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('vcinstalldir.gyp', chdir=CHDIR) + # This fails on VS because the trailing slash escapes the trailing quote. + test.build('vcinstalldir.gyp', 'test_slash_trailing', chdir=CHDIR, status=1) + test.build('vcinstalldir.gyp', 'test_slash_dir', chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-containing-gyp.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-containing-gyp.py new file mode 100644 index 000000000..f6eaf63db --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-containing-gyp.py @@ -0,0 +1,21 @@ +#!/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. + +""" +Handle VS macro expansion containing gyp variables. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('containing-gyp.gyp', chdir=CHDIR) + test.build('containing-gyp.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py new file mode 100644 index 000000000..3d6fa74e4 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-macros-in-inputs-and-outputs.py @@ -0,0 +1,27 @@ +#!/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. + +""" +Handle macro expansion in inputs and outputs of rules. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'vs-macros' + test.run_gyp('input-output-macros.gyp', chdir=CHDIR) + + test.build('input-output-macros.gyp', 'test_expansions', chdir=CHDIR) + + test.built_file_must_exist('stuff.blah.something', + content='Random data file.\nModified.', + chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-excluded.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-excluded.py new file mode 100644 index 000000000..70059ab64 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-excluded.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Test that .idl files in actions and non-native rules are excluded. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'idl-excluded' + test.run_gyp('idl-excluded.gyp', chdir=CHDIR) + test.build('idl-excluded.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-includedirs.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-includedirs.py new file mode 100644 index 000000000..05f637040 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-includedirs.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Verify that 'midl_include_dirs' is handled. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'idl-includedirs' + test.run_gyp('idl-includedirs.gyp', chdir=CHDIR) + test.build('idl-includedirs.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-rules.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-rules.py new file mode 100644 index 000000000..591a50732 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-midl-rules.py @@ -0,0 +1,28 @@ +#!/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. + +""" +Handle default .idl build rules. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'idl-rules' + test.run_gyp('basic-idl.gyp', chdir=CHDIR) + for platform in ['Win32', 'x64']: + test.set_configuration('Debug|%s' % platform) + test.build('basic-idl.gyp', test.ALL, chdir=CHDIR) + + # Make sure ninja win_tool.py filters out noisy lines. + if test.format == 'ninja' and 'Processing' in test.stdout(): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-ml-safeseh.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-ml-safeseh.py new file mode 100644 index 000000000..ec702b9df --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-ml-safeseh.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure the /safeseh option can be passed to ml. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + CHDIR = 'ml-safeseh' + test.run_gyp('ml-safeseh.gyp', chdir=CHDIR) + test.build('ml-safeseh.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-quoting-commands.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-quoting-commands.py new file mode 100644 index 000000000..b40f99f08 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-quoting-commands.py @@ -0,0 +1,25 @@ +#!/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. + +""" +Make sure batch files run as actions. Regression test for previously missing +trailing quote on command line. cmd typically will implicitly insert a missing +quote, but if the command ends in a quote, it will not insert another, so the +command can sometimes become unterminated. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'batch-file-action' + test.run_gyp('batch-file-action.gyp', chdir=CHDIR) + test.build('batch-file-action.gyp', test.ALL, chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-rc-build.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-rc-build.py new file mode 100644 index 000000000..a6e4d360f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-rc-build.py @@ -0,0 +1,27 @@ +#!/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. + +""" +Make sure we build and include .rc files. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + print "This test is currently disabled: https://crbug.com/483696." + sys.exit(0) + + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'rc-build' + test.run_gyp('hello.gyp', chdir=CHDIR) + test.build('hello.gyp', test.ALL, chdir=CHDIR) + test.up_to_date('hello.gyp', 'resource_only_dll', chdir=CHDIR) + test.run_built_executable('with_resources', chdir=CHDIR, status=4) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-sys.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-sys.py new file mode 100644 index 000000000..b38e947bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-sys.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +# Copyright (c) 2016 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 Windows drivers are built correctly. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs']) + + CHDIR = 'win-driver-target-type' + test.run_gyp('win-driver-target-type.gyp', chdir=CHDIR) + test.build('win-driver-target-type.gyp', 'win_driver_target_type', + chdir=CHDIR) + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-system-include.py b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-system-include.py new file mode 100644 index 000000000..9a47d9853 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/gyptest-system-include.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Checks that msvs_system_include_dirs works. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja']) + + CHDIR = 'system-include' + test.run_gyp('test.gyp', chdir=CHDIR) + test.build('test.gyp', test.ALL, chdir=CHDIR) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/bad.idl b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/bad.idl new file mode 100644 index 000000000..38554e963 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/bad.idl @@ -0,0 +1,6 @@ +// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +This is a dummy .idl file that will trigger an error if it is not excluded from +the build. diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/copy-file.py b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/copy-file.py new file mode 100644 index 000000000..5a5feae1f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/copy-file.py @@ -0,0 +1,11 @@ +#!/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. +import sys + +contents = open(sys.argv[1], 'r').read() +open(sys.argv[2], 'wb').write(contents) + +sys.exit(0) diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/idl-excluded.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/idl-excluded.gyp new file mode 100644 index 000000000..972b7deda --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/idl-excluded.gyp @@ -0,0 +1,58 @@ +# Copyright (c) 2014 The Chromium Authors. 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': 'exclude_with_action', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'actions': [{ + 'action_name': 'copy_action', + 'inputs': [ + 'copy-file.py', + 'bad.idl', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/bad.idl', + ], + 'action': [ + 'python', '<@(_inputs)', '<@(_outputs)', + ], + }], + }, + { + 'target_name': 'exclude_with_rule', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'sources': [ + 'bad.idl', + ], + 'rules': [{ + 'rule_name': 'copy_rule', + 'extension': 'idl', + 'inputs': [ + 'copy-file.py', + ], + 'outputs': [ + '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).idl', + ], + 'action': [ + 'python', '<@(_inputs)', '<(RULE_INPUT_PATH)', '<@(_outputs)', + ], + }], + }, + { + 'target_name': 'program', + 'type': 'executable', + 'sources': [ + 'program.cc', + ], + 'dependencies': [ + 'exclude_with_action', + 'exclude_with_rule', + ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/program.cc b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/program.cc new file mode 100644 index 000000000..9dc3c94f3 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-excluded/program.cc @@ -0,0 +1,7 @@ +// Copyright (c) 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/hello.cc new file mode 100644 index 000000000..9dc3c94f3 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/hello.cc @@ -0,0 +1,7 @@ +// Copyright (c) 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/idl-includedirs.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/idl-includedirs.gyp new file mode 100644 index 000000000..fcec063a9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/idl-includedirs.gyp @@ -0,0 +1,26 @@ +# Copyright (c) 2014 The Chromium Authors. 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': 'test_midl_include_dirs', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'subdir/foo.idl', + 'subdir/bar.idl', + ], + 'midl_include_dirs': [ + 'subdir', + ], + 'msvs_settings': { + 'VCMIDLTool': { + 'OutputDirectory': '<(INTERMEDIATE_DIR)', + 'DLLDataFileName': '$(InputName)_dlldata.h', + }, + }, + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/bar.idl b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/bar.idl new file mode 100644 index 000000000..d4e6cbb3e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/bar.idl @@ -0,0 +1,13 @@ +// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import "oaidl.idl"; + +[ + object, + uuid(A03D1421-B1EC-11D0-8C3A-00C04FC31D3F), +] +interface Bar : IUnknown { + HRESULT BarFunction(); +}; diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/foo.idl b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/foo.idl new file mode 100644 index 000000000..c8c65b9be --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-includedirs/subdir/foo.idl @@ -0,0 +1,14 @@ +// Copyright (c) 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import "oaidl.idl"; +import "bar.idl"; + +[ + object, + uuid(9C1100DD-51D4-4827-AE9F-3B8FAC4AED72), +] +interface Foo : IUnknown { + HRESULT FooFunction(Bar* bar); +}; diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/Window.idl b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/Window.idl new file mode 100644 index 000000000..d8ea01bee --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/Window.idl @@ -0,0 +1,9 @@ +// Copyright (c) 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. + +[ + WillBeGarbageCollected, +] interface Window { + void alert(); +}; diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/basic-idl.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/basic-idl.gyp new file mode 100644 index 000000000..b74622ade --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/basic-idl.gyp @@ -0,0 +1,67 @@ +# Copyright (c) 2012 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'variables': { + 'midl_out_dir': '<(SHARED_INTERMEDIATE_DIR)', + }, + 'target_defaults': { + 'configurations': { + 'Debug': { + 'msvs_configuration_platform': 'Win32', + }, + 'Debug_x64': { + 'inherit_from': ['Debug'], + 'msvs_configuration_platform': 'x64', + }, + }, + }, + 'targets': [ + { + 'target_name': 'idl_test', + 'type': 'executable', + 'sources': [ + 'history_indexer.idl', + '<(midl_out_dir)/history_indexer.h', + '<(midl_out_dir)/history_indexer_i.c', + 'history_indexer_user.cc', + ], + 'libraries': ['ole32.lib'], + 'include_dirs': [ + '<(midl_out_dir)', + ], + 'msvs_settings': { + 'VCMIDLTool': { + 'OutputDirectory': '<(midl_out_dir)', + 'HeaderFileName': '<(RULE_INPUT_ROOT).h', + }, + }, + }, + { + 'target_name': 'idl_explicit_action', + 'type': 'none', + 'sources': [ + 'Window.idl', + ], + 'actions': [{ + 'action_name': 'blink_idl', + 'explicit_idl_action': 1, + 'msvs_cygwin_shell': 0, + 'inputs': [ + 'Window.idl', + 'idl_compiler.py', + ], + 'outputs': [ + 'Window.cpp', + 'Window.h', + ], + 'action': [ + 'python', + 'idl_compiler.py', + 'Window.idl', + ], + }], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer.idl b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer.idl new file mode 100644 index 000000000..e866ce6d9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer.idl @@ -0,0 +1,17 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+ object,
+ uuid(9C1100DD-51D4-4827-AE9F-3B8FAC4AED72),
+ oleautomation,
+ nonextensible,
+ pointer_default(unique)
+]
+interface IChromeHistoryIndexer : IUnknown {
+ HRESULT SomeFunction([in] VARIANT begin_time, [in] VARIANT end_time);
+};
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer_user.cc b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer_user.cc new file mode 100644 index 000000000..071a9ffef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/history_indexer_user.cc @@ -0,0 +1,15 @@ +// 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. + +#include "history_indexer.h" + +// Use the thing in the IDL. +int main() { + IChromeHistoryIndexer** indexer = 0; + IID fake_iid; + CoCreateInstance(fake_iid, NULL, CLSCTX_INPROC, + __uuidof(IChromeHistoryIndexer), + reinterpret_cast<void**>(indexer)); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/idl_compiler.py b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/idl_compiler.py new file mode 100644 index 000000000..a12b274d6 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/idl-rules/idl_compiler.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +# mock, just outputs empty .h/.cpp files + +import os +import sys + +if len(sys.argv) == 2: + basename, ext = os.path.splitext(sys.argv[1]) + with open('%s.h' % basename, 'w') as f: + f.write('// %s.h\n' % basename) + with open('%s.cpp' % basename, 'w') as f: + f.write('// %s.cpp\n' % basename) diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/importlib/dll_no_exports.cc b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/dll_no_exports.cc new file mode 100644 index 000000000..96dd7970b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/dll_no_exports.cc @@ -0,0 +1,9 @@ +// Copyright (c) 2015 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 <windows.h> + +BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/importlib/has-exports.cc b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/has-exports.cc new file mode 100644 index 000000000..3f62d6c60 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/has-exports.cc @@ -0,0 +1,10 @@ +// 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. + +__declspec(dllexport) void some_function() { +} + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/importlib/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/hello.cc new file mode 100644 index 000000000..66ff68c11 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/hello.cc @@ -0,0 +1,9 @@ +// 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. + +__declspec(dllimport) void some_function(); + +int main() { + some_function(); +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/importlib/importlib.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/importlib.gyp new file mode 100644 index 000000000..ab15b1893 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/importlib.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_importlib', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + } + }, + 'sources': ['has-exports.cc'], + }, + + { + 'target_name': 'test_linkagainst', + 'type': 'executable', + 'dependencies': ['test_importlib'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/importlib/noimplib.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/noimplib.gyp new file mode 100644 index 000000000..0245058a9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/importlib/noimplib.gyp @@ -0,0 +1,16 @@ +# Copyright (c) 2015 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': 'no_import_library', + 'type': 'loadable_module', + 'msvs_settings': { + 'NoImportLibrary': 'true', + }, + 'sources': ['dll_no_exports.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/dllmain.cc b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/dllmain.cc new file mode 100644 index 000000000..14875623e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/dllmain.cc @@ -0,0 +1,9 @@ +// 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. + +#include <windows.h> + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/large-pdb.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/large-pdb.gyp new file mode 100644 index 000000000..2a241a562 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/large-pdb.gyp @@ -0,0 +1,98 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'large_pdb_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/large_pdb_exe.exe.pdb', + }, + }, + }, + { + 'target_name': 'small_pdb_exe', + 'type': 'executable', + 'msvs_large_pdb': 0, + 'sources': [ + 'main.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/small_pdb_exe.exe.pdb', + }, + }, + }, + { + 'target_name': 'large_pdb_dll', + 'type': 'shared_library', + 'msvs_large_pdb': 1, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/large_pdb_dll.dll.pdb', + }, + }, + }, + { + 'target_name': 'small_pdb_dll', + 'type': 'shared_library', + 'msvs_large_pdb': 0, + 'sources': [ + 'dllmain.cc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/small_pdb_dll.dll.pdb', + }, + }, + }, + { + 'target_name': 'large_pdb_implicit_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, the msvs_large_pdb mechanism should + # default to the appropriate <(PRODUCT_DIR)/<(TARGET_NAME).exe.pdb. + }, + { + 'target_name': 'large_pdb_variable_exe', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, the msvs_large_pdb_path variable + # explicitly sets one. + 'variables': { + 'msvs_large_pdb_path': '<(PRODUCT_DIR)/foo.pdb', + }, + }, + { + 'target_name': 'large_pdb_product_exe', + 'product_name': 'bar', + 'type': 'executable', + 'msvs_large_pdb': 1, + 'sources': [ + 'main.cc', + ], + # No PDB file is specified. However, we've specified a product name so + # it should use <(PRODUCT_DIR)/bar.exe.pdb. + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/main.cc b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/main.cc new file mode 100644 index 000000000..c3da8e921 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/large-pdb/main.cc @@ -0,0 +1,7 @@ +// 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. + +int main(void) { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.cc b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.cc new file mode 100644 index 000000000..a6ffa1686 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.cc @@ -0,0 +1,9 @@ +// 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. + +#include "answer.h" + +int answer() { + return 42; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.h b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.h new file mode 100644 index 000000000..82312d54b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/answer.h @@ -0,0 +1,5 @@ +// 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. + +int answer();
\ No newline at end of file diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/use_host_ar.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/use_host_ar.gyp new file mode 100644 index 000000000..4747bc644 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-crosscompile/use_host_ar.gyp @@ -0,0 +1,17 @@ +# Copyright (c) 2015 The Chromium Authors. 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': 'lib_answer', + 'type': 'static_library', + 'toolsets': ['host'], + 'msvs_settings': { + 'msvs_cygwin_shell': 0, + }, + 'sources': ['answer.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.cc b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.cc new file mode 100644 index 000000000..a6ffa1686 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.cc @@ -0,0 +1,9 @@ +// 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. + +#include "answer.h" + +int answer() { + return 42; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.h b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.h new file mode 100644 index 000000000..82312d54b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/answer.h @@ -0,0 +1,5 @@ +// 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. + +int answer();
\ No newline at end of file diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/ltcg.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/ltcg.gyp new file mode 100644 index 000000000..c18310773 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/lib-flags/ltcg.gyp @@ -0,0 +1,21 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'lib_answer', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLibrarianTool': { + 'LinkTimeCodeGeneration': 'true', # /LTCG + }, + }, + 'sources': ['answer.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/x.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/x.cc new file mode 100644 index 000000000..f5f763b09 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/x.cc @@ -0,0 +1,7 @@ +// 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. + +int x() { + return 1; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/z.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/z.cc new file mode 100644 index 000000000..8a4350127 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/a/z.cc @@ -0,0 +1,7 @@ +// 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. + +int z() { + return 3; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.cc new file mode 100644 index 000000000..7dfb589d2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.cc @@ -0,0 +1,10 @@ +// 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. + +#include <winsock2.h> + +int main() { + WSAStartup(0, 0); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.gyp new file mode 100644 index 000000000..55afe64fb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-deps.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deps_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_deps_few', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wininet.lib', + 'ws2_32.lib', + ] + } + }, + 'sources': ['additional-deps.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-options.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-options.gyp new file mode 100644 index 000000000..cab3994cd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/additional-options.gyp @@ -0,0 +1,29 @@ +# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_additional_none',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ {
+ 'target_name': 'test_additional_few',
+ 'type': 'executable',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'AdditionalOptions': [
+ '/dynamicbase:no',
+ ]
+ }
+ },
+ 'sources': ['hello.cc'],
+ },
+ ]
+}
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/aslr.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/aslr.gyp new file mode 100644 index 000000000..b3aefd50b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/aslr.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_aslr_default', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_aslr_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_aslr_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/b/y.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/b/y.cc new file mode 100644 index 000000000..bd884119f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/b/y.cc @@ -0,0 +1,7 @@ +// 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. + +int y() { + return 2; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/base-address.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/base-address.gyp new file mode 100644 index 000000000..873ebfea3 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/base-address.gyp @@ -0,0 +1,38 @@ +# Copyright 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. + +{ + 'targets': [ + { + 'target_name': 'test_base_specified_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'BaseAddress': '0x00420000', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_specified_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'BaseAddress': '0x10420000', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_default_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_base_default_dll', + 'type': 'shared_library', + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/debug-info.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/debug-info.gyp new file mode 100644 index 000000000..d47d0ecce --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/debug-info.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_debug_off', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'false' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_debug_on', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true' + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile-multiple.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile-multiple.gyp new file mode 100644 index 000000000..c74a9af20 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile-multiple.gyp @@ -0,0 +1,17 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deffile_multiple_fail', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + 'deffile.def', + 'deffile2.def', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.cc new file mode 100644 index 000000000..fa203b34c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.cc @@ -0,0 +1,13 @@ +// 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. + +void AnExportedFunction() { +} + +void AnotherExportedFunction() { +} + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.def b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.def new file mode 100644 index 000000000..ba9d399bd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.def @@ -0,0 +1,8 @@ +; 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. + +LIBRARY test_deffile_ok + +EXPORTS + AnExportedFunction diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.gyp new file mode 100644 index 000000000..7b241d5e3 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/deffile.gyp @@ -0,0 +1,38 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_deffile_dll_ok', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + 'deffile.def', + ], + }, + { + 'target_name': 'test_deffile_dll_notexported', + 'type': 'shared_library', + 'sources': [ + 'deffile.cc', + ], + }, + { + 'target_name': 'test_deffile_exe_ok', + 'type': 'executable', + 'sources': [ + 'deffile.cc', + 'deffile.def', + ], + }, + { + 'target_name': 'test_deffile_exe_notexported', + 'type': 'executable', + 'sources': [ + 'deffile.cc', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load-dlls.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load-dlls.gyp new file mode 100644 index 000000000..671cbaa80 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load-dlls.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_dld_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + } + }, + 'sources': ['delay-load.cc'], + 'libraries': [ + 'delayimp.lib', + 'shell32.lib', + ], + }, + { + 'target_name': 'test_dld_shell32', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DelayLoadDLLs': ['shell32.dll'] + } + }, + 'sources': ['delay-load.cc'], + 'libraries': [ + 'delayimp.lib', + 'shell32.lib', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load.cc new file mode 100644 index 000000000..2be34aa87 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/delay-load.cc @@ -0,0 +1,10 @@ +// 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. + +#include <shlobj.h> + +int main() { + SHCreateDirectory(0, 0); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/embed-manifest.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/embed-manifest.gyp new file mode 100644 index 000000000..fefb2f56d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/embed-manifest.gyp @@ -0,0 +1,109 @@ +# Copyright (c) 2013 Yandex LLC. 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': 'test_manifest_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '1', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_dll', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '1', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_extra1', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': 'extra.manifest', + } + }, + }, + { + 'target_name': 'test_manifest_extra2', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + } + }, + }, + { + 'target_name': 'test_manifest_extra_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest' + ], + } + }, + }, + { + 'target_name': 'test_manifest_dll_inc', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_exe_inc', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'test_manifest_exe_inc_no_embed', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkIncremental': '2', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + } + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/enable-uac.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/enable-uac.gyp new file mode 100644 index 000000000..4e58c86ec --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/enable-uac.gyp @@ -0,0 +1,45 @@ +# Copyright 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. + +{ + 'targets': [ + { + 'target_name': 'enable_uac', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'enable_uac_no', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + { + 'target_name': 'enable_uac_admin', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'UACExecutionLevel': 2, + 'UACUIAccess': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + } + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.cc new file mode 100644 index 000000000..b567bc87b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.cc @@ -0,0 +1,13 @@ +// 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. + +// The entry point specified by link.exe /ENTRY option. +extern "C" void MainEntryPoint() { +} + +// Still needed because the linker checks for existence of one of main, wmain, +// WinMain, or wMain to offer informative diagnositics. +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.gyp new file mode 100644 index 000000000..7f2c14252 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/entrypointsymbol.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'EntryPointSymbol': 'MainEntryPoint', + } + }, + 'sources': ['entrypointsymbol.cc'], + }, + { + 'target_name': 'test_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'EntryPointSymbol': 'MainEntryPoint', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra.manifest b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra.manifest new file mode 100644 index 000000000..2e436dc25 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra.manifest @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--This Id value indicates the application supports Windows 7 functionality-->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ </application>
+ </compatibility>
+
+</assembly>
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra2.manifest b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra2.manifest new file mode 100644 index 000000000..bfb570ca5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/extra2.manifest @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!--This Id value indicates the application supports Windows Vista functionality -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ </application>
+ </compatibility>
+
+</assembly>
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/fixed-base.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/fixed-base.gyp new file mode 100644 index 000000000..cc2982eb2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/fixed-base.gyp @@ -0,0 +1,52 @@ +# 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. + +{ + 'targets': [ + # Disable DYNAMICBASE for these tests because it implies/doesn't imply + # FIXED in certain cases so it complicates the test for FIXED. + { + 'target_name': 'test_fixed_default_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_default_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'FixedBaseAddress': '1', + 'RandomizedBaseAddress': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_fixed_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'FixedBaseAddress': '2', + 'RandomizedBaseAddress': '1', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/force-symbol-reference.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/force-symbol-reference.gyp new file mode 100644 index 000000000..1f354fafc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/force-symbol-reference.gyp @@ -0,0 +1,39 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_force_reference_lib', + 'type': 'static_library', + 'sources': ['x.cc', 'y.cc'], + }, + { + 'target_name': 'test_force_reference', + 'type': 'executable', + # Turn on debug info to get symbols in disasm for the test code, and + # turn on opt:ref to drop unused symbols to make sure we wouldn't + # otherwise have the symbols. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'AdditionalOptions': [ + '/OPT:REF', + ], + 'ForceSymbolReferences': [ + '?x@@YAHXZ', + '?y@@YAHXZ', + ], + }, + }, + 'sources': ['hello.cc'], + 'dependencies': [ + 'test_force_reference_lib', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/generate-manifest.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/generate-manifest.gyp new file mode 100644 index 000000000..34a68d1a4 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/generate-manifest.gyp @@ -0,0 +1,166 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_generate_manifest_true', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default_as_embedded', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'true', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_with_extra_manifest', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_with_extra_manifest', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': 'extra.manifest;extra2.manifest', + }, + }, + }, + { + 'target_name': 'test_generate_manifest_true_with_extra_manifest_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'true', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest', + ], + }, + }, + }, + { + 'target_name': 'test_generate_manifest_false_with_extra_manifest_list', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + 'GenerateManifest': 'false', + }, + 'VCManifestTool': { + 'EmbedManifest': 'false', + 'AdditionalManifestFiles': [ + 'extra.manifest', + 'extra2.manifest', + ], + }, + }, + }, + { + 'target_name': 'test_generate_manifest_default_embed_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'EnableUAC': 'true', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/hello.cc new file mode 100644 index 000000000..1711567ef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/incremental.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/incremental.gyp new file mode 100644 index 000000000..59f310325 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/incremental.gyp @@ -0,0 +1,65 @@ +# 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. + +{ + 'targets': [ + # Turn on debug information so the incremental linking tables have a + # visible symbolic name in the disassembly. + { + 'target_name': 'test_incremental_unset', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '0', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_incremental_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '2', + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.cc new file mode 100644 index 000000000..a9f177e47 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.cc @@ -0,0 +1,12 @@ +// 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. + +#include "inline_test.h" + +#include <intrin.h> +#pragma intrinsic(_ReturnAddress) + +bool IsFunctionInlined(void* caller_return_address) { + return _ReturnAddress() == caller_return_address; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.h b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.h new file mode 100644 index 000000000..117913c4f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test.h @@ -0,0 +1,5 @@ +// 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. + +bool IsFunctionInlined(void* current_return_address); diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test_main.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test_main.cc new file mode 100644 index 000000000..23cafe8f9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/inline_test_main.cc @@ -0,0 +1,15 @@ +// 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. + +#include "inline_test.h" + +#include <intrin.h> +#include <stdio.h> + +#pragma intrinsic(_ReturnAddress) + +int main() { + if (IsFunctionInlined(_ReturnAddress())) + puts("==== inlined ====\n"); +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/large-address-aware.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/large-address-aware.gyp new file mode 100644 index 000000000..fa56d3789 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/large-address-aware.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_large_address_aware_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LargeAddressAware': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_large_address_aware_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LargeAddressAware': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.cc new file mode 100644 index 000000000..7dfb589d2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.cc @@ -0,0 +1,10 @@ +// 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. + +#include <winsock2.h> + +int main() { + WSAStartup(0, 0); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.gyp new file mode 100644 index 000000000..10e9996f5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-adjust.gyp @@ -0,0 +1,16 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_adjust', + 'type': 'executable', + 'libraries': [ + '-lws2_32.lib' + ], + 'sources': ['library-adjust.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-define.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-define.cc new file mode 100644 index 000000000..211ef062c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-define.cc @@ -0,0 +1,7 @@ +// 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. + +int library_function() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-reference.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-reference.cc new file mode 100644 index 000000000..335097839 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories-reference.cc @@ -0,0 +1,10 @@ +// 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. + +extern int library_function(); + +int main() { + library_function(); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories.gyp new file mode 100644 index 000000000..25395d6c8 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/library-directories.gyp @@ -0,0 +1,42 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_libdirs_none', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'test_lib.lib', + ], + }, + }, + 'sources': ['library-directories-reference.cc'], + }, + { + 'target_name': 'test_libdirs_with', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + # NOTE: Don't use this for general dependencies between gyp + # libraries (use 'dependencies' instead). This is done here only for + # testing. + # + # This setting should only be used to depend on third party prebuilt + # libraries that are stored as binaries at a known location. + 'AdditionalLibraryDirectories': [ + '<(DEPTH)/out/Default/obj/subdir', # ninja style + '<(DEPTH)/subdir/Default/lib', # msvs style + ], + 'AdditionalDependencies': [ + 'test_lib.lib', + ], + }, + }, + 'sources': ['library-directories-reference.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-ordering.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-ordering.gyp new file mode 100644 index 000000000..66f44309d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-ordering.gyp @@ -0,0 +1,95 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ordering_exe', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'z.cc', + 'x.cc', + 'y.cc', + 'hello.cc', + ], + }, + + { + 'target_name': 'test_ordering_subdirs', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'hello.cc', + 'b/y.cc', + 'a/z.cc', + ], + }, + + + { + 'target_name': 'test_ordering_subdirs_mixed', + 'type': 'executable', + # These are so the names of the functions appear in the disassembly. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + 'Optimization': '2', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + 'GenerateManifest': 'false', + # Minimize the disassembly to just our code. + 'AdditionalOptions': [ + '/NODEFAULTLIB', + ], + }, + }, + 'sources': [ + # Explicitly sorted the same way as the disassembly in the test .py. + 'main-crt.c', + 'a/x.cc', + 'hello.cc', + 'a/z.cc', + 'y.cc', + ], + }, + + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-warning.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-warning.cc new file mode 100644 index 000000000..4b34277ba --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/link-warning.cc @@ -0,0 +1,10 @@ +// 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. + +// This will cause LNK4254. +#pragma comment(linker, "/merge:.data=.text") + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/ltcg.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/ltcg.gyp new file mode 100644 index 000000000..ddb0d9b4e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/ltcg.gyp @@ -0,0 +1,42 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ltcg_off', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'false', + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '0', + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + { + 'target_name': 'test_ltcg_on', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '1', # /LTCG + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/main-crt.c b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/main-crt.c new file mode 100644 index 000000000..bdc80c54f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/main-crt.c @@ -0,0 +1,8 @@ +// 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. + +// Stub so we can link with /NODEFAULTLIB when checking disasm. +int mainCRTStartup() { + return 5; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/manifest-in-comment.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/manifest-in-comment.cc new file mode 100644 index 000000000..ae54ae546 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/manifest-in-comment.cc @@ -0,0 +1,13 @@ +// Copyright 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. + +#pragma comment(linker, \ + "\"/manifestdependency:type='Win32' " \ + "name='Test.Research.SampleAssembly' version='6.0.0.0' " \ + "processorArchitecture='X86' " \ + "publicKeyToken='0000000000000000' language='*'\"") + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.cc new file mode 100644 index 000000000..cebccb264 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.cc @@ -0,0 +1,12 @@ +// 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. + +__declspec(dllexport) +void AnExportedFunction() { + // We need an exported function to verify that /MAPINFO:EXPORTS works. +} + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.gyp new file mode 100644 index 000000000..14206fe28 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/mapfile.gyp @@ -0,0 +1,45 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_mapfile_unset', + 'type': 'executable', + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + }, + }, + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate_exports', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + 'MapExports': 'true', + }, + }, + 'sources': ['mapfile.cc'], + }, + { + 'target_name': 'test_mapfile_generate_filename', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'GenerateMapFile': 'true', + 'MapFileName': '<(PRODUCT_DIR)/custom_file_name.map', + }, + }, + 'sources': ['mapfile.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.cc new file mode 100644 index 000000000..e30684698 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.cc @@ -0,0 +1,18 @@ +// 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. + +// Reference something in kernel32.dll. This will fail to link, verifying that +// GYP provides no default import library configuration. +// Note that we don't include Windows.h, as that will result in generating +// linker directives in the object file through #pragma comment(lib, ...). +typedef short BOOL; + +extern "C" __declspec(dllimport) +BOOL CopyFileW(const wchar_t*, const wchar_t*, BOOL); + + +int main() { + CopyFileW(0, 0, 0); // kernel32 + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.gyp new file mode 100644 index 000000000..77838ce8c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/no-default-libs.gyp @@ -0,0 +1,13 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_default', + 'type': 'executable', + 'sources': ['no-default-libs.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.cc new file mode 100644 index 000000000..24b6eca43 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.cc @@ -0,0 +1,13 @@ +// 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. + +// Include entry point function that's excluded by removing C runtime libraries. +extern "C" void mainCRTStartup() { +} + +// Still needed because the linker checks for existence of one of main, wmain, +// WinMain, or wMain to offer informative diagnositics. +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.gyp new file mode 100644 index 000000000..4fb452a18 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nodefaultlib.gyp @@ -0,0 +1,30 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'IgnoreDefaultLibraryNames': + ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'], + } + }, + 'sources': ['nodefaultlib.cc'], + }, + { + 'target_name': 'test_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'IgnoreDefaultLibraryNames': + ['libcmtd.lib', 'libcmt.lib', 'msvcrt.lib', 'msvcrtd.lib'], + } + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nxcompat.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nxcompat.gyp new file mode 100644 index 000000000..fa4118cbd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/nxcompat.gyp @@ -0,0 +1,35 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_nxcompat_default', + 'type': 'executable', + 'msvs_settings': { + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_nxcompat_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DataExecutionPrevention': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_nxcompat_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'DataExecutionPrevention': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.cc new file mode 100644 index 000000000..1f12156b7 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.cc @@ -0,0 +1,29 @@ +// 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. + +void similar_function0(char* x) { + while (*x) { + ++x; + } +} + +void similar_function1(char* p) { + while (*p) { + ++p; + } +} + +void similar_function2(char* q) { + while (*q) { + ++q; + } +} + +int main() { + char* x = "hello"; + similar_function0(x); + similar_function1(x); + similar_function2(x); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.gyp new file mode 100644 index 000000000..effe8021c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-icf.gyp @@ -0,0 +1,63 @@ +# 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. + +{ + 'targets': [ + # Have to turn on function level linking here to get the function packaged + # as a COMDAT so that it's eligible for merging. Also turn on debug + # information so that the symbol names for the code appear in the dump. + # Finally, specify non-incremental linking so that there's not a bunch of + # extra "similar_function"s in the output (the ILT jump table). + { + 'target_name': 'test_opticf_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + { + 'target_name': 'test_opticf_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'EnableCOMDATFolding': '1', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + { + 'target_name': 'test_opticf_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + 'Optimization': '0', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'EnableCOMDATFolding': '2', + 'LinkIncremental': '1', + }, + }, + 'sources': ['opt-icf.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.cc new file mode 100644 index 000000000..afaa328a5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.cc @@ -0,0 +1,11 @@ +// 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. + +int unused_function() { + return 0; +} + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.gyp new file mode 100644 index 000000000..69d0281a0 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/opt-ref.gyp @@ -0,0 +1,56 @@ +# 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. + +{ + 'targets': [ + # Have to turn on function level linking here to get the function packaged + # as a COMDAT so that it's eligible for optimizing away. Also turn on + # debug information so that the symbol names for the code appear in the + # dump (so we can verify if they are included in the final exe). + { + 'target_name': 'test_optref_default', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + 'sources': ['opt-ref.cc'], + }, + { + 'target_name': 'test_optref_no', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'OptimizeReferences': '1', + }, + }, + 'sources': ['opt-ref.cc'], + }, + { + 'target_name': 'test_optref_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'EnableFunctionLevelLinking': 'true', + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'OptimizeReferences': '2', + }, + }, + 'sources': ['opt-ref.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/outputfile.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/outputfile.gyp new file mode 100644 index 000000000..1022ec2e2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/outputfile.gyp @@ -0,0 +1,58 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_output_exe', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\blorp.exe' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_exe2', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\subdir\\blorp.exe' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\blorp.dll' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_lib', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(OutDir)\\blorp.lib' + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_output_lib2', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(OutDir)\\subdir\\blorp.lib' + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pdb-output.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pdb-output.gyp new file mode 100644 index 000000000..1a03c67cc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pdb-output.gyp @@ -0,0 +1,49 @@ +# Copyright (c) 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': 'test_pdb_output_exe', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': 'output_exe.pdb', + }, + }, + }, + { + 'target_name': 'test_pdb_output_dll', + 'type': 'shared_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': 'output_dll.pdb', + }, + }, + }, + { + 'target_name': 'test_pdb_output_disabled', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '0' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'false', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pgo.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pgo.gyp new file mode 100644 index 000000000..9c5d47688 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/pgo.gyp @@ -0,0 +1,143 @@ +# 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. + +{ + 'variables': { + 'pgd_basename': 'test_pgo', + }, + 'targets': [ + # In the PGO (Profile-Guided Optimization) build flow, we need to build the + # target binary multiple times. To implement this flow with gyp, here we + # define multiple 'executable' targets, each of which represents one build + # particular build/profile stage. On tricky part to do this is that these + # 'executable' targets should share the code itself so that profile data + # can be reused among these 'executable' files. In other words, the only + # differences among below 'executable' targets are: + # 1) PGO (Profile-Guided Optimization) database, and + # 2) linker options. + # The following static library contains all the logic including entry point. + # Basically we don't need to rebuild this target once we enter profiling + # phase of PGO. + { + 'target_name': 'test_pgo_main', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WholeProgramOptimization': 'true', # /GL + }, + 'VCLibrarianTool': { + 'LinkTimeCodeGeneration': 'true', + }, + }, + 'link_settings': { + 'msvs_settings': { + 'VCLinkerTool': { + 'ProfileGuidedDatabase': '$(OutDir)\\<(pgd_basename).pgd', + 'TargetMachine': '1', # x86 - 32 + 'SubSystem': '1', # /SUBSYSTEM:CONSOLE + # Tell ninja generator not to pass /ManifestFile:<filename> option + # to the linker, because it causes LNK1268 error in PGO biuld. + 'GenerateManifest': 'false', + # We need to specify 'libcmt.lib' here so that the linker can pick + # up a valid entry point. + 'AdditionalDependencies': [ + 'libcmt.lib', + ], + }, + }, + }, + 'sources': [ + 'inline_test.h', + 'inline_test.cc', + 'inline_test_main.cc', + ], + }, + { + 'target_name': 'test_pgo_instrument', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '2', + }, + }, + 'dependencies': [ + 'test_pgo_main', + ], + }, + { + 'target_name': 'gen_profile_guided_database', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'actions': [ + { + 'action_name': 'action_main', + 'inputs': [], + 'outputs': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'action': [ + 'python', 'update_pgd.py', + '--vcbindir', '$(VCInstallDir)bin', + '--exe', '$(OutDir)\\test_pgo_instrument.exe', + '--pgd', '$(OutDir)\\<(pgd_basename).pgd', + ], + }, + ], + 'dependencies': [ + 'test_pgo_instrument', + ], + }, + { + 'target_name': 'test_pgo_optimize', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '3', + }, + }, + 'sources': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'dependencies': [ + 'test_pgo_main', + 'gen_profile_guided_database', + ], + }, + { + 'target_name': 'test_pgo_update', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'LinkTimeCodeGeneration': '4', + }, + }, + 'sources': [ + '$(OutDir)\\<(pgd_basename).pgd', + ], + 'dependencies': [ + 'test_pgo_main', + ], + }, + # A helper target to dump link.exe's command line options. We can use the + # output to determine if PGO (Profile-Guided Optimization) is available on + # the test environment. + { + 'target_name': 'gen_linker_option', + 'type': 'none', + 'msvs_cygwin_shell': 0, + 'actions': [ + { + 'action_name': 'action_main', + 'inputs': [], + 'outputs': [ + '$(OutDir)\\linker_options.txt', + ], + 'action': [ + 'cmd.exe', '/c link.exe > $(OutDir)\\linker_options.txt & exit 0', + ], + }, + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/profile.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/profile.gyp new file mode 100644 index 000000000..d60a700fb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/profile.gyp @@ -0,0 +1,50 @@ +# 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. + +{ + 'targets': [ + # Verify that 'Profile' option correctly makes it to LINK steup in Ninja + { + 'target_name': 'test_profile_true', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'Profile': 'true', + 'GenerateDebugInformation': 'true', + }, + }, + }, + { + 'target_name': 'test_profile_false', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'Profile': 'false', + 'GenerateDebugInformation': 'true', + }, + }, + }, + { + 'target_name': 'test_profile_default', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/program-database.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/program-database.gyp new file mode 100644 index 000000000..6e60ac0dc --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/program-database.gyp @@ -0,0 +1,40 @@ +# 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. + +{ + 'targets': [ + # Verify that 'ProgramDatabaseFile' option correctly makes it to LINK + # step in Ninja. + { + # Verify that VC macros and windows paths work correctly. + 'target_name': 'test_pdb_outdir', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '$(OutDir)\\name_outdir.pdb', + }, + }, + }, + { + # Verify that GYP macros and POSIX paths work correctly. + 'target_name': 'test_pdb_proddir', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3' + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + 'ProgramDatabaseFile': '<(PRODUCT_DIR)/name_proddir.pdb', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh.gyp new file mode 100644 index 000000000..d4a62074b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh.gyp @@ -0,0 +1,79 @@ +# Copyright (c) 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. + +{ + 'target_defaults': { + 'configurations': { + 'Default': { + 'msvs_configuration_platform': 'Win32', + }, + 'Default_x64': { + 'inherit_from': ['Default'], + 'msvs_configuration_platform': 'x64', + }, + }, + }, + 'targets': [ + { + 'target_name': 'test_safeseh_default', + 'type': 'executable', + 'msvs_settings': { + # By default, msvs passes /SAFESEH for Link, but not for MASM. In + # order for test_safeseh_default to link successfully, we need to + # explicitly specify /SAFESEH for MASM. + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + 'target_name': 'test_safeseh_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'false', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + 'target_name': 'test_safeseh_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'true', + }, + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero.asm', + ], + }, + { + # x64 targets cannot have ImageHasSafeExceptionHandlers or + # UseSafeExceptionHandlers set. + 'target_name': 'test_safeseh_x64', + 'type': 'executable', + 'configurations': { + 'Default': { + 'msvs_target_platform': 'x64', + }, + }, + 'sources': [ + 'safeseh_hello.cc', + 'safeseh_zero64.asm', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_hello.cc new file mode 100644 index 000000000..6141300d2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_hello.cc @@ -0,0 +1,11 @@ +// Copyright (c) 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. + +extern "C" { +int zero(void); +} + +int main() { + return zero(); +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero.asm b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero.asm new file mode 100644 index 000000000..62da0df4f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero.asm @@ -0,0 +1,10 @@ +.MODEL FLAT, C +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero64.asm b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero64.asm new file mode 100644 index 000000000..a4740c0df --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/safeseh_zero64.asm @@ -0,0 +1,9 @@ +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/stacksize.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/stacksize.gyp new file mode 100644 index 000000000..bba44ca4a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/stacksize.gyp @@ -0,0 +1,44 @@ +# Copyright (c) 2015 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': 'test_default', + 'type': 'executable', + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_set_reserved_size', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackReserveSize': 2097152, # 2MB + } + }, + }, + { + 'target_name': 'test_set_commit_size', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackCommitSize': 8192, # 8KB + } + }, + }, + { + 'target_name': 'test_set_both', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'StackReserveSize': 2097152, # 2MB + 'StackCommitSize': 8192, # 8KB + } + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subdir/library.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subdir/library.gyp new file mode 100644 index 000000000..519577f0d --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subdir/library.gyp @@ -0,0 +1,13 @@ +# 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.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'test_lib',
+ 'type': 'static_library',
+ 'sources': ['../library-directories-define.cc'],
+ },
+ ]
+}
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem-windows.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem-windows.cc new file mode 100644 index 000000000..ac99da808 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem-windows.cc @@ -0,0 +1,9 @@ +// 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. + +#include <windows.h> + +int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem.gyp new file mode 100644 index 000000000..63f072a20 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/subsystem.gyp @@ -0,0 +1,70 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_console_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_console_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1' + } + }, + 'sources': ['subsystem-windows.cc'], + }, + { + 'target_name': 'test_windows_ok', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2' + } + }, + 'sources': ['subsystem-windows.cc'], + }, + { + 'target_name': 'test_windows_fail', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2' + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_console_xp', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '1', + 'MinimumRequiredVersion': '5.01', # XP. + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_windows_xp', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'SubSystem': '2', + 'MinimumRequiredVersion': '5.01', # XP. + } + }, + 'sources': ['subsystem-windows.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/target-machine.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/target-machine.gyp new file mode 100644 index 000000000..30271926c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/target-machine.gyp @@ -0,0 +1,48 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_target_link_x86', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_link_x64', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TargetMachine': '17', + }, + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_lib_x86', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'TargetMachine': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_target_lib_x64', + 'type': 'static_library', + 'msvs_settings': { + 'VCLibrarianTool': { + 'TargetMachine': '17', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/tsaware.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/tsaware.gyp new file mode 100644 index 000000000..7ffc7426b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/tsaware.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_tsaware_no', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TerminalServerAware': '1', + } + }, + 'sources': ['hello.cc'], + }, + { + 'target_name': 'test_tsaware_yes', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TerminalServerAware': '2', + }, + }, + 'sources': ['hello.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/unsupported-manifest.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/unsupported-manifest.gyp new file mode 100644 index 000000000..5549e7cb9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/unsupported-manifest.gyp @@ -0,0 +1,13 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_unsupported', + 'type': 'executable', + 'sources': ['manifest-in-comment.cc'], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/update_pgd.py b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/update_pgd.py new file mode 100644 index 000000000..176e9e547 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/update_pgd.py @@ -0,0 +1,35 @@ +#!/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. + +from optparse import OptionParser +import glob +import os +import subprocess + +parser = OptionParser() +parser.add_option('--exe', dest='exe') +parser.add_option('--vcbindir', dest='vcbindir') +parser.add_option('--pgd', dest='pgd') +(options, args) = parser.parse_args() + +# Instrumented binaries fail to run unless the Visual C++'s bin dir is included +# in the PATH environment variable. +os.environ['PATH'] = os.environ['PATH'] + os.pathsep + options.vcbindir + +# Run Instrumented binary. The profile will be recorded into *.pgc file. +subprocess.call([options.exe]) + +# Merge *.pgc files into a *.pgd (Profile-Guided Database) file. +subprocess.call(['pgomgr', '/merge', options.pgd]) + +# *.pgc files are no longer necessary. Clear all of them. +pgd_file = os.path.abspath(options.pgd) +pgd_dir = os.path.dirname(pgd_file) +(pgd_basename, _) = os.path.splitext(os.path.basename(pgd_file)) +pgc_filepattern = os.path.join(pgd_dir, '%s!*.pgc' % pgd_basename) +pgc_files= glob.glob(pgc_filepattern) +for pgc_file in pgc_files: + os.unlink(pgc_file) diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/warn-as-error.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/warn-as-error.gyp new file mode 100644 index 000000000..600eb0c35 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/warn-as-error.gyp @@ -0,0 +1,33 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_on', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TreatLinkerWarningAsErrors': 'true', + } + }, + 'sources': ['link-warning.cc'], + }, + { + 'target_name': 'test_off', + 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + 'TreatLinkerWarningAsErrors': 'false', + } + }, + 'sources': ['link-warning.cc'], + }, + { + 'target_name': 'test_default', + 'type': 'executable', + 'sources': ['link-warning.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/x.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/x.cc new file mode 100644 index 000000000..f5f763b09 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/x.cc @@ -0,0 +1,7 @@ +// 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. + +int x() { + return 1; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/y.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/y.cc new file mode 100644 index 000000000..bd884119f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/y.cc @@ -0,0 +1,7 @@ +// 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. + +int y() { + return 2; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/z.cc b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/z.cc new file mode 100644 index 000000000..8a4350127 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/linker-flags/z.cc @@ -0,0 +1,7 @@ +// 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. + +int z() { + return 3; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/function.cc b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/function.cc new file mode 100644 index 000000000..af44b2cab --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/function.cc @@ -0,0 +1,7 @@ +// 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. + +int func() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/hello.cc new file mode 100644 index 000000000..1711567ef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/long-command-line.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/long-command-line.gyp new file mode 100644 index 000000000..964c94fa9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/long-command-line/long-command-line.gyp @@ -0,0 +1,54 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'longexe', + 'type': 'executable', + 'msvs_settings': { + # Use this as a simple way to get a long command. + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLinkerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'longlib', + 'type': 'static_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLibrarianTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'function.cc', + ], + }, + { + 'target_name': 'longdll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + 'VCLinkerTool': { + 'AdditionalOptions': '/nologo ' * 8000, + }, + }, + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/a.asm b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/a.asm new file mode 100644 index 000000000..62da0df4f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/a.asm @@ -0,0 +1,10 @@ +.MODEL FLAT, C +.CODE + +PUBLIC zero +zero PROC + xor eax, eax + ret 0 +zero ENDP + +END diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/hello.cc new file mode 100644 index 000000000..6141300d2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/hello.cc @@ -0,0 +1,11 @@ +// Copyright (c) 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. + +extern "C" { +int zero(void); +} + +int main() { + return zero(); +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/ml-safeseh.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/ml-safeseh.gyp new file mode 100644 index 000000000..bf8618f86 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/ml-safeseh/ml-safeseh.gyp @@ -0,0 +1,24 @@ +# Copyright (c) 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': 'ml_safeseh', + 'type': 'executable', + 'sources': [ + 'hello.cc', + 'a.asm', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'ImageHasSafeExceptionHandlers': 'true', + }, + 'MASM': { + 'UseSafeExceptionHandlers': 'true', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/gyptest-all.py b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/gyptest-all.py new file mode 100644 index 000000000..9fb5e62ed --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/gyptest-all.py @@ -0,0 +1,21 @@ +#!/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 that precompiled headers can be specified. +""" + +import TestGyp + +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['msvs', 'ninja'], workdir='workarea_all') + test.run_gyp('hello.gyp') + test.build('hello.gyp', 'hello') + test.run_built_executable('hello', stdout="Hello, world!\nHello, two!\n") + test.up_to_date('hello.gyp', test.ALL) + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.c b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.c new file mode 100644 index 000000000..ffb47bf82 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.c @@ -0,0 +1,14 @@ +/* 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. */ + +// Note the abscence of a stdio.h include. This will be inserted because of the +// precompiled header. + +extern int hello2(); + +int main(void) { + printf("Hello, world!\n"); + hello2(); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.gyp new file mode 100644 index 000000000..5f82c5359 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello.gyp @@ -0,0 +1,28 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'hello', + 'type': 'executable', + 'sources': [ + 'hello.c', + 'hello2.c', + 'precomp.c', + ], + 'msvs_precompiled_header': 'stdio.h', + 'msvs_precompiled_source': 'precomp.c', + + # Required so that the printf actually causes a build failure + # if the pch isn't included. + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '3', + 'WarnAsError': 'true', + }, + }, + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello2.c b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello2.c new file mode 100644 index 000000000..d6d53111f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/hello2.c @@ -0,0 +1,13 @@ +/* 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. */ + +// Unlike hello.c, this file specifies the headers. + +#include <windows.h> +#include <stdio.h> + +int hello2() { + printf("Hello, two!\n"); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/precomp.c b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/precomp.c new file mode 100644 index 000000000..517c61a36 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/precompiled/precomp.c @@ -0,0 +1,8 @@ +/* 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. */ + +// The precompiled header does not have to be the first one in the file. + +#include <windows.h> +#include <stdio.h> diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/Resource.h b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/Resource.h new file mode 100644 index 000000000..137acf39b --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/Resource.h @@ -0,0 +1,26 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by hello.rc
+//
+
+#define IDS_APP_TITLE 103
+
+#define IDR_MAINFRAME 128
+#define IDI_HELLO 107
+#define IDI_SMALL 108
+#define IDC_HELLO 109
+#ifndef IDC_STATIC
+#define IDC_STATIC -1
+#endif
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NO_MFC 130
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 110
+#endif
+#endif
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.cpp b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.cpp new file mode 100644 index 000000000..f552ca159 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.cpp @@ -0,0 +1,30 @@ +// 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.
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <tchar.h>
+
+#include "resource.h"
+
+#define MAX_LOADSTRING 100
+
+TCHAR szTitle[MAX_LOADSTRING];
+TCHAR szWindowClass[MAX_LOADSTRING];
+
+int APIENTRY _tWinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine,
+ int nCmdShow) {
+ // Make sure we can load some resources.
+ int count = 0;
+ LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
+ if (szTitle[0] != 0) ++count;
+ LoadString(hInstance, IDC_HELLO, szWindowClass, MAX_LOADSTRING);
+ if (szWindowClass[0] != 0) ++count;
+ if (LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SMALL)) != NULL) ++count;
+ if (LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HELLO)) != NULL) ++count;
+ return count;
+}
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.gyp new file mode 100644 index 000000000..3a66357dd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.gyp @@ -0,0 +1,92 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'with_resources', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'sources': [ + 'hello.cpp', + 'hello.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'with_resources_subdir', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'sources': [ + 'hello.cpp', + 'subdir/hello2.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'with_include_subdir', + 'type': 'executable', + 'msvs_settings': { + 'VCCLCompilerTool': { + 'DebugInformationFormat': '3', + }, + 'VCLinkerTool': { + 'GenerateDebugInformation': 'true', + }, + 'VCResourceCompilerTool': { + 'Culture' : '1033', + }, + }, + 'resource_include_dirs': [ + '$(ProjectDir)\\subdir', + ], + 'sources': [ + 'hello.cpp', + 'hello3.rc', + ], + 'libraries': [ + 'kernel32.lib', + 'user32.lib', + ], + }, + { + 'target_name': 'resource_only_dll', + 'type': 'shared_library', + 'msvs_settings': { + 'VCLinkerTool': { + 'ResourceOnlyDLL': 'true', + }, + }, + 'sources': [ + 'hello.rc', + ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.h b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.h new file mode 100644 index 000000000..e60f2eb7e --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.h @@ -0,0 +1,3 @@ +#pragma once
+
+#include "resource.h"
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.ico b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.ico Binary files differnew file mode 100644 index 000000000..d551aa3aa --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.ico diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.rc b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.rc new file mode 100644 index 000000000..c9a7af6a0 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello.rc @@ -0,0 +1,86 @@ +//Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#ifndef APSTUDIO_INVOKED
+#include "targetver.h"
+#endif
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE 9, 1
+#pragma code_page(932)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+
+IDI_HELLO ICON "hello.ico"
+IDI_SMALL ICON "small.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#ifndef APSTUDIO_INVOKED\r\n"
+ "#include ""targetver.h""\r\n"
+ "#endif\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDC_HELLO "HELLO"
+ IDS_APP_TITLE "hello"
+END
+
+#endif
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello3.rc b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello3.rc new file mode 100644 index 000000000..0bfa05a76 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/hello3.rc @@ -0,0 +1,87 @@ +//Microsoft Visual C++ generated resource script. +// +#include "include.h" +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#ifndef APSTUDIO_INVOKED +#include "targetver.h" +#endif +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(932) + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. + +IDI_HELLO ICON "hello.ico" +IDI_SMALL ICON "small.ico" + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#ifndef APSTUDIO_INVOKED\r\n" + "#include ""targetver.h""\r\n" + "#endif\r\n" + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDC_HELLO "HELLO" + IDS_APP_TITLE "hello" +END + +#endif +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/small.ico b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/small.ico Binary files differnew file mode 100644 index 000000000..d551aa3aa --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/small.ico diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/hello2.rc b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/hello2.rc new file mode 100644 index 000000000..4c8eab109 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/hello2.rc @@ -0,0 +1,87 @@ +//Microsoft Visual C++ generated resource script.
+//
+#include "subdir/include.h"
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#ifndef APSTUDIO_INVOKED
+#include "targetver.h"
+#endif
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE 9, 1
+#pragma code_page(932)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+
+IDI_HELLO ICON "hello.ico"
+IDI_SMALL ICON "small.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#ifndef APSTUDIO_INVOKED\r\n"
+ "#include ""targetver.h""\r\n"
+ "#endif\r\n"
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDC_HELLO "HELLO"
+ IDS_APP_TITLE "hello"
+END
+
+#endif
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/include.h b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/include.h new file mode 100644 index 000000000..f15c48b42 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/subdir/include.h @@ -0,0 +1 @@ +// Just exists to make sure it can be included.
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/targetver.h b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/targetver.h new file mode 100644 index 000000000..f583181df --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/rc-build/targetver.h @@ -0,0 +1,24 @@ +#pragma once
+
+// The following macros define the minimum required platform. The minimum required platform
+// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
+// your application. The macros work by enabling all features available on platform versions up to and
+// including the version specified.
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.
+#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
+#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Specifies that the minimum required platform is Internet Explorer 7.0.
+#define _WIN32_IE 0x0700 // Change this to the appropriate value to target other versions of IE.
+#endif
diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello.cc new file mode 100644 index 000000000..a9dce6245 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello1.cc b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello1.cc new file mode 100644 index 000000000..0eccf2861 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello1.cc @@ -0,0 +1,7 @@ +// 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. + +int f1() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello2.cc b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello2.cc new file mode 100644 index 000000000..23fcb546c --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello2.cc @@ -0,0 +1,7 @@ +// 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. + +int f2() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello3.cc b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello3.cc new file mode 100644 index 000000000..a72e2efb5 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello3.cc @@ -0,0 +1,7 @@ +// 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. + +int f3() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello4.cc b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello4.cc new file mode 100644 index 000000000..a94df1949 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/hello4.cc @@ -0,0 +1,7 @@ +// 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. + +int f4() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard.gyp new file mode 100644 index 000000000..eac45fcff --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard.gyp @@ -0,0 +1,31 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'shard', + 'type': 'static_library', + 'msvs_shard': 4, + 'sources': [ + 'hello1.cc', + 'hello2.cc', + 'hello3.cc', + 'hello4.cc', + ], + 'product_dir': '<(PRODUCT_DIR)', + }, + { + 'target_name': 'refs_to_shard', + 'type': 'executable', + 'dependencies': [ + # Make sure references are correctly updated. + 'shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard_ref.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard_ref.gyp new file mode 100644 index 000000000..3ec8d76f9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/shard/shard_ref.gyp @@ -0,0 +1,41 @@ +# 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': 'refs_to_shard_external_lib', + 'type': 'static_library', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'refs_to_shard_external_exe', + 'type': 'executable', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + { + 'target_name': 'refs_to_shard_external_dll', + 'type': 'shared_library', + 'dependencies': [ + # Make sure references in other files are updated correctly. + 'shard.gyp:shard', + ], + 'sources': [ + 'hello.cc', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/system-include/bar/header.h b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/bar/header.h new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/bar/header.h diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/system-include/common/commonheader.h b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/common/commonheader.h new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/common/commonheader.h diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/system-include/foo/header.h b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/foo/header.h new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/foo/header.h diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/system-include/main.cc b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/main.cc new file mode 100644 index 000000000..b04ea8a53 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/main.cc @@ -0,0 +1,4 @@ +#include <commonheader.h> +#include <header.h> + +int main() {} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/system-include/test.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/test.gyp new file mode 100644 index 000000000..07f263654 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/system-include/test.gyp @@ -0,0 +1,26 @@ +{ + 'target_defaults': { + 'msvs_settings': { + 'VCCLCompilerTool': { + 'WarningLevel': '4', + 'WarnAsError': 'true', + }, + }, + 'msvs_system_include_dirs': [ + '$(ProjectName)', # Different for each target + 'common', # Same for all targets + ], + }, + 'targets': [ + { + 'target_name': 'foo', + 'type': 'executable', + 'sources': [ 'main.cc', ], + }, + { + 'target_name': 'bar', + 'type': 'executable', + 'sources': [ 'main.cc', ], + }, + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/a.cc b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/a.cc new file mode 100644 index 000000000..0fe05d5af --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/a.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/b.cc b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/b.cc new file mode 100644 index 000000000..0fe05d5af --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/b.cc @@ -0,0 +1,7 @@ +// 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. + +int some_function() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/dll.cc b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/dll.cc new file mode 100644 index 000000000..93a6c1900 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/dll.cc @@ -0,0 +1,6 @@ +// Copyright (c) 2015 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. + +__declspec(dllexport) void SomeFunction() { +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/exe.cc b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/exe.cc new file mode 100644 index 000000000..b3039ace9 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/exe.cc @@ -0,0 +1,7 @@ +// Copyright (c) 2015 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/main.cc b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/main.cc new file mode 100644 index 000000000..81b46d863 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/main.cc @@ -0,0 +1,10 @@ +// 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. + +extern int some_function(); + +int main() { + some_function(); + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi-depending-on-module.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi-depending-on-module.gyp new file mode 100644 index 000000000..3e34de841 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi-depending-on-module.gyp @@ -0,0 +1,42 @@ +# Copyright (c) 2015 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': 'an_exe', + 'type': 'executable', + 'sources': ['exe.cc'], + 'dependencies': [ + 'a_dll', + ], + }, + { + 'target_name': 'a_dll', + 'type': 'shared_library', + 'sources': ['dll.cc'], + 'dependencies': [ + 'a_lib', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'UseLibraryDependencyInputs': 'true' + }, + }, + }, + { + 'target_name': 'a_lib', + 'type': 'static_library', + 'dependencies': [ + 'a_module', + ], + 'sources': ['a.cc'], + }, + { + 'target_name': 'a_module', + 'type': 'loadable_module', + 'sources': ['a.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi.gyp new file mode 100644 index 000000000..c32f5e095 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/uldi/uldi.gyp @@ -0,0 +1,45 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'lib1', + 'type': 'static_library', + 'sources': ['a.cc'], + }, + { + 'target_name': 'final_uldi', + 'type': 'executable', + 'dependencies': [ + 'lib1', + 'lib2', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'UseLibraryDependencyInputs': 'true' + }, + }, + 'sources': ['main.cc'], + }, + { + 'target_name': 'final_no_uldi', + 'type': 'executable', + 'dependencies': [ + 'lib1', + 'lib2', + ], + 'sources': ['main.cc'], + }, + { + 'target_name': 'lib2', + 'type': 'static_library', + # b.cc has the same named function as a.cc, but don't use the same name + # so that the .obj will have a different name. If the obj file has the + # same name, the linker will discard the obj file, invalidating the + # test. + 'sources': ['b.cc'], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/as.py b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/as.py new file mode 100644 index 000000000..e0bc3ae6f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/as.py @@ -0,0 +1,18 @@ +#!/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. + +from optparse import OptionParser + +parser = OptionParser() +parser.add_option('-a', dest='platform') +parser.add_option('-o', dest='output') +parser.add_option('-p', dest='path') +(options, args) = parser.parse_args() + +f = open(options.output, 'w') +print >>f, 'options', options +print >>f, 'args', args +f.close() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/containing-gyp.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/containing-gyp.gyp new file mode 100644 index 000000000..c07b639ff --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/containing-gyp.gyp @@ -0,0 +1,39 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'msvs_cygwin_shell': 0, + 'type': 'none', + 'rules': [ + { + 'rule_name': 'assembler (gnu-compatible)', + 'msvs_cygwin_shell': 0, + 'msvs_quote_cmd': 0, + 'extension': 'S', + 'inputs': [ + 'as.py', + ], + 'outputs': [ + '$(IntDir)/$(InputName).obj', + ], + 'action': + ['python', + 'as.py', + '-a', '$(PlatformName)', + '-o', '$(IntDir)/$(InputName).obj', + '-p', '<(DEPTH)', + '$(InputPath)'], + 'message': 'Building assembly language file $(InputPath)', + 'process_outputs_as_sources': 1, + }, + ], + 'sources': [ + 'input.S', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/do_stuff.py b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/do_stuff.py new file mode 100644 index 000000000..4669d3139 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/do_stuff.py @@ -0,0 +1,8 @@ +# 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. + +import sys + +input = open(sys.argv[1], "r").read() +open(sys.argv[2], "w").write(input + "Modified.") diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/hello.cc b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/hello.cc new file mode 100644 index 000000000..1711567ef --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/hello.cc @@ -0,0 +1,7 @@ +// 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. + +int main() { + return 0; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input-output-macros.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input-output-macros.gyp new file mode 100644 index 000000000..b4520f8cb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input-output-macros.gyp @@ -0,0 +1,32 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'msvs_cygwin_shell': 0, + 'type': 'none', + 'rules': [ + { + 'rule_name': 'generate_file', + 'extension': 'blah', + 'inputs': [ + 'do_stuff.py', + ], + 'outputs': [ + '$(OutDir)\\<(RULE_INPUT_NAME).something', + ], + 'action': ['python', + 'do_stuff.py', + '<(RULE_INPUT_PATH)', + '$(OutDir)\\<(RULE_INPUT_NAME).something',], + }, + ], + 'sources': [ + 'stuff.blah', + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input.S b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input.S new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/input.S diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/projectname.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/projectname.gyp new file mode 100644 index 000000000..625a17764 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/projectname.gyp @@ -0,0 +1,29 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_expansions', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe', + }, + }, + }, + { + 'target_name': 'test_with_product_name', + 'product_name': 'prod_name', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(OutDir)\\$(ProjectName)_plus_something.exe', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/stuff.blah b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/stuff.blah new file mode 100644 index 000000000..d438b4a78 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/stuff.blah @@ -0,0 +1 @@ +Random data file. diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetext.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetext.gyp new file mode 100644 index 000000000..11f580e4a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetext.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 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': 'test_targetext_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\executable$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\loadable_module$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_shared_library', + 'type': 'shared_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\shared_library$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetDir)\\static_library$(TargetExt)', + }, + }, + }, + { + 'target_name': 'test_targetext_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'library', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\product_extension$(TargetExt)', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetfilename.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetfilename.gyp new file mode 100644 index 000000000..828732027 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetfilename.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 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': 'test_targetfilename_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_shared_library', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + { + 'target_name': 'test_targetfilename_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'foo', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetFileName)', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetname.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetname.gyp new file mode 100644 index 000000000..a53d3c0aa --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetname.gyp @@ -0,0 +1,52 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_targetname', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something1.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prefix', + 'product_prefix': 'prod_prefix', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something2.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prodname', + 'product_name': 'prod_name', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something3.exe', + }, + }, + }, + { + 'target_name': 'test_targetname_with_prodname_with_prefix', + 'product_name': 'prod_name', + 'product_prefix': 'prod_prefix', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetDir)\\$(TargetName)_plus_something4.exe', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetpath.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetpath.gyp new file mode 100644 index 000000000..a8699ffb2 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/targetpath.gyp @@ -0,0 +1,59 @@ +# Copyright (c) 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': 'test_targetpath_executable', + 'type': 'executable', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_loadable_module', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_shared_library', + 'type': 'loadable_module', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_static_library', + 'type': 'static_library', + 'sources': ['hello.cc'], + 'msvs_settings': { + 'VCLibrarianTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + { + 'target_name': 'test_targetpath_product_extension', + 'type': 'executable', + 'sources': ['hello.cc'], + 'product_extension': 'foo', + 'msvs_settings': { + 'VCLinkerTool': { + 'OutputFile': '$(TargetPath)', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/test_exists.py b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/test_exists.py new file mode 100644 index 000000000..f5c90ad6f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/test_exists.py @@ -0,0 +1,10 @@ +# 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. + +import os +import sys + +if not os.path.exists(sys.argv[1]): + raise +open(sys.argv[2], 'w').close() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/vcinstalldir.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/vcinstalldir.gyp new file mode 100644 index 000000000..3763a4eb1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/vs-macros/vcinstalldir.gyp @@ -0,0 +1,41 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'test_slash_trailing', + 'type': 'none', + 'msvs_cygwin_shell': '0', + 'actions': [ + { + 'action_name': 'root', + 'inputs': [], + 'outputs': ['out1'], + 'action': ['python', 'test_exists.py', '$(VCInstallDir)', 'out1'] + }, + ], + }, + { + 'target_name': 'test_slash_dir', + 'type': 'none', + 'msvs_cygwin_shell': '0', + 'actions': [ + { + 'action_name': 'bin', + 'inputs': [], + 'outputs': ['out2'], + 'action': ['python', 'test_exists.py', '$(VCInstallDir)bin', 'out2'], + }, + { + 'action_name': 'compiler', + 'inputs': [], + 'outputs': ['out3'], + 'action': [ + 'python', 'test_exists.py', '$(VCInstallDir)bin\\cl.exe', 'out3'], + }, + ], + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.c b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.c new file mode 100644 index 000000000..a6bee029a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.c @@ -0,0 +1,10 @@ +// Copyright (c) 2016 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 "win-driver-target-type.h" + +NTSTATUS DriverEntry(_In_ struct _DRIVER_OBJECT *DriverObject, + _In_ PUNICODE_STRING RegistryPath) { + return STATUS_SUCCESS; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp new file mode 100644 index 000000000..5da9cc9bd --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.gyp @@ -0,0 +1,32 @@ +# Copyright (c) 2016 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': 'win_driver_target_type', + 'type': 'windows_driver', + 'msvs_target_version': 'Windows7', + 'sources': [ + 'win-driver-target-type.c', + 'win-driver-target-type.h', + 'win-driver-target-type.rc', + ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + 'wdmsec.lib', + 'ntoskrnl.lib', + 'hal.lib', + 'wmilib.lib', + 'bufferoverflowfastfailk.lib', + ], + }, + 'VCCLCompilerTool': { + 'WarnAsError': 'false', + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.h b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.h new file mode 100644 index 000000000..5bbffd237 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.h @@ -0,0 +1,13 @@ +// Copyright (c) 2016 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE + +#ifndef _WIN_DRIVER_TARGET_TYPE_H_ +#define _WIN_DRIVER_TARGET_TYPE_H_ + +#include <ntifs.h> +#include <ntdddisk.h> + +DRIVER_INITIALIZE DriverEntry; + +#endif diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.rc b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.rc new file mode 100644 index 000000000..7a037ef73 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-driver-target-type/win-driver-target-type.rc @@ -0,0 +1,14 @@ +// Copyright (c) 2016 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 <windows.h> +#include <ntverp.h> + +#define VER_FILETYPE VFT_DRV +#define VER_FILESUBTYPE VFT2_DRV_SYSTEM +#define VER_FILEDESCRIPTION_STR "Windows Driver GYP target type" +#define VER_INTERNALNAME_STR "win-driver-target-type.sys" +#define VER_ORIGINALFILENAME_STR "win-driver-target-type.sys" + +#include "common.ver" diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/copies_readonly_files.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/copies_readonly_files.gyp new file mode 100644 index 000000000..3cd7e69f1 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/copies_readonly_files.gyp @@ -0,0 +1,29 @@ +{ + 'targets': [ + { + 'target_name': 'foo', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/dest', + 'files': [ + 'read-only-file', + ], + }, + ], + }, # target: foo + + { + 'target_name': 'bar', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)/dest', + 'files': [ + 'subdir/', + ], + }, + ], + }, # target: bar + ], +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py b/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py new file mode 100644 index 000000000..951b95277 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/win-tool/gyptest-win-tool-handles-readonly-files.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +# Copyright (c) 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. + +""" +Make sure overwriting read-only files works as expected (via win-tool). +""" + +import TestGyp + +import filecmp +import os +import stat +import sys + +if sys.platform == 'win32': + test = TestGyp.TestGyp(formats=['ninja']) + + # First, create the source files. + os.makedirs('subdir') + read_only_files = ['read-only-file', 'subdir/A', 'subdir/B', 'subdir/C'] + for f in read_only_files: + test.write(f, 'source_contents') + test.chmod(f, stat.S_IREAD) + if os.access(f, os.W_OK): + test.fail_test() + + # Second, create the read-only destination files. Note that we are creating + # them where the ninja and win-tool will try to copy them to, in order to test + # that copies overwrite the files. + os.makedirs(test.built_file_path('dest/subdir')) + for f in read_only_files: + f = os.path.join('dest', f) + test.write(test.built_file_path(f), 'SHOULD BE OVERWRITTEN') + test.chmod(test.built_file_path(f), stat.S_IREAD) + # Ensure not writable. + if os.access(test.built_file_path(f), os.W_OK): + test.fail_test() + + test.run_gyp('copies_readonly_files.gyp') + test.build('copies_readonly_files.gyp') + + # Check the destination files were overwritten by ninja. + for f in read_only_files: + f = os.path.join('dest', f) + test.must_contain(test.built_file_path(f), 'source_contents') + + # This will fail if the files are not the same mode or contents. + for f in read_only_files: + if not filecmp.cmp(f, test.built_file_path(os.path.join('dest', f))): + test.fail_test() + + test.pass_test() diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/dllmain.cc b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/dllmain.cc new file mode 100644 index 000000000..dedd83c3f --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/dllmain.cc @@ -0,0 +1,30 @@ +// 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. + +#include <windows.h> +#include <wrl.h> +#include <wrl/wrappers/corewrappers.h> +#include <windows.graphics.display.h> + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr<IDisplayPropertiesStatics> dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp new file mode 100644 index 000000000..5f37b5a2a --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-app-type-revision/winrt-app-type-revison.gyp @@ -0,0 +1,43 @@ +# 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. + +{ + 'targets': [ + { + 'target_name': 'enable_winrt_81_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '8.1' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_82_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '8.2' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_invalid_revision_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '999' + 'sources': [ + 'dllmain.cc', + ], + }, + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalDependencies': [ + '%(AdditionalDependencies)', + ], + }, + }, + }, + ] +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/dllmain.cc b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/dllmain.cc new file mode 100644 index 000000000..d71460c92 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/dllmain.cc @@ -0,0 +1,30 @@ +// Copyright (c) 2015 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 <windows.h> +#include <wrl.h> +#include <wrl/wrappers/corewrappers.h> +#include <windows.graphics.display.h> + +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; +using namespace ABI::Windows::Graphics::Display; + +bool TryToUseSomeWinRT() { + ComPtr<IDisplayPropertiesStatics> dp; + HStringReference s(RuntimeClass_Windows_Graphics_Display_DisplayProperties); + HRESULT hr = GetActivationFactory(s.Get(), dp.GetAddressOf()); + if (SUCCEEDED(hr)) { + float dpi = 96.0f; + if (SUCCEEDED(dp->get_LogicalDpi(&dpi))) { + return true; + } + } + return false; +} + +BOOL WINAPI DllMain(HINSTANCE hinstance, DWORD reason, LPVOID reserved) { + return TRUE; +} diff --git a/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp new file mode 100644 index 000000000..dbcfac696 --- /dev/null +++ b/other-licenses/gyp-deps/tools/gyp/test/win/winrt-target-platform-version/winrt-target-platform-version.gyp @@ -0,0 +1,49 @@ +# Copyright (c) 2015 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': 'enable_winrt_10_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'10.0.10240.0', + 'msvs_target_platform_minversion':'10.0.10240.0' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_10_platversion_nominver_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'10.0.10240.0', + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_9_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'msvs_target_platform_version':'9.0.0.0', + 'msvs_target_platform_minversion':'9.0.0.0' + 'sources': [ + 'dllmain.cc', + ], + }, + { + 'target_name': 'enable_winrt_missing_platversion_dll', + 'type': 'shared_library', + 'msvs_enable_winrt': 1, + 'msvs_application_type_revision': '10.0', + 'sources': [ + 'dllmain.cc', + ], + }, + ] +} |