Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix benchmarking builds. #560

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-pipelines/pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
displayName: 'Rush install, build and test vcpkg-ce'
- bash: |
export CXXFLAGS="-fprofile-arcs -ftest-coverage -fPIC -O0"
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -B build.amd64.debug
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_BENCHMARKING=ON -DVCPKG_BUILD_FUZZING=ON -B build.amd64.debug
make -j 2 -C build.amd64.debug
displayName: "Build vcpkg with CMake"
failOnStderr: true
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
git -C "$VCPKG_ROOT" checkout `cat vcpkg-init/vcpkg-scripts-sha.txt`
displayName: "Clone vcpkg repo to serve as root"
- bash: |
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -B build.amd64.debug
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_BENCHMARKING=ON -DVCPKG_BUILD_FUZZING=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 -B build.amd64.debug
make -j 2 -C build.amd64.debug
displayName: "Build vcpkg with CMake"
failOnStderr: true
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
script: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86
rmdir /s /q build.x86.debug > nul 2> nul
cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=ON -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -B build.x86.debug
cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_BENCHMARKING=ON -DVCPKG_BUILD_FUZZING=ON -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -B build.x86.debug
ninja.exe -C build.x86.debug
failOnStderr: true
- script: build.x86.debug\vcpkg-test.exe
Expand Down
6 changes: 3 additions & 3 deletions src/vcpkg-test/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1071,18 +1071,18 @@ TEST_CASE ("remove all -- benchmarks", "[files][!benchmark]")

void operator()(Catch::Benchmark::Chronometer& meter, std::uint32_t max_depth) const
{
std::vector<path> temp_dirs;
std::vector<Path> temp_dirs;
temp_dirs.resize(meter.runs());

std::generate(begin(temp_dirs), end(temp_dirs), [&] {
path temp_dir = base_temporary_directory() / get_random_filename(urbg);
Path temp_dir = base_temporary_directory() / get_random_filename(urbg);
create_directory_tree(urbg, fs, temp_dir, max_depth);
return temp_dir;
});

meter.measure([&](int run) {
std::error_code ec;
path fp;
Path fp;
const auto& temp_dir = temp_dirs[run];

fs.remove_all(temp_dir, ec, fp);
Expand Down
2 changes: 1 addition & 1 deletion src/vcpkg-test/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ TEST_CASE ("SHA512: NIST test cases (large)", "[.][hash-expensive][sha512-expens

#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
using Catch::Benchmark::Chronometer;
void benchmark_hasher(Chronometer& meter, Hash::Hasher& hasher, std::uint64_t size, unsigned char byte) noexcept
static void benchmark_hasher(Chronometer& meter, Hash::Hasher& hasher, std::uint64_t size, unsigned char byte) noexcept
{
unsigned char buffer[1024];
std::fill(std::begin(buffer), std::end(buffer), byte);
Expand Down