1342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch#!/usr/bin/env python 2342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 3342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# Copyright (c) 2012 Google Inc. All rights reserved. 4342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# Use of this source code is governed by a BSD-style license that can be 5342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# found in the LICENSE file. 6342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 7342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch""" 8342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen MurdochVerifies simplest-possible build of a "Hello, world!" program 9342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochusing the default build target. 10342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch""" 11342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 12342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochimport TestGyp 13342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 14342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest = TestGyp.TestGyp() 15342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 16342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.run_gyp('product.gyp') 17342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.build('product.gyp') 18342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 19342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# executables 20342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('alt1' + test._exe, test.EXECUTABLE, bare=True) 21342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('hello2.stuff', test.EXECUTABLE, bare=True) 22342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('yoalt3.stuff', test.EXECUTABLE, bare=True) 23342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 24342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# shared libraries 25342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist(test.dll_ + 'alt4' + test._dll, 26342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch test.SHARED_LIB, bare=True) 27342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist(test.dll_ + 'hello5.stuff', 28342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch test.SHARED_LIB, bare=True) 29342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('yoalt6.stuff', test.SHARED_LIB, bare=True) 30342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 31342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# static libraries 32342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist(test.lib_ + 'alt7' + test._lib, 33342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch test.STATIC_LIB, bare=True) 34342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist(test.lib_ + 'hello8.stuff', 35342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch test.STATIC_LIB, bare=True) 36342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('yoalt9.stuff', test.STATIC_LIB, bare=True) 37342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 38342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch# alternate product_dir 39342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('bob/yoalt10.stuff', test.EXECUTABLE, bare=True) 40342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('bob/yoalt11.stuff', test.EXECUTABLE, bare=True) 41342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.built_file_must_exist('bob/yoalt12.stuff', test.EXECUTABLE, bare=True) 42342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdoch 43342c50ce1624b485728b9a4fc41d8bbf37eb46cfBen Murdochtest.pass_test() 44