2
2
3
3
# ###############
4
4
usage () {
5
- echo " Usage: $0 -c <compiler> [-l <run label>] [-t <tests to run>]"
5
+ echo " Usage: $0 -c <compiler> [-l <run label>] [-t <tests to run>] [-e <executable>] "
6
6
echo " -c <compiler> The compiler to use for the test"
7
7
echo " -s <cxx_std> The C++ standard to compile with (e.g. 'c++20', 'c++2b', 'c++latest' depending on the compiler)"
8
8
echo " -d <stdlib> Clang-only: the C++ Standard Library to link with ('libstdc++', 'libc++', or 'default' for platform default)"
9
9
echo " -l <run label> The label to use in output patch file name"
10
10
echo " -t <tests to run> Runs only the provided, comma-separated tests (filenames including .cpp2)"
11
11
echo " If the argument is not used all tests are run"
12
+ echo " -e <executable> Use the provided cppfront executable for the test"
13
+ echo " If the argument is not used run-tests will build cppfront"
12
14
exit 1
13
15
}
14
16
@@ -89,7 +91,7 @@ check_file () {
89
91
fi
90
92
}
91
93
92
- optstring=" c:s:d:l:t:"
94
+ optstring=" c:s:d:l:t:e: "
93
95
while getopts ${optstring} arg; do
94
96
case " ${arg} " in
95
97
c)
@@ -104,6 +106,9 @@ while getopts ${optstring} arg; do
104
106
l)
105
107
label=" ${OPTARG} "
106
108
;;
109
+ e)
110
+ executable=" ${OPTARG} "
111
+ ;;
107
112
t)
108
113
# Replace commas with spaces
109
114
chosen_tests=${OPTARG// ,/ }
177
182
" $compiler_version " == * " g++-13" *
178
183
]]; then
179
184
exec_out_dir=" $expected_results_dir /gcc-13"
180
- elif [[ " $compiler_version " == * " g++-14" * ]]; then
185
+ elif [[ " $compiler_version " == * " g++-14" * ||
186
+ " $compiler_version " == * " g++ (Ubuntu 14" *
187
+ ]]; then
181
188
exec_out_dir=" $expected_results_dir /gcc-14"
182
189
else
183
190
printf " Unhandled compiler version:\n$compiler_version \n\n"
@@ -250,12 +257,16 @@ else
250
257
fi
251
258
252
259
# ###############
253
- cppfront_cmd=" cppfront.exe"
254
- echo " Building cppfront"
255
- $compiler_cmd " $cppfront_cmd " ../source/cppfront.cpp
256
- if [[ $? -ne 0 ]]; then
257
- echo " Compilation failed"
258
- exit 2
260
+ if [ -z " $executable " ]; then
261
+ cppfront_cmd=" cppfront.exe"
262
+ echo " Building cppfront"
263
+ $compiler_cmd " $cppfront_cmd " ../source/cppfront.cpp
264
+ if [[ $? -ne 0 ]]; then
265
+ echo " Compilation failed"
266
+ exit 2
267
+ fi
268
+ else
269
+ cppfront_cmd=" $executable "
259
270
fi
260
271
261
272
# ###############
0 commit comments