Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: native_client_sdk/src/build_tools/tests/parse_dsc_test.py

Issue 1388503003: [NaCl SDK] Remove newlib toolchain from the SDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import copy 6 import copy
7 import datetime 7 import datetime
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 import unittest 12 import unittest
13 13
14 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) 14 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
15 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) 15 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
16 16
17 sys.path.append(BUILD_TOOLS_DIR) 17 sys.path.append(BUILD_TOOLS_DIR)
18 import generate_make 18 import generate_make
19 import parse_dsc 19 import parse_dsc
20 20
21 BASIC_DESC = { 21 BASIC_DESC = {
22 'TOOLS': ['newlib', 'glibc'], 22 'TOOLS': ['clang-newlib', 'glibc'],
23 'TARGETS': [ 23 'TARGETS': [
24 { 24 {
25 'NAME' : 'hello_world', 25 'NAME' : 'hello_world',
26 'TYPE' : 'main', 26 'TYPE' : 'main',
27 'SOURCES' : ['hello_world.c'], 27 'SOURCES' : ['hello_world.c'],
28 }, 28 },
29 ], 29 ],
30 'DEST' : 'examples/api' 30 'DEST' : 'examples/api'
31 } 31 }
32 32
(...skipping 28 matching lines...) Expand all
61 testdesc = copy.deepcopy(BASIC_DESC) 61 testdesc = copy.deepcopy(BASIC_DESC)
62 testdesc['TARGETS'] = [] 62 testdesc['TARGETS'] = []
63 self._validate(testdesc, 'Expected non-empty value for TARGETS.') 63 self._validate(testdesc, 'Expected non-empty value for TARGETS.')
64 64
65 testdesc = copy.deepcopy(BASIC_DESC) 65 testdesc = copy.deepcopy(BASIC_DESC)
66 testdesc['TARGETS'][0]['NAME'] = '' 66 testdesc['TARGETS'][0]['NAME'] = ''
67 self._validate(testdesc, 'Expected non-empty value for NAME.') 67 self._validate(testdesc, 'Expected non-empty value for NAME.')
68 68
69 def testBadValue(self): 69 def testBadValue(self):
70 testdesc = copy.deepcopy(BASIC_DESC) 70 testdesc = copy.deepcopy(BASIC_DESC)
71 testdesc['TOOLS'] = ['newlib', 'glibc', 'badtool'] 71 testdesc['TOOLS'] = ['clang-newlib', 'glibc', 'badtool']
72 self._validate(testdesc, 'Value badtool not expected in TOOLS.') 72 self._validate(testdesc, 'Value badtool not expected in TOOLS.')
73 73
74 def testExpectStr(self): 74 def testExpectStr(self):
75 testdesc = copy.deepcopy(BASIC_DESC) 75 testdesc = copy.deepcopy(BASIC_DESC)
76 testdesc['TOOLS'] = ['newlib', True, 'glibc'] 76 testdesc['TOOLS'] = ['clang-newlib', True, 'glibc']
77 self._validate(testdesc, 'Value True not expected in TOOLS.') 77 self._validate(testdesc, 'Value True not expected in TOOLS.')
78 78
79 def testExpectList(self): 79 def testExpectList(self):
80 testdesc = copy.deepcopy(BASIC_DESC) 80 testdesc = copy.deepcopy(BASIC_DESC)
81 testdesc['TOOLS'] = 'newlib' 81 testdesc['TOOLS'] = 'clang-newlib'
82 self._validate(testdesc, 'Key TOOLS expects LIST not STR.') 82 self._validate(testdesc, 'Key TOOLS expects LIST not STR.')
83 83
84 # TODO(bradnelson): Add test which generates a real make and runs it. 84 # TODO(bradnelson): Add test which generates a real make and runs it.
85 85
86 if __name__ == '__main__': 86 if __name__ == '__main__':
87 unittest.main() 87 unittest.main()
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/tests/build_artifacts_test.py ('k') | native_client_sdk/src/examples/demo/drive/example.dsc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698