Updated test case documentation tool to handle multifile test cases
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
## limitations under the License.
|
## limitations under the License.
|
||||||
##
|
##
|
||||||
|
|
||||||
|
import os
|
||||||
import yaml
|
import yaml
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
|
|
||||||
@@ -52,8 +52,13 @@ with open(r'tests/test_cases.yaml') as f:
|
|||||||
tc.write(config)
|
tc.write(config)
|
||||||
tc.write("\n```\n")
|
tc.write("\n```\n")
|
||||||
tc.write("## Source code\n")
|
tc.write("## Source code\n")
|
||||||
|
for source_file in os.listdir("tests/{0}/".format(name)):
|
||||||
|
if source_file.endswith(".h") or source_file.endswith(".cc"):
|
||||||
|
if source_file == "test_case.h":
|
||||||
|
continue
|
||||||
|
tc.write("File {}\n".format(source_file))
|
||||||
tc.write("```cpp\n")
|
tc.write("```cpp\n")
|
||||||
tc.write(open('tests/{0}/{0}.cc'.format(name), 'r').read())
|
tc.write(open('tests/{0}/{1}'.format(name, source_file), 'r').read())
|
||||||
tc.write("\n```\n")
|
tc.write("\n```\n")
|
||||||
|
|
||||||
# Copy and link the diagram image
|
# Copy and link the diagram image
|
||||||
|
|||||||
Reference in New Issue
Block a user