@@ -21,32 +21,27 @@ set -eu
2121
2222# Verify the installed CMake config and pkgconfig files are actually usable.
2323
24- # For Bigtable protos
25- cp -R /home/build/cpp-cmakefiles/ci/test-install/bigtable \
26- /home/build/test-install-bigtable
27- cd /home/build/test-install-bigtable
28- cmake -H. -Bcmake-out
29- cmake --build cmake-out -- -j " $( nproc) "
30- cmake-out/utilize-googleapis
31- env PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig \
32- make
33-
34- # For BigQuery protos
35- cp -R /home/build/cpp-cmakefiles/ci/test-install/bigquery \
36- /home/build/test-install-bigquery
37- cd /home/build/test-install-bigquery
38- cmake -H. -Bcmake-out
39- cmake --build cmake-out -- -j " $( nproc) "
40- cmake-out/utilize-googleapis
41- env PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig \
42- make
43-
44- # For spanner protos
45- cp -R /home/build/cpp-cmakefiles/ci/test-install/spanner \
46- /home/build/test-install-spanner
47- cd /home/build/test-install-spanner
48- cmake -H. -Bcmake-out
49- cmake --build cmake-out -- -j " $( nproc) "
50- cmake-out/utilize-googleapis
51- env PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig \
52- make
24+ for subdir in bigquery bigtable pubsub spanner; do
25+ # Compile a test program using CMake.
26+ echo " ================================================================"
27+ echo " Testing ${subdir} $( date) with CMake"
28+ echo " ================================================================"
29+ src_dir=" /home/build/cpp-cmakefiles/ci/test-install/${subdir} "
30+ cmake_dir=" /home/build/test-cmake-${subdir} "
31+ make_dir=" /home/build/test-make-${subdir} "
32+ cmake -H" ${src_dir} " -B" ${cmake_dir} "
33+ cmake --build " ${cmake_dir} " -- -j " $( nproc) "
34+ # Verify the generated program is runnable
35+ " ${cmake_dir} /utilize-googleapis"
36+ echo " ================================================================"
37+ echo " Testing ${subdir} $( date) with Make"
38+ echo " ================================================================"
39+ cp -R " ${src_dir} " " ${make_dir} "
40+ cd " ${make_dir} "
41+ # With Make we may need to set PKG_CONFIG_PATH because the code is installed
42+ # in /usr/local and that is not a default search location in some distros.
43+ env PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig \
44+ make
45+ # Verify the generated program is runnable
46+ " ${make_dir} /main"
47+ done
0 commit comments