dtoc: Allow outputing to multiple files
Implement the 'output directory' feature, allowing dtoc to write the
output files separately to the supplied directories. This allows us to
handle the struct and platdata output in one run of dtoc.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py
index b023a1e..6f9af90 100755
--- a/tools/dtoc/test_dtoc.py
+++ b/tools/dtoc/test_dtoc.py
@@ -884,6 +884,14 @@
self.run_test(['struct'], dtb_file, None)
self._check_strings(self.struct_text, stdout.getvalue())
+ def test_multi_to_file(self):
+ """Test output of multiple pieces to a single file"""
+ dtb_file = get_dtb_file('dtoc_test_simple.dts')
+ output = tools.GetOutputFilename('output')
+ self.run_test(['struct,platdata'], dtb_file, output)
+ data = tools.ReadFile(output, binary=False)
+ self._check_strings(self.struct_text + self.platdata_text, data)
+
def test_no_command(self):
"""Test running dtoc without a command"""
with self.assertRaises(ValueError) as exc: