OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 # Test that optional paths are used regardless of whether they exist. | 79 # Test that optional paths are used regardless of whether they exist. |
80 options = MockOptions(configuration='Release', build_directory='/foo') | 80 options = MockOptions(configuration='Release', build_directory='/foo') |
81 self.assert_build_path(options, ['/mock-checkout/out/Release'], '/foo/Re
lease') | 81 self.assert_build_path(options, ['/mock-checkout/out/Release'], '/foo/Re
lease') |
82 | 82 |
83 # Test that optional relative paths are returned unmodified. | 83 # Test that optional relative paths are returned unmodified. |
84 options = MockOptions(configuration='Release', build_directory='foo') | 84 options = MockOptions(configuration='Release', build_directory='foo') |
85 self.assert_build_path(options, ['/mock-checkout/out/Release'], 'foo/Rel
ease') | 85 self.assert_build_path(options, ['/mock-checkout/out/Release'], 'foo/Rel
ease') |
86 | 86 |
87 # Test that we prefer the legacy dir over the new dir. | 87 # Test that we prefer the legacy dir over the new dir. |
88 options = MockOptions(configuration='Release', build_directory=None) | 88 options = MockOptions(configuration='Release', build_directory=None) |
89 self.assert_build_path(options, ['/mock-checkout/xcodebuild/Release', '/
mock-checkout/out/Release'], '/mock-checkout/xcodebuild/Release') | 89 self.assert_build_path(options, |
| 90 ['/mock-checkout/xcodebuild/Release', |
| 91 '/mock-checkout/out/Release'], |
| 92 '/mock-checkout/xcodebuild/Release') |
90 | 93 |
91 def test_build_path_timestamps(self): | 94 def test_build_path_timestamps(self): |
92 options = MockOptions(configuration='Release', build_directory=None) | 95 options = MockOptions(configuration='Release', build_directory=None) |
93 port = self.make_port(options=options) | 96 port = self.make_port(options=options) |
94 port.host.filesystem.maybe_make_directory('/mock-checkout/out/Release') | 97 port.host.filesystem.maybe_make_directory('/mock-checkout/out/Release') |
95 port.host.filesystem.maybe_make_directory('/mock-checkout/xcodebuild/Rel
ease') | 98 port.host.filesystem.maybe_make_directory('/mock-checkout/xcodebuild/Rel
ease') |
96 # Check with 'out' being newer. | 99 # Check with 'out' being newer. |
97 port.host.filesystem.mtime = lambda f: 5 if '/out/' in f else 4 | 100 port.host.filesystem.mtime = lambda f: 5 if '/out/' in f else 4 |
98 self.assertEqual(port._build_path(), '/mock-checkout/out/Release') | 101 self.assertEqual(port._build_path(), '/mock-checkout/out/Release') |
99 # Check with 'xcodebuild' being newer. | 102 # Check with 'xcodebuild' being newer. |
100 port.host.filesystem.mtime = lambda f: 5 if '/xcodebuild/' in f else 4 | 103 port.host.filesystem.mtime = lambda f: 5 if '/xcodebuild/' in f else 4 |
101 self.assertEqual(port._build_path(), '/mock-checkout/xcodebuild/Release'
) | 104 self.assertEqual(port._build_path(), '/mock-checkout/xcodebuild/Release'
) |
102 | 105 |
103 def test_driver_name_option(self): | 106 def test_driver_name_option(self): |
104 self.assertTrue(self.make_port()._path_to_driver().endswith('Content She
ll')) | 107 self.assertTrue(self.make_port()._path_to_driver().endswith('Content She
ll')) |
105 self.assertTrue(self.make_port(options=MockOptions(driver_name='OtherDri
ver'))._path_to_driver().endswith('OtherDriver')) | 108 self.assertTrue(self.make_port(options=MockOptions(driver_name='OtherDri
ver'))._path_to_driver().endswith('OtherDriver')) |
106 | 109 |
107 def test_path_to_image_diff(self): | 110 def test_path_to_image_diff(self): |
108 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff') | 111 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff') |
OLD | NEW |