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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
borenet 2013/07/16 15:16:39 This is a rough sketch of what a test might look l
2
3 # Copyright (c) 2013 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 """
8 Test that the generator output can be written to a different drive on Windows.
9 """
10
11 import TestGyp
12 import subprocess
13 import sys
14
15
16 if sys.platform == 'win32':
17 test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
18
19 def GetFirstFreeDriveLetter():
20 """ Returns the first unused Windows drive letter in [A, Z] """
21 all_letters = [c for c in string.uppercase]
22 in_use = win32api.GetLogicalDriveStrings()
23 free = list(set(all_letters) - set(in_use))
24 return free[0]
25
26 output_dir = os.path.join('different-drive', 'output')
27 output_drive = GetFirstFreeDriveLetter()
28 subprocess.call(['net', 'use', '%c:' % output_drive,
29 '\\\\localhost\%s' % os.path.abspath(output_drive).replace(':', '$')])
30 try:
31 test.run_gyp('prog.gyp', '--generator-output=%s' % (
32 os.path.join(output_drive, 'output')))
33
34 test.build('prog.gyp', test.ALL)
35 test.must_exist(os.path.join(output_drive, 'output', 'Debug',
36 'program.exe'))
37
38 test.pass_test()
39 finally:
40 subprocess.call(['net', 'use', '%c:' % output_drive, '/delete'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698