summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/gen_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-doc/gen_tests.py')
-rw-r--r--clang-tools-extra/clang-doc/gen_tests.py33
1 files changed, 8 insertions, 25 deletions
diff --git a/clang-tools-extra/clang-doc/gen_tests.py b/clang-tools-extra/clang-doc/gen_tests.py
index 9259684d588..ccdb069c433 100644
--- a/clang-tools-extra/clang-doc/gen_tests.py
+++ b/clang-tools-extra/clang-doc/gen_tests.py
@@ -18,19 +18,16 @@ accuracy before using.
To generate all current tests:
- Generate mapper tests:
- python gen_tests.py -flag='--dump-mapper' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix mapper -use-check-next
+ python gen_tests.py -flag='--dump-mapper' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix mapper
- Generate reducer tests:
- python gen_tests.py -flag='--dump-intermediate' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix bc -use-check-next
+ python gen_tests.py -flag='--dump-intermediate' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix bc
- Generate yaml tests:
- python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix yaml -use-check-next
+ python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--extra-arg=-fmodules-ts' -prefix yaml
- Generate public decl tests:
- python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix public -use-check-next
-
-- Generate Markdown tests:
- python gen_tests.py -flag='--format=md' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix md
+ python gen_tests.py -flag='--format=yaml' -flag='--doxygen' -flag='--public' -flag='--extra-arg=-fmodules-ts' -prefix public
This script was written on/for Linux, and has not been tested on any other
platform and so it may not work.
@@ -98,8 +95,7 @@ def get_test_case_code(test_case_path, flags):
return code
-def get_output(root, out_file, case_out_path, flags, checkname, bcanalyzer,
- check_next=True):
+def get_output(root, out_file, case_out_path, flags, checkname, bcanalyzer):
output = ''
run_cmd = ''
if '--dump-mapper' in flags or '--dump-intermediate' in flags:
@@ -123,14 +119,8 @@ def get_output(root, out_file, case_out_path, flags, checkname, bcanalyzer,
output = re.sub(YAML_USR_REGEX, YAML_USR, output)
output = re.sub(BITCODE_USR_REGEX, BITCODE_USR, output)
output = CHECK.format(checkname) + output.rstrip()
-
- if check_next:
- check_comment = CHECK_NEXT.format(checkname)
- else:
- check_comment = CHECK.format(checkname)
-
- output = output.replace('\n', '\n' + check_comment)
- output = run_cmd + output.replace('%s\n' % check_comment, "")
+ output = run_cmd + output.replace('\n',
+ '\n' + CHECK_NEXT.format(checkname))
return output + '\n'
@@ -161,12 +151,6 @@ def main():
metavar="PATH",
default='llvm-bcanalyzer',
help='path to llvm-bcanalyzer binary')
- parser.add_argument(
- '-use-check-next',
- dest='check_next',
- default=False,
- action='store_true',
- help='Whether or not to use CHECK-NEXT in the resulting tests.')
args = parser.parse_args()
flags = ' '.join(args.flags)
@@ -204,8 +188,7 @@ def main():
if len(usr) < 2:
continue
all_output += get_output(root, out_file, out_dir, args.flags,
- num_outputs, args.bcanalyzer,
- args.check_next)
+ num_outputs, args.bcanalyzer)
num_outputs += 1
# Add test case code to test
OpenPOWER on IntegriCloud