;;
check-generated-output)
clean
- echo "+++ Checking the output of the generated scripts"
+ echo "+++ Checking the output of the generator scripts"
mkdir -p ${BUILD_DIR}
+ # Reject patches that introduce non-ASCII characters or hard tabs.
+ ! grep -rn '[^ -~]' libcxx/include/
+ # Reject patches that don't update the generated output correctly.
python3 libcxx/utils/generate_feature_test_macro_components.py
python3 libcxx/utils/generate_header_inclusion_tests.py
python3 libcxx/utils/generate_header_tests.py
git diff | tee ${BUILD_DIR}/generated_output.patch
# Check if the diffs are empty, fail otherwise.
! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch
+ # Check that no dependency cycles have been introduced.
+ python3 libcxx/utils/graph_header_deps.py >/dev/null
;;
generic-cxx03)
export CC=clang
import argparse
import os
import re
+import sys
def is_config_header(h):
local_includes = []
system_includes = []
linecount = 0
- with open(fname, 'r') as f:
+ with open(fname, 'r', encoding='utf-8') as f:
for line in f.readlines():
linecount += 1
m = re.match(r'\s*#\s*include\s+"([^"]*)"', line)
return graph
-def get_graphviz(graph, options):
+def get_friendly_id(fname):
+ i = fname.index('include/')
+ assert(i >= 0)
+ result = fname[i+8:]
+ return result
- def get_friendly_id(fname):
- i = fname.index('include/')
- assert(i >= 0)
- result = fname[i+8:]
- return result
+
+def get_graphviz(graph, options):
def get_decorators(fname, entry):
result = ''
for fname, entry in graph.items():
for h in entry.includes:
if transitively_includes(graph, h, fname):
- print('Cycle detected between %s and %s' % (fname, h))
+ sys.stderr.write('Cycle detected between %s and %s\n' % (
+ get_friendly_id(fname), get_friendly_id(h)
+ ))
no_cycles_detected = False
assert no_cycles_detected