gyptest-command-quote.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Make sure the program in a command can be a called batch file, or an
  7. application in the path. Specifically, this means not quoting something like
  8. "call x.bat", lest the shell look for a program named "call x.bat", rather
  9. than calling "x.bat".
  10. """
  11. import TestGyp
  12. import sys
  13. if sys.platform == 'win32':
  14. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  15. CHDIR = 'command-quote'
  16. test.run_gyp('command-quote.gyp', chdir=CHDIR)
  17. test.build('command-quote.gyp', 'test_batch', chdir=CHDIR)
  18. test.build('command-quote.gyp', 'test_call_separate', chdir=CHDIR)
  19. test.build('command-quote.gyp', 'test_with_double_quotes', chdir=CHDIR)
  20. test.build('command-quote.gyp', 'test_with_single_quotes', chdir=CHDIR)
  21. # We confirm that this fails because other generators don't handle spaces in
  22. # inputs so it's preferable to not have it work here.
  23. test.build('command-quote.gyp', 'test_with_spaces', chdir=CHDIR, status=1)
  24. CHDIR = 'command-quote/subdir/and/another'
  25. test.run_gyp('in-subdir.gyp', chdir=CHDIR)
  26. test.build('in-subdir.gyp', 'test_batch_depth', chdir=CHDIR)
  27. test.pass_test()