Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py

Issue 18991011: On Windows, don't try to create relative paths across different drives (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py
===================================================================
--- test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py (revision 0)
+++ test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py (revision 0)
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
borenet 2013/07/16 15:16:39 This is a rough sketch of what a test might look l
+
+# 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 TestGyp
+import subprocess
+import sys
+
+
+if sys.platform == 'win32':
+ 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')
+ output_drive = GetFirstFreeDriveLetter()
+ subprocess.call(['net', 'use', '%c:' % output_drive,
+ '\\\\localhost\%s' % os.path.abspath(output_drive).replace(':', '$')])
+ try:
+ test.run_gyp('prog.gyp', '--generator-output=%s' % (
+ os.path.join(output_drive, 'output')))
+
+ test.build('prog.gyp', test.ALL)
+ test.must_exist(os.path.join(output_drive, 'output', 'Debug',
+ 'program.exe'))
+
+ test.pass_test()
+ finally:
+ subprocess.call(['net', 'use', '%c:' % output_drive, '/delete'])

Powered by Google App Engine
This is Rietveld 408576698