Home | History | Annotate | Download | only in target
      1 #!/usr/bin/env python
      2 
      3 # Copyright (c) 2009 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 Verifies simplest-possible build of a "Hello, world!" program
      9 using non-default extension. In particular, verifies how
     10 target_extension is used to avoid MSB8012 for msvs.
     11 """
     12 
     13 import sys
     14 import TestGyp
     15 
     16 if sys.platform in ('win32', 'cygwin'):
     17   test = TestGyp.TestGyp()
     18 
     19   test.run_gyp('target.gyp')
     20   test.build('target.gyp')
     21 
     22   # executables
     23   test.built_file_must_exist('hello1.stuff', test.EXECUTABLE, bare=True)
     24   test.built_file_must_exist('hello2.exe', test.EXECUTABLE, bare=True)
     25   test.built_file_must_not_exist('hello2.stuff', test.EXECUTABLE, bare=True)
     26 
     27   # check msvs log for errors
     28   if test.format == "msvs":
     29     log_file = "obj\\hello1\\hello1.log"
     30     test.built_file_must_exist(log_file)
     31     test.built_file_must_not_contain(log_file, "MSB8012")
     32 
     33     log_file = "obj\\hello2\\hello2.log"
     34     test.built_file_must_exist(log_file)
     35     test.built_file_must_not_contain(log_file, "MSB8012")
     36 
     37   test.pass_test()
     38