|
8 | 8 |
|
9 | 9 | # REQUIRES: enable-spec-benchmarks
|
10 | 10 |
|
11 |
| -# RUN: mkdir -p %T |
12 |
| -# RUN: echo "%{cxx}" > %T/cxx.subs |
13 |
| -# RUN: echo "%{compile_flags}" > %T/compile_flags.subs |
14 |
| -# RUN: echo "%{flags}" > %T/flags.subs |
15 |
| -# RUN: echo "%{link_flags}" > %T/link_flags.subs |
16 |
| -# RUN: echo "%{spec_dir}" > %T/spec_dir.subs |
17 |
| -# RUN: %{python} %s %T |
| 11 | +# RUN: mkdir -p %{temp} |
| 12 | +# RUN: echo "%{cxx}" > %{temp}/cxx.subs |
| 13 | +# RUN: echo "%{compile_flags}" > %{temp}/compile_flags.subs |
| 14 | +# RUN: echo "%{flags}" > %{temp}/flags.subs |
| 15 | +# RUN: echo "%{link_flags}" > %{temp}/link_flags.subs |
| 16 | +# RUN: echo "%{spec_dir}" > %{temp}/spec_dir.subs |
| 17 | +# RUN: %{python} %s %{temp} |
18 | 18 | # END.
|
19 | 19 |
|
20 | 20 | import json
|
|
66 | 66 |
|
67 | 67 | for benchmark in spec_benchmarks:
|
68 | 68 | print(f'#--- {benchmark}.sh.test')
|
69 |
| - print(f'RUN: rm -rf %T') # clean up any previous (potentially incomplete) run |
70 |
| - print(f'RUN: mkdir %T') |
71 |
| - print(f'RUN: cp {spec_config} %T/spec-config.cfg') |
72 |
| - print(f'RUN: %{{spec_dir}}/bin/runcpu --config %T/spec-config.cfg --size train --output-root %T --rebuild {benchmark}') |
73 |
| - print(f'RUN: rm -rf %T/benchspec') # remove the temporary directory, which can become quite large |
| 69 | + print(f'RUN: rm -rf %{temp}') # clean up any previous (potentially incomplete) run |
| 70 | + print(f'RUN: mkdir %{temp}') |
| 71 | + print(f'RUN: cp {spec_config} %{temp}/spec-config.cfg') |
| 72 | + print(f'RUN: %{{spec_dir}}/bin/runcpu --config %{temp}/spec-config.cfg --size train --output-root %{temp} --rebuild {benchmark}') |
| 73 | + print(f'RUN: rm -rf %{temp}/benchspec') # remove the temporary directory, which can become quite large |
74 | 74 |
|
75 | 75 | # The `runcpu` command above doesn't fail even if the benchmark fails to run. To determine failure, parse the CSV
|
76 | 76 | # results and ensure there are no compilation errors or runtime errors in the status row. Also print the logs and
|
77 | 77 | # fail if there are no CSV files at all, which implies a SPEC error.
|
78 |
| - print(f'RUN: %{{libcxx-dir}}/utils/parse-spec-results --extract "Base Status" --keep-failed %T/result/*.train.csv > %T/status || ! cat %T/result/*.log') |
79 |
| - print(f'RUN: ! grep -E "CE|RE" %T/status || ! cat %T/result/*.log') |
| 78 | + print(f'RUN: %{{libcxx-dir}}/utils/parse-spec-results --extract "Base Status" --keep-failed %{temp}/result/*.train.csv > %{temp}/status || ! cat %{temp}/result/*.log') |
| 79 | + print(f'RUN: ! grep -E "CE|RE" %{temp}/status || ! cat %{temp}/result/*.log') |
80 | 80 |
|
81 | 81 | # If there were no errors, parse the results into LNT-compatible format and print them.
|
82 |
| - print(f'RUN: %{{libcxx-dir}}/utils/parse-spec-results %T/result/*.train.csv --output-format=lnt > %T/results.lnt') |
83 |
| - print(f'RUN: cat %T/results.lnt') |
| 82 | + print(f'RUN: %{{libcxx-dir}}/utils/parse-spec-results %{temp}/result/*.train.csv --output-format=lnt > %{temp}/results.lnt') |
| 83 | + print(f'RUN: cat %{temp}/results.lnt') |
0 commit comments