@@ -38,7 +38,11 @@ assert_not_rerun() {
3838 mkdir -p target/ci
3939 touch -r " $stamp " target/ci/before-second-build
4040 sleep 1
41- " $MCPP " build > target/ci/second-build.log 2>&1 || { cat target/ci/second-build.log; fail " the second build failed" ; }
41+ # `--profile dev` names the default profile and declines mcpp's fast path,
42+ # so the second build is planned on every host, as it is on Windows and
43+ # macOS without the flag, and a host tool whose key moved is rebuilt.
44+ " $MCPP " build --profile dev > target/ci/second-build.log 2>&1 ||
45+ { cat target/ci/second-build.log; fail " the second build failed" ; }
4246 [ -z " $( find " $stamp " -newer target/ci/before-second-build) " ] ||
4347 fail " the second build re-ran the installation ($stamp is newer)"
4448 echo " ok: a second build with nothing changed did not re-run the installation"
@@ -54,21 +58,21 @@ vcpkg_consumer() {
5458 " $MCPP " emit build-database --format json > target/ci/db.json 2> target/ci/emit.log ||
5559 { cat target/ci/emit.log; fail " emit build-database failed before any installation" ; }
5660 grep -q ' vcpkg_installed' target/ci/db.json || fail " the database names no vcpkg_installed include directory"
57- [ ! -d vcpkg_installed ] || fail " emit build-database installed something"
61+ [ ! -d target/ vcpkg_installed ] || fail " emit build-database installed something"
5862 echo " ok: emit succeeded before the installation and named its include directory"
5963
60- " $MCPP " build 2>&1 | tee build.log
61- " $MCPP " run | tee run.log
62- grep -qE ' ^vcpkg-consumer: fmt [0-9]+ says 42$' run.log || fail " the program did not print through fmt"
64+ " $MCPP " build 2>&1 | tee target/ci/ build.log
65+ " $MCPP " run | tee target/ci/ run.log
66+ grep -qE ' ^vcpkg-consumer: fmt [0-9]+ says 42$' target/ci/ run.log || fail " the program did not print through fmt"
6367 assert_not_rerun " $( stamp_of deps-vcpkg) "
6468
6569 if is_windows; then
6670 # The pack collects it from the runtime search directory.
67- ls vcpkg_installed/x64-windows/bin/fmt.dll > /dev/null || fail " x64-windows built no fmt.dll"
68- run_directly vcpkg-consumer | tee direct.log
69- grep -qE ' ^vcpkg-consumer: fmt [0-9]+ says 42$' direct.log ||
71+ ls target/ vcpkg_installed/x64-windows/bin/fmt.dll > /dev/null || fail " x64-windows built no fmt.dll"
72+ run_directly vcpkg-consumer | tee target/ci/ direct.log
73+ grep -qE ' ^vcpkg-consumer: fmt [0-9]+ says 42$' target/ci/ direct.log ||
7074 fail " started from the build directory, the program did not find fmt.dll"
71- " $MCPP " pack --format dir | tee pack.log
75+ " $MCPP " pack --format dir | tee target/ci/ pack.log
7276 find target/dist -iname ' fmt.dll' | grep -q . || fail " the packed tree carries no fmt.dll"
7377 echo " ok: the packed tree carries fmt.dll"
7478 fi
@@ -77,11 +81,12 @@ vcpkg_consumer() {
7781vcpkg_workspace () {
7882 cd " $ROOT /tests/vcpkg-workspace"
7983 rm -rf target app-a/target app-b/target vcpkg_installed
80- " $MCPP " build 2>&1 | tee build.log
81- " $MCPP " run -p app-a | tee run-a.log
82- " $MCPP " run -p app-b | tee run-b.log
83- grep -qE ' ^app-a: fmt [0-9]+$' run-a.log || fail " app-a did not run"
84- grep -qE ' ^app-b: fmt [0-9]+$' run-b.log || fail " app-b did not run"
84+ mkdir -p target/ci
85+ " $MCPP " build 2>&1 | tee target/ci/build.log
86+ " $MCPP " run -p app-a | tee target/ci/run-a.log
87+ " $MCPP " run -p app-b | tee target/ci/run-b.log
88+ grep -qE ' ^app-a: fmt [0-9]+$' target/ci/run-a.log || fail " app-a did not run"
89+ grep -qE ' ^app-b: fmt [0-9]+$' target/ci/run-b.log || fail " app-b did not run"
8590 # Each member builds into its own target/ and declares its own installation.
8691 [ " $( find . -path ' */target/*' -path ' *deps-vcpkg*' -name ' *.stamp' | wc -l) " -ge 2 ] ||
8792 fail " each member did not declare its own installation"
@@ -91,12 +96,17 @@ vcpkg_workspace() {
9196cmake_consumer () {
9297 cd " $ROOT /tests/cmake-consumer"
9398 rm -rf target
94- " $MCPP " build 2>&1 | tee build.log
95- " $MCPP " run | tee run.log
96- grep -q ' ^cmake-consumer: greet says 42$' run.log || fail " the program did not call the subproject's library"
99+ mkdir -p target/ci
100+ " $MCPP " build 2>&1 | tee target/ci/build.log
101+ " $MCPP " run | tee target/ci/run.log
102+ grep -q ' ^cmake-consumer: greet says 42$' target/ci/run.log || fail " the program did not call the subproject's library"
97103 assert_not_rerun " $( stamp_of deps-cmake) "
104+ # The builds after an edit are planned as well. The subproject lies inside
105+ # this repository, the tree mcpp stamps for the plugins' host tool
106+ # (mcpp#705), so an edit also rebuilds `mcpp-deps`; the build that is
107+ # expected to re-run the installation absorbs that rebuild.
98108 touch greet/greet.c
99- " $MCPP " build > target/ci/third-build.log 2>&1 || { cat target/ci/third-build.log; fail " the rebuild failed" ; }
109+ " $MCPP " build --profile dev > target/ci/third-build.log 2>&1 || { cat target/ci/third-build.log; fail " the rebuild failed" ; }
100110 # The installed library is the product of the rebuild, whatever the engine
101111 # does with the action's stamp.
102112 [ -n " $( find target -path ' *deps-cmake*/install/*' -name ' *greet*' -newer target/ci/before-second-build) " ] ||
@@ -112,7 +122,7 @@ cmake_consumer() {
112122 touch -r " $( stamp_of deps-cmake) " target/ci/before-added-file
113123 sleep 1
114124 echo added > greet/added.txt
115- " $MCPP " build > target/ci/added-build.log 2>&1 || { cat target/ci/added-build.log; fail " the build after adding a file failed" ; }
125+ " $MCPP " build --profile dev > target/ci/added-build.log 2>&1 || { cat target/ci/added-build.log; fail " the build after adding a file failed" ; }
116126 [ -n " $( find " $( stamp_of deps-cmake) " -newer target/ci/before-added-file) " ] ||
117127 fail " a file added to the subproject did not re-run its installation"
118128 echo " ok: a file added to the subproject re-ran its installation"
@@ -121,9 +131,10 @@ cmake_consumer() {
121131qt_consumer () {
122132 cd " $ROOT /tests/qt-consumer"
123133 rm -rf target
124- " $MCPP " build 2>&1 | tee build.log
125- " $MCPP " run | tee run.log
126- grep -qE " ^qt-consumer: signal 42, resource 'greetings from rcc', translation 'hallo', Qt 6\." run.log ||
134+ mkdir -p target/ci
135+ " $MCPP " build 2>&1 | tee target/ci/build.log
136+ " $MCPP " run | tee target/ci/run.log
137+ grep -qE " ^qt-consumer: signal 42, resource 'greetings from rcc', translation 'hallo', Qt 6\." target/ci/run.log ||
127138 fail " moc, rcc or lrelease did not reach the program"
128139 find target -name ' qt_consumer_de.qm' | grep -q . || fail " no .qm was produced"
129140 echo " ok: moc (header and inline), rcc and lrelease reached the program"
@@ -132,19 +143,20 @@ qt_consumer() {
132143qt_widgets_consumer () {
133144 cd " $ROOT /tests/qt-widgets-consumer"
134145 rm -rf target
135- " $MCPP " build 2>&1 | tee build.log
136- QT_QPA_PLATFORM=offscreen " $MCPP " run | tee run.log
137- grep -q " ^qt-widgets-consumer: platform offscreen, label 'made by uic'$" run.log ||
146+ mkdir -p target/ci
147+ " $MCPP " build 2>&1 | tee target/ci/build.log
148+ QT_QPA_PLATFORM=offscreen " $MCPP " run | tee target/ci/run.log
149+ grep -q " ^qt-widgets-consumer: platform offscreen, label 'made by uic'$" target/ci/run.log ||
138150 fail " the platform plugin or the uic form did not reach the program"
139151 if is_macos; then
140152 find target -path ' */bin/platforms/libqoffscreen.dylib' | grep -q . ||
141153 fail " no platforms/libqoffscreen.dylib was deployed beside the program"
142154 fi
143155 if is_windows; then
144- QT_QPA_PLATFORM=offscreen run_directly qt-widgets-consumer | tee direct.log
145- grep -q " ^qt-widgets-consumer: platform offscreen" direct.log ||
156+ QT_QPA_PLATFORM=offscreen run_directly qt-widgets-consumer | tee target/ci/ direct.log
157+ grep -q " ^qt-widgets-consumer: platform offscreen" target/ci/ direct.log ||
146158 fail " started from the build directory, the program did not find the Qt DLLs"
147- " $MCPP " pack --format dir | tee pack.log
159+ " $MCPP " pack --format dir | tee target/ci/ pack.log
148160 find target/dist -iname ' Qt6Widgets.dll' | grep -q . || fail " the packed tree carries no Qt6Widgets.dll"
149161 find target/dist -ipath ' *platforms/qoffscreen.dll' | grep -q . ||
150162 fail " the packed tree carries no platforms/qoffscreen.dll"
0 commit comments