Skip to content

Commit 1bb9ac7

Browse files
Merge branch 'master' into fix_pyocd_copy_plugin
2 parents 28e548b + 501117d commit 1bb9ac7

File tree

8 files changed

+138
-16
lines changed

8 files changed

+138
-16
lines changed

.circleci/config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ commands:
5454
- run:
5555
name: Enforce styling
5656
command: python -m flake8
57-
combine_and_send_coverage:
58-
steps:
59-
- run:
60-
name: Combine all coverage results
61-
command: python -m coverage combine .coverage packages/*/.coverage
62-
- run:
63-
name: Send coverage results to coveralls
64-
command: python -m coveralls
6557
jobs:
6658
test_python27:
6759
docker:
@@ -83,7 +75,6 @@ jobs:
8375
- image: python:3.7-stretch
8476
steps:
8577
- setup_and_run_tests
86-
- combine_and_send_coverage
8778

8879
style_enforcement:
8980
docker:

azure-pipelines.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
jobs:
2+
-
3+
job: Test
4+
strategy:
5+
matrix:
6+
LinuxPython27:
7+
python.version: '2.7'
8+
imageName: ubuntu-16.04
9+
extraActions: 'false'
10+
LinuxPython35:
11+
python.version: '3.5'
12+
imageName: ubuntu-16.04
13+
extraActions: 'false'
14+
LinuxPython36:
15+
python.version: '3.6'
16+
imageName: ubuntu-16.04
17+
extraActions: 'false'
18+
LinuxPython37:
19+
python.version: '3.7'
20+
imageName: ubuntu-16.04
21+
extraActions: 'true'
22+
MacPython27:
23+
python.version: '2.7'
24+
imageName: macos-10.13
25+
extraActions: 'false'
26+
MacPython35:
27+
python.version: '3.5'
28+
imageName: macos-10.13
29+
extraActions: 'false'
30+
MacPython36:
31+
python.version: '3.6'
32+
imageName: macos-10.13
33+
extraActions: 'false'
34+
MacPython37:
35+
python.version: '3.7'
36+
imageName: macos-10.13
37+
extraActions: 'false'
38+
WindowsPython27:
39+
python.version: '2.7'
40+
imageName: vs2017-win2016
41+
extraActions: 'false'
42+
WindowsPython35:
43+
python.version: '3.5'
44+
imageName: vs2017-win2016
45+
extraActions: 'false'
46+
WindowsPython36:
47+
python.version: '3.6'
48+
imageName: vs2017-win2016
49+
extraActions: 'false'
50+
WindowsPython37:
51+
python.version: '3.7'
52+
imageName: vs2017-win2016
53+
extraActions: 'false'
54+
maxParallel: 10
55+
pool:
56+
vmImage: $(imageName)
57+
steps:
58+
-
59+
task: UsePythonVersion@0
60+
inputs:
61+
versionSpec: $(python.version)
62+
architecture: x64
63+
-
64+
script: 'python -m pip install --upgrade pip && pip install -r test_requirements.txt && pip install pytest'
65+
displayName: 'Install mbed-os test dependencies'
66+
-
67+
script: |
68+
pip install --user flake8
69+
python -m flake8
70+
condition: eq(variables['extraActions'], 'true')
71+
displayName: 'Enforce code style'
72+
-
73+
script: "python -m coverage run setup.py test"
74+
displayName: "Test mbed-os-tools"
75+
-
76+
script: "pip install ."
77+
displayName: "Install mbed-os-tools"
78+
-
79+
script: 'pip install . && pip install -r test_requirements.txt'
80+
displayName: 'Install mbed-ls'
81+
workingDirectory: 'packages/mbed-ls'
82+
-
83+
script: 'pip install . && pip install -r test_requirements.txt'
84+
displayName: 'Install mbed-host-tests'
85+
workingDirectory: 'packages/mbed-host-tests'
86+
-
87+
script: 'pip install . && pip install -r test_requirements.txt'
88+
displayName: 'Install mbed-greentea'
89+
workingDirectory: 'packages/mbed-greentea'
90+
-
91+
script: "python -m coverage run setup.py test"
92+
displayName: "Test mbed-ls"
93+
workingDirectory: 'packages/mbed-ls'
94+
-
95+
script: "python -m coverage run setup.py test"
96+
displayName: "Test mbed-host-tests"
97+
workingDirectory: 'packages/mbed-host-tests'
98+
-
99+
script: "python -m coverage run setup.py test"
100+
displayName: "Test mbed-greentea"
101+
workingDirectory: 'packages/mbed-greentea'
102+
-
103+
script: |
104+
python -m coverage combine .coverage packages/*/.coverage
105+
python -m coveralls
106+
condition: eq(variables['extraActions'], 'true')
107+
displayName: 'Send coverage results to coveralls'
108+
-
109+
job: Build
110+
dependsOn: Test
111+
pool:
112+
vmImage: Ubuntu-16.04
113+
steps:
114+
-
115+
task: UsePythonVersion@0
116+
inputs:
117+
versionSpec: 3.x
118+
architecture: x64
119+
-
120+
script: 'python setup.py sdist'
121+
displayName: 'Build sdist'

