Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
gn_test.GNTestCase Class Reference
Inheritance diagram for gn_test.GNTestCase:

Public Member Functions

 test_get_out_dir (self)
 
 test_to_gn_args (self)
 
 test_cannot_use_android_and_enable_unittests (self)
 
 test_cannot_use_ios_and_enable_unittests (self)
 
 test_parse_size (self)
 

Protected Member Functions

 _expect_build_dir (self, arg_list, expected_build_dir)
 
 _gn_args (self, arg_list)
 

Detailed Description

Definition at line 13 of file gn_test.py.

Member Function Documentation

◆ _expect_build_dir()

gn_test.GNTestCase._expect_build_dir (   self,
  arg_list,
  expected_build_dir 
)
protected

Definition at line 15 of file gn_test.py.

15 def _expect_build_dir(self, arg_list, expected_build_dir):
16 args = gn.parse_args(['gn'] + arg_list)
17 self.assertEqual(gn.get_out_dir(args), expected_build_dir)
18
parse_args(args)
Definition gn.py:575

◆ _gn_args()

gn_test.GNTestCase._gn_args (   self,
  arg_list 
)
protected

Definition at line 33 of file gn_test.py.

33 def _gn_args(self, arg_list):
34 args = gn.parse_args(['gn'] + arg_list)
35 return gn.to_gn_args(args)
36

◆ test_cannot_use_android_and_enable_unittests()

gn_test.GNTestCase.test_cannot_use_android_and_enable_unittests (   self)

Definition at line 44 of file gn_test.py.

44 def test_cannot_use_android_and_enable_unittests(self):
45 with self.assertRaises(Exception):
46 self._gn_args(['--android', '--enable-unittests'])
47

◆ test_cannot_use_ios_and_enable_unittests()

gn_test.GNTestCase.test_cannot_use_ios_and_enable_unittests (   self)

Definition at line 48 of file gn_test.py.

48 def test_cannot_use_ios_and_enable_unittests(self):
49 with self.assertRaises(Exception):
50 self._gn_args(['--ios', '--enable-unittests'])
51

◆ test_get_out_dir()

gn_test.GNTestCase.test_get_out_dir (   self)

Definition at line 19 of file gn_test.py.

19 def test_get_out_dir(self):
20 self._expect_build_dir(['--runtime-mode', 'debug'], os.path.join('out', 'host_debug'))
21 self._expect_build_dir(['--runtime-mode', 'release'], os.path.join('out', 'host_release'))
22 self._expect_build_dir(['--ios'], os.path.join('out', 'ios_debug'))
23 self._expect_build_dir(['--ios', '--darwin-extension-safe'],
24 os.path.join('out', 'ios_debug_extension_safe'))
25 self._expect_build_dir(['--ios', '--runtime-mode', 'release'],
26 os.path.join('out', 'ios_release'))
27 self._expect_build_dir(['--ios', '--darwin-extension-safe', '--runtime-mode', 'release'],
28 os.path.join('out', 'ios_release_extension_safe'))
29 self._expect_build_dir(['--android'], os.path.join('out', 'android_debug'))
30 self._expect_build_dir(['--android', '--runtime-mode', 'release'],
31 os.path.join('out', 'android_release'))
32

◆ test_parse_size()

gn_test.GNTestCase.test_parse_size (   self)

Definition at line 52 of file gn_test.py.

52 def test_parse_size(self):
53 self.assertEqual(gn.parse_size('5B'), 5)
54 self.assertEqual(gn.parse_size('5KB'), 5 * 2**10)
55 self.assertEqual(gn.parse_size('5MB'), 5 * 2**20)
56 self.assertEqual(gn.parse_size('5GB'), 5 * 2**30)
57
58

◆ test_to_gn_args()

gn_test.GNTestCase.test_to_gn_args (   self)

Definition at line 37 of file gn_test.py.

37 def test_to_gn_args(self):
38 # This would not necessarily be true on a 32-bit machine?
39 self.assertEqual(
40 self._gn_args(['--ios', '--simulator', '--simulator-cpu', 'x64'])['target_cpu'], 'x64'
41 )
42 self.assertEqual(self._gn_args(['--ios'])['target_cpu'], 'arm64')
43

The documentation for this class was generated from the following file: