16
16
17
17
import logging
18
18
import os
19
- import pdb
20
19
import subprocess
21
20
import sys
22
21
import tempfile
@@ -187,14 +186,15 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
187
186
linux_tv_app_log_path = os .path .join (temp_dir , LINUX_TV_APP_LOGS )
188
187
linux_tv_casting_app_log_path = os .path .join (temp_dir , LINUX_TV_CASTING_APP_LOGS )
189
188
190
- print (temp_dir ) # SHAO
191
-
192
189
# Open and write to the log file for the Linux tv-app.
193
190
with LogFileManager (linux_tv_app_log_path , 'w' ) as linux_tv_app_log_file :
194
191
tv_app_abs_path = os .path .abspath (tv_app_rel_path )
195
192
196
- # Try to avoid any stdout buffering in our tests.
197
- cmd = ['stdbuf' , '-o0' , '-i0' ]
193
+ if sys .platform == 'darwin' or sys .platform == 'linux' :
194
+ # Try to avoid any stdout buffering in our tests.
195
+ cmd = ['stdbuf' , '-o0' , '-i0' ]
196
+ else :
197
+ cmd = []
198
198
199
199
# Run the Linux tv-app subprocess.
200
200
with ProcessManager (cmd + [tv_app_abs_path ], stdout = subprocess .PIPE , stderr = subprocess .PIPE ) as tv_app_process :
@@ -293,7 +293,6 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
293
293
logging .info (valid_product_id )
294
294
logging .info (valid_device_type )
295
295
logging .info ('Discovery success!' )
296
- # pdb.set_trace() # SHAO
297
296
return
298
297
299
298
@@ -303,4 +302,4 @@ def test_discovery_fn(tv_app_rel_path, tv_casting_app_rel_path):
303
302
os .system ('rm -f /tmp/chip_*' )
304
303
305
304
# Test discovery between the Linux tv-casting-app and the tv-app.
306
- test_discovery_fn ()
305
+ test_discovery_fn ()
0 commit comments