Skip to content

Commit ccc78a8

Browse files
wilhuffa-maurice
authored andcommitted
Use available hardware parallelism for test runs
Also allow additional configuration flags to be passed from the command-line. PiperOrigin-RevId: 299244638
1 parent 5680fc2 commit ccc78a8

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

test_linux.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ cd linux_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@"
3131

3232
# Build the SDK and the tests
33-
cmake --build .
33+
cpus=$(nproc --all)
34+
cmake --build . -- -j $cpus
3435

3536
# Run the tests
3637
ctest --verbose

test_mac_ios.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ cd mac_ios_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios.cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios.cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@"
3131

3232
# Build the SDK and the tests
33-
cmake --build .
33+
cpus=$(sysctl -n hw.ncpu)
34+
cmake --build . -- -j $cpus

test_mac_ios_simulator.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ cd mac_ios_simulator_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios_simulator.cmake .. -DCLANG_ENABLE_MODULES=YES -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/ios_simulator.cmake .. -DCLANG_ENABLE_MODULES=YES -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@"
3131

3232
# Build the SDK and the tests
33-
cmake --build .
33+
cpus=$(sysctl -n hw.ncpu)
34+
cmake --build . -- -j $(cpus)
3435

test_mac_x64.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ cd mac_x64_build
2727

2828
# Configure cmake with tests enabled
2929
# and disable use of libsecret due to not working on kokoro builders
30-
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON
30+
cmake .. -DFIREBASE_CPP_BUILD_TESTS=ON -DFIREBASE_FORCE_FAKE_SECURE_STORAGE=ON "$@"
3131

3232
# Build the SDK and the tests
33-
cmake --build .
33+
cpus=$(sysctl -n hw.ncpu)
34+
cmake --build . -- -j $cpus
3435

3536
# Run the tests
3637
ctest --verbose

0 commit comments

Comments
 (0)