Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 build of a static_library with the standalone_static_library flag set. | |
| 9 """ | |
| 10 | |
| 11 import os | |
| 12 import subprocess | |
| 13 import sys | |
| 14 import TestGyp | |
| 15 | |
| 16 test = TestGyp.TestGyp() | |
| 17 | |
| 18 test.run_gyp('mylib.gyp') | |
| 19 test.build('mylib.gyp', target='prog') | |
| 20 | |
| 21 # Verify that the static library is copied to PRODUCT_DIR | |
|
Nico
2012/10/03 03:42:14
nit:Style guide says to have trailing '.'s on all
| |
| 22 built_lib = test.built_file_basename('mylib', type=test.STATIC_LIB) | |
| 23 path = test.built_file_path(built_lib) | |
| 24 test.must_exist(path) | |
| 25 | |
| 26 # Verify that the program runs properly | |
| 27 expect = 'hello from mylib.c\n' | |
| 28 test.run_built_executable('prog', stdout=expect) | |
| 29 | |
| 30 # Verify that libmylib.a contains symbols. "ar -x" fails on a 'thin' archive. | |
| 31 if test.format in ('make', 'ninja') and sys.platform.startswith('linux'): | |
| 32 retcode = subprocess.call(['ar', '-x', path]) | |
| 33 assert retcode == 0 | |
| 34 | |
| 35 test.pass_test() | |
| OLD | NEW |