packages/mbed-greentea/test/mbed_gt_cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ def test_get_greentea_version(self):
7474
def test_print_version(self):
7575
version = mbed_greentea_cli.get_greentea_version()
7676

77+
old_stdout = sys.stdout
7778
sys.stdout = stdout_capture = six.StringIO()
7879
mbed_greentea_cli.print_version()
79-
sys.stdout = sys.__stdout__
80+
sys.stdout = old_stdout
8081

8182
printed_version = stdout_capture.getvalue().splitlines()[0]
8283
self.assertEqual(printed_version, version)

packages/mbed-greentea/test/mbed_gt_cmake_handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ def test_list_binaries_for_targets(self):
100100
full_path = os.path.join(root_path, "resources")
101101

102102
def run_and_capture(path, verbose=False):
103+
old_stdout = sys.stdout
103104
sys.stdout = stdout_capture = six.StringIO()
104105
cmake_handlers.list_binaries_for_targets(build_dir=path, verbose_footer=verbose)
105-
sys.stdout = sys.__stdout__
106+
sys.stdout = old_stdout
106107

107108
return stdout_capture.getvalue()
108109

@@ -128,9 +129,10 @@ def test_list_binaries_for_builds(self):
128129

129130
for verbose in [True, False]:
130131
# Capture logging output
132+
old_stdout = sys.stdout
131133
sys.stdout = stdout_capture = six.StringIO()
132134
cmake_handlers.list_binaries_for_builds(spec, verbose_footer=verbose)
133-
sys.stdout = sys.__stdout__
135+
sys.stdout = old_stdout
134136

135137
output = stdout_capture.getvalue()
136138
self.assertTrue("available tests for build 'K64F-ARM'" in output)

packages/mbed-greentea/test/mbed_gt_report_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,10 @@ def test_export_to_file(self):
105105
payload = "PAYLOAD"
106106
filepath = "."
107107

108+
old_stdout = sys.stdout
108109
sys.stdout = stdout_capture = six.StringIO()
109110
result = mbed_report_api.export_to_file(filepath, payload)
110-
sys.stdout = sys.__stdout__
111+
sys.stdout = old_stdout
111112

112113
command_output = stdout_capture.getvalue().splitlines()[0]
113114
self.assertIn("file failed:", command_output)

src/mbed_os_tools/detect/platform_database.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@
236236
u"2035": u"EFM32PG_STK3401",
237237
u"2040": u"EFM32PG12_STK3402",
238238
u"2041": u"TB_SENSE_12",
239+
u"2042": u"EFM32GG11_STK3701",
240+
u"2043": u"EFM32TG11_STK3301",
239241
u"2045": u"TB_SENSE_1",
240242
u"2100": u"XBED_LPC1768",
241243
u"2201": u"WIZWIKI_W7500",
@@ -285,6 +287,7 @@
285287
u"8003": u"UNO_81AM",
286288
u"8004": u"UNO_81A",
287289
u"8012": u"TT_M3HQ",
290+
u"8013": u"TT_M4G9",
288291
u"8080": u"FF1705_L151CC",
289292
u"8081": u"FF_LPC546XX",
290293
u"9001": u"LPC1347",

test/test/mbed_gt_cmake_handlers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ def test_list_binaries_for_targets(self):
9898
full_path = os.path.join(root_path, "resources")
9999

100100
def run_and_capture(path, verbose=False):
101+
old_stdout = sys.stdout
101102
sys.stdout = stdout_capture = six.StringIO()
102103
cmake_handlers.list_binaries_for_targets(build_dir=path, verbose_footer=verbose)
103-
sys.stdout = sys.__stdout__
104+
sys.stdout = old_stdout
104105

105106
return stdout_capture.getvalue()
106107

@@ -126,9 +127,10 @@ def test_list_binaries_for_builds(self):
126127

127128
for verbose in [True, False]:
128129
# Capture logging output
130+
old_stdout = sys.stdout
129131
sys.stdout = stdout_capture = six.StringIO()
130132
cmake_handlers.list_binaries_for_builds(spec, verbose_footer=verbose)
131-
sys.stdout = sys.__stdout__
133+
sys.stdout = old_stdout
132134

133135
output = stdout_capture.getvalue()
134136
self.assertTrue("available tests for build 'K64F-ARM'" in output)

test/test/mbed_gt_report_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ def test_export_to_file(self):
106106
payload = "PAYLOAD"
107107
filepath = "."
108108

109+
old_stdout = sys.stdout
109110
sys.stdout = stdout_capture = six.StringIO()
110111
result = mbed_report_api.export_to_file(filepath, payload)
111-
sys.stdout = sys.__stdout__
112+
sys.stdout = old_stdout
112113

113114
command_output = stdout_capture.getvalue().splitlines()[0]
114115
self.assertIn("file failed:", command_output)

0 commit comments

Comments
 (0)