|
33 | 33 | regenerate_expected_results = False |
34 | 34 |
|
35 | 35 | if regenerate_expected_results: |
36 | | - print(f"""\ |
| 36 | + print( |
| 37 | + f"""\ |
37 | 38 | //--- generate-transitive-includes.sh.cpp |
38 | 39 | // RUN: mkdir %t |
39 | | -""") |
| 40 | +""" |
| 41 | + ) |
40 | 42 |
|
41 | | - all_traces = [] |
42 | | - for header in sorted(public_headers): |
43 | | - if header.endswith('.h'): # Skip C compatibility or detail headers |
44 | | - continue |
| 43 | + all_traces = [] |
| 44 | + for header in sorted(public_headers): |
| 45 | + if header.endswith(".h"): # Skip C compatibility or detail headers |
| 46 | + continue |
45 | 47 |
|
46 | | - normalized_header = re.sub('/', '_', header) |
47 | | - print(f"""\ |
| 48 | + normalized_header = re.sub("/", "_", header) |
| 49 | + print( |
| 50 | + f"""\ |
48 | 51 | // RUN: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt |
49 | | -""") |
50 | | - all_traces.append(f'%t/trace-includes.{normalized_header}.txt') |
| 52 | +""" |
| 53 | + ) |
| 54 | + all_traces.append(f"%t/trace-includes.{normalized_header}.txt") |
51 | 55 |
|
52 | | - print(f"""\ |
| 56 | + print( |
| 57 | + f"""\ |
53 | 58 | // RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv |
54 | | -""") |
| 59 | +""" |
| 60 | + ) |
55 | 61 |
|
56 | 62 | else: |
57 | | - for header in public_headers: |
58 | | - if header.endswith('.h'): # Skip C compatibility or detail headers |
59 | | - continue |
| 63 | + for header in public_headers: |
| 64 | + if header.endswith(".h"): # Skip C compatibility or detail headers |
| 65 | + continue |
60 | 66 |
|
61 | | - # Escape slashes for the awk command below |
62 | | - escaped_header = header.replace('/', '\/') |
| 67 | + # Escape slashes for the awk command below |
| 68 | + escaped_header = header.replace("/", "\\/") |
63 | 69 |
|
64 | | - print(f"""\ |
| 70 | + print( |
| 71 | + f"""\ |
65 | 72 | //--- {header}.sh.cpp |
66 | 73 | {lit_header_restrictions.get(header, '')} |
67 | 74 |
|
|
89 | 96 | // RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv |
90 | 97 | // RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv |
91 | 98 | #include <{header}> |
92 | | -""") |
| 99 | +""" |
| 100 | + ) |
0 commit comments