Home | History | Annotate | Download | only in product
      1 #!/usr/bin/env python
      2 
      3 # Copyright (c) 2012 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 the default build target.
     10 """
     11 
     12 import TestGyp
     13 
     14 # Android does not support setting the build directory.
     15 test = TestGyp.TestGyp(formats=['!android'])
     16 
     17 test.run_gyp('product.gyp')
     18 test.build('product.gyp')
     19 
     20 # executables
     21 test.built_file_must_exist('alt1' + test._exe, test.EXECUTABLE, bare=True)
     22 test.built_file_must_exist('hello2.stuff', test.EXECUTABLE, bare=True)
     23 test.built_file_must_exist('yoalt3.stuff', test.EXECUTABLE, bare=True)
     24 
     25 # shared libraries
     26 test.built_file_must_exist(test.dll_ + 'alt4' + test._dll,
     27                            test.SHARED_LIB, bare=True)
     28 test.built_file_must_exist(test.dll_ + 'hello5.stuff',
     29                            test.SHARED_LIB, bare=True)
     30 test.built_file_must_exist('yoalt6.stuff', test.SHARED_LIB, bare=True)
     31 
     32 # static libraries
     33 test.built_file_must_exist(test.lib_ + 'alt7' + test._lib,
     34                            test.STATIC_LIB, bare=True)
     35 test.built_file_must_exist(test.lib_ + 'hello8.stuff',
     36                            test.STATIC_LIB, bare=True)
     37 test.built_file_must_exist('yoalt9.stuff', test.STATIC_LIB, bare=True)
     38 
     39 # alternate product_dir
     40 test.built_file_must_exist('bob/yoalt10.stuff', test.EXECUTABLE, bare=True)
     41 test.built_file_must_exist('bob/yoalt11.stuff', test.EXECUTABLE, bare=True)
     42 test.built_file_must_exist('bob/yoalt12.stuff', test.EXECUTABLE, bare=True)
     43 
     44 test.pass_test()
     45