OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 Google Inc. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies build of a static_library with the standalone_static_library flag set. | 8 Verifies build of a static_library with the standalone_static_library flag set. |
9 """ | 9 """ |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 test.built_file_path('mylib', type=standalone_static_library_dir))[0] | 37 test.built_file_path('mylib', type=standalone_static_library_dir))[0] |
38 lib_name = test.built_file_basename('mylib', type=test.STATIC_LIB) | 38 lib_name = test.built_file_basename('mylib', type=test.STATIC_LIB) |
39 path = os.path.join(path_to_lib, lib_name) | 39 path = os.path.join(path_to_lib, lib_name) |
40 test.must_exist(path) | 40 test.must_exist(path) |
41 | 41 |
42 # Verify that the program runs properly. | 42 # Verify that the program runs properly. |
43 expect = 'hello from mylib.c\n' | 43 expect = 'hello from mylib.c\n' |
44 test.run_built_executable('prog', stdout=expect) | 44 test.run_built_executable('prog', stdout=expect) |
45 | 45 |
46 # Verify that libmylib.a contains symbols. "ar -x" fails on a 'thin' archive. | 46 # Verify that libmylib.a contains symbols. "ar -x" fails on a 'thin' archive. |
47 if test.format in ('make', 'ninja') and sys.platform.startswith('linux'): | 47 supports_thick = ('make', 'ninja', 'cmake') |
| 48 if test.format in supports_thick and sys.platform.startswith('linux'): |
48 retcode = subprocess.call(['ar', '-x', path]) | 49 retcode = subprocess.call(['ar', '-x', path]) |
49 assert retcode == 0 | 50 assert retcode == 0 |
50 | 51 |
51 test.pass_test() | 52 test.pass_test() |
OLD | NEW |