22
33# ###############
44usage () {
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>] "
66 echo " -c <compiler> The compiler to use for the test"
77 echo " -s <cxx_std> The C++ standard to compile with (e.g. 'c++20', 'c++2b', 'c++latest' depending on the compiler)"
88 echo " -d <stdlib> Clang-only: the C++ Standard Library to link with ('libstdc++', 'libc++', or 'default' for platform default)"
99 echo " -l <run label> The label to use in output patch file name"
1010 echo " -t <tests to run> Runs only the provided, comma-separated tests (filenames including .cpp2)"
1111 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"
1214 exit 1
1315}
1416
@@ -89,7 +91,7 @@ check_file () {
8991 fi
9092}
9193
92- optstring=" c:s:d:l:t:"
94+ optstring=" c:s:d:l:t:e: "
9395while getopts ${optstring} arg; do
9496 case " ${arg} " in
9597 c)
@@ -104,6 +106,9 @@ while getopts ${optstring} arg; do
104106 l)
105107 label=" ${OPTARG} "
106108 ;;
109+ e)
110+ executable=" ${OPTARG} "
111+ ;;
107112 t)
108113 # Replace commas with spaces
109114 chosen_tests=${OPTARG// ,/ }
177182 " $compiler_version " == * " g++-13" *
178183 ]]; then
179184 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
181188 exec_out_dir=" $expected_results_dir /gcc-14"
182189 else
183190 printf " Unhandled compiler version:\n$compiler_version \n\n"
@@ -250,12 +257,16 @@ else
250257fi
251258
252259# ###############
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 "
259270fi
260271
261272# ###############
0 commit comments