file.
Args:
- fname (str): Filename to send output to, or '-' for stdout
+ fname (str): Filename to send output to, or None for stdout
"""
- if fname == '-':
- self._outfile = sys.stdout
- else:
+ if fname:
self._outfile = open(fname, 'w')
+ else:
+ self._outfile = sys.stdout
def out(self, line):
"""Output a string to the output file
args (list): List of non-option arguments provided to the problem
dtb_file (str): Filename of dtb file to process
include_disabled (bool): True to include disabled nodes
- output (str): Name of output file
+ output (str): Name of output file (None for stdout)
warning_disabled (bool): True to avoid showing warnings about missing
drivers
drivers_additional (list): List of additional drivers to use during
help='Specify the .dtb input file')
parser.add_option('--include-disabled', action='store_true',
help='Include disabled nodes')
-parser.add_option('-o', '--output', action='store', default='-',
+parser.add_option('-o', '--output', action='store',
help='Select output filename')
parser.add_option('-P', '--processes', type=int,
help='set number of processes to use for running tests')
"""Test output to stdout"""
dtb_file = get_dtb_file('dtoc_test_simple.dts')
with test_util.capture_sys_output() as _:
- self.run_test(['struct'], dtb_file, '-')
+ self.run_test(['struct'], dtb_file, None)
def test_no_command(self):
"""Test running dtoc without a command"""