Index: test/win/gyptest-link_delay_load_dlls.py |
diff --git a/test/win/gyptest-link_delay_load_dlls.py b/test/win/gyptest-link_delay_load_dlls.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..69e6b9643b6c80271e18738732d353984d22068a |
--- /dev/null |
+++ b/test/win/gyptest-link_delay_load_dlls.py |
@@ -0,0 +1,50 @@ |
+#!/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 subprocess |
+import sys |
+ |
+if sys.platform == 'win32': |
+ test = TestGyp.TestGyp(formats=['ninja', 'msvs']) |
+ |
+ CHDIR = 'linker_flags' |
+ test.run_gyp('delay-load-dlls.gyp', chdir=CHDIR) |
+ test.build('delay-load-dlls.gyp', test.ALL, chdir=CHDIR) |
+ |
+ def CheckForDumpedString(binary, string): |
+ proc = subprocess.Popen(['dumpbin', '/all', binary], |
+ stdout=subprocess.PIPE) |
+ output = proc.communicate()[0] |
+ assert not proc.returncode |
+ if string not in output: |
+ print 'Did not find "%s" in %s' % (string, binary) |
+ test.fail_test() |
+ |
+ CheckForDumpedString(test.built_file_path('test_dld_few.exe', chdir=CHDIR), |
+ 'contains the following delay load imports:\r\n\r\n SHELL32.dll') |
+ |
+ if test.format == 'ninja': |
+ ninja_file = test.built_file_path('obj/test_dld_none.ninja', chdir=CHDIR) |
+ test.must_not_contain(ninja_file, '/DELAYLOAD') |
+ |
+ ninja_file = test.built_file_path('obj/test_dld_empty.ninja', chdir=CHDIR) |
+ test.must_not_contain(ninja_file, '/DELAYLOAD') |
+ |
+ ninja_file = test.built_file_path('obj/test_dld_one.ninja', chdir=CHDIR) |
+ test.must_contain(ninja_file, '/DELAYLOAD:dwmapi') |
+ |
+ ninja_file = test.built_file_path('obj/test_dld_few.ninja', chdir=CHDIR) |
+ test.must_contain(ninja_file, '/DELAYLOAD:dbghelp') |
+ test.must_contain(ninja_file, '/DELAYLOAD:shell32') |
+ test.must_contain(ninja_file, '/DELAYLOAD:uxtheme') |
+ |
+ test.pass_test() |