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

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: remove .exe 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
« no previous file with comments | « pylib/gyp/common.py ('k') | test/win/generator-output-different-drive/prog.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
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 os
12 import TestGyp
13 import string
14 import subprocess
15 import sys
16
17
18 if sys.platform == 'win32':
19 import win32api
20
21 test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
22
23 def GetFirstFreeDriveLetter():
24 """ Returns the first unused Windows drive letter in [A, Z] """
25 all_letters = [c for c in string.uppercase]
26 in_use = win32api.GetLogicalDriveStrings()
27 free = list(set(all_letters) - set(in_use))
28 return free[0]
29
30 output_dir = os.path.join('different-drive', 'output')
31 if not os.path.isdir(os.path.abspath(output_dir)):
32 os.makedirs(os.path.abspath(output_dir))
33 output_drive = GetFirstFreeDriveLetter()
34 subprocess.call(['subst', '%c:' % output_drive, os.path.abspath(output_dir)])
35 try:
36 test.run_gyp('prog.gyp', '--generator-output=%s' % (
37 os.path.join(output_drive, 'output')))
38 test.build('prog.gyp', test.ALL, chdir=os.path.join(output_drive, 'output'))
39 test.built_file_must_exist('program', chdir=os.path.join(output_drive,
40 'output'),
41 type=test.EXECUTABLE)
42 test.pass_test()
43 finally:
44 subprocess.call(['subst', '%c:' % output_drive, '/D'])
OLDNEW
« no previous file with comments | « pylib/gyp/common.py ('k') | test/win/generator-output-different-drive/prog.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698