diff --git a/.appveyor.yml b/.appveyor.yml index b3272fe..2130e34 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,34 +7,17 @@ platform: - x64 configuration: - - Debug - Release for: -- - matrix: - only: - - platform: x86 - configuration: Debug - build_script: - - scripts\build_debug_x86.bat - -- - matrix: - only: - - platform: x64 - configuration: Debug - build_script: - - scripts\build_debug_x64.bat - - matrix: only: - platform: x86 configuration: Release build_script: - - scripts\build_release_x86.bat + - .ci\build_windows_x86.bat - matrix: @@ -42,4 +25,4 @@ for: - platform: x64 configuration: Release build_script: - - scripts\build_release_x64.bat + - .ci\build_windows_x64.bat diff --git a/.ci/build_coverage.sh b/.ci/build_coverage.sh new file mode 100755 index 0000000..7c8a1aa --- /dev/null +++ b/.ci/build_coverage.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/coverage" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && lcov -d . -z) +(cd "${BUILD_DIR}" && ctest --verbose) + +(cd "${BUILD_DIR}" && lcov -d . -c -o "coverage.info") +(cd "${BUILD_DIR}" && lcov -r "coverage.info" "*/usr/*" "*/untests/*" -o "coverage.info") +(cd "${BUILD_DIR}" && lcov -l "coverage.info") + +bash <(curl -s https://codecov.io/bash) -f "${BUILD_DIR}/coverage.info" || echo "Codecov did not collect coverage reports" diff --git a/.ci/build_darwin.sh b/.ci/build_darwin.sh new file mode 100755 index 0000000..658e0c1 --- /dev/null +++ b/.ci/build_darwin.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/darwin_release" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release) +(cd "${BUILD_DIR}" && cmake --build .) +(cd "${BUILD_DIR}" && ctest --verbose) diff --git a/.ci/build_linux.sh b/.ci/build_linux.sh new file mode 100755 index 0000000..c622bc4 --- /dev/null +++ b/.ci/build_linux.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" + +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/linux_release" + +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release) +(cd "${BUILD_DIR}" && cmake --build .) +(cd "${BUILD_DIR}" && ctest --verbose) diff --git a/.ci/build_windows_x64.bat b/.ci/build_windows_x64.bat new file mode 100644 index 0000000..0fff1e8 --- /dev/null +++ b/.ci/build_windows_x64.bat @@ -0,0 +1,19 @@ +@echo off +set DIR=%~dp0 + +set ROOT_DIR=%DIR%..\ +set BUILD_DIR=%ROOT_DIR%build\windows_release_x64\ + +if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error + +pushd %BUILD_DIR% || goto :error +cmake %ROOT_DIR% -A x64 || goto :error +cmake --build . --config Release || goto :error +ctest --verbose || goto :error +popd || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/.ci/build_windows_x86.bat b/.ci/build_windows_x86.bat new file mode 100644 index 0000000..58f0a9f --- /dev/null +++ b/.ci/build_windows_x86.bat @@ -0,0 +1,19 @@ +@echo off +set DIR=%~dp0 + +set ROOT_DIR=%DIR%..\ +set BUILD_DIR=%ROOT_DIR%build\windows_release_x86\ + +if not exist %BUILD_DIR% mkdir %BUILD_DIR% || goto :error + +pushd %BUILD_DIR% || goto :error +cmake %ROOT_DIR% -A Win32 || goto :error +cmake --build . --config Release || goto :error +ctest --verbose || goto :error +popd || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/.travis.yml b/.travis.yml index ebd9eac..43462e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,116 +8,74 @@ jobs: include: # - # linux (g++-7) + # linux (g++) # - os: linux - dist: xenial + dist: bionic stage: linux - name: debug, g++-7 + name: g++-7 addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7"] } } env: CC=gcc-7 CXX=g++-7 - script: ./scripts/build_debug.sh + script: .ci/build_linux.sh - os: linux - dist: xenial + dist: bionic stage: linux - name: release, g++-7 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7"] } } - env: CC=gcc-7 CXX=g++-7 - script: ./scripts/build_release.sh - - # - # linux (g++-8) - # - - - os: linux - dist: xenial - stage: linux - name: debug, g++-8 + name: g++-8 addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-8"] } } env: CC=gcc-8 CXX=g++-8 - script: ./scripts/build_debug.sh - - - os: linux - dist: xenial - stage: linux - name: release, g++-8 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-8"] } } - env: CC=gcc-8 CXX=g++-8 - script: ./scripts/build_release.sh + script: .ci/build_linux.sh # - # linux (clang++-5.0) + # linux (clang++) # - os: linux - dist: xenial + dist: bionic stage: linux - name: debug, clang++-5.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-5.0"] } } + name: clang++-5.0 + addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-5.0"] } } env: CC=clang-5.0 CXX=clang++-5.0 - script: ./scripts/build_debug.sh + script: .ci/build_linux.sh - os: linux - dist: xenial + dist: bionic stage: linux - name: release, clang++-5.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-5.0"] } } - env: CC=clang-5.0 CXX=clang++-5.0 - script: ./scripts/build_release.sh - - # - # linux (clang++-6.0) - # - - - os: linux - dist: xenial - stage: linux - name: debug, clang++-6.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-6.0"] } } + name: clang++-6.0 + addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["clang-6.0"] } } env: CC=clang-6.0 CXX=clang++-6.0 - script: ./scripts/build_debug.sh - - - os: linux - dist: xenial - stage: linux - name: release, clang++-6.0 - addons: { apt: { sources: ["ubuntu-toolchain-r-test"], packages: ["g++-7", "clang-6.0"] } } - env: CC=clang-6.0 CXX=clang++-6.0 - script: ./scripts/build_release.sh + script: .ci/build_linux.sh # - # macosx (xcode10) + # darwin # - os: osx osx_image: xcode10 - stage: macosx - name: debug, xcode10 - script: ./scripts/build_debug.sh - - - os: osx - osx_image: xcode10 - stage: macosx - name: release, xcode10 - script: ./scripts/build_release.sh - - # - # macosx (xcode11) - # + stage: darwin + name: xcode10 + script: .ci/build_darwin.sh - os: osx osx_image: xcode11 - stage: macosx - name: debug, xcode11 - script: ./scripts/build_debug.sh + stage: darwin + name: xcode11 + script: .ci/build_darwin.sh - - os: osx - osx_image: xcode11 - stage: macosx - name: release, xcode11 - script: ./scripts/build_release.sh + # + # windows + # + + - os: windows + stage: windows + name: x86 + script: .ci/build_windows_x86.bat + + - os: windows + stage: windows + name: x64 + script: .ci/build_windows_x64.bat # # coverage @@ -126,6 +84,6 @@ jobs: - os: osx osx_image: xcode10 stage: coverage - name: coverage, xcode10 + name: coverage addons: { homebrew: { packages: ["lcov"], update: true } } - script: ./scripts/upload_coverage.sh + script: .ci/build_coverage.sh diff --git a/LICENSE.md b/LICENSE.md index d096137..22e6e0f 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) +Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/headers/flat.hpp/detail/eq_compare.hpp b/headers/flat.hpp/detail/eq_compare.hpp index b7f17b0..bd0c9a0 100644 --- a/headers/flat.hpp/detail/eq_compare.hpp +++ b/headers/flat.hpp/detail/eq_compare.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/detail/is_allocator.hpp b/headers/flat.hpp/detail/is_allocator.hpp index 2a42f4c..a535c7c 100644 --- a/headers/flat.hpp/detail/is_allocator.hpp +++ b/headers/flat.hpp/detail/is_allocator.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/detail/is_sorted.hpp b/headers/flat.hpp/detail/is_sorted.hpp index b5e760c..c20d73f 100644 --- a/headers/flat.hpp/detail/is_sorted.hpp +++ b/headers/flat.hpp/detail/is_sorted.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/detail/is_transparent.hpp b/headers/flat.hpp/detail/is_transparent.hpp index cae2baf..851aa07 100644 --- a/headers/flat.hpp/detail/is_transparent.hpp +++ b/headers/flat.hpp/detail/is_transparent.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/detail/iter_traits.hpp b/headers/flat.hpp/detail/iter_traits.hpp index d6c073c..cbb2fbb 100644 --- a/headers/flat.hpp/detail/iter_traits.hpp +++ b/headers/flat.hpp/detail/iter_traits.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/detail/pair_compare.hpp b/headers/flat.hpp/detail/pair_compare.hpp index c715e1e..6920c94 100644 --- a/headers/flat.hpp/detail/pair_compare.hpp +++ b/headers/flat.hpp/detail/pair_compare.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/flat.hpp b/headers/flat.hpp/flat.hpp index 0c8114e..f55d363 100644 --- a/headers/flat.hpp/flat.hpp +++ b/headers/flat.hpp/flat.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "flat_map.hpp" diff --git a/headers/flat.hpp/flat_fwd.hpp b/headers/flat.hpp/flat_fwd.hpp index 790e34c..4ebfcaf 100644 --- a/headers/flat.hpp/flat_fwd.hpp +++ b/headers/flat.hpp/flat_fwd.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/flat_map.hpp b/headers/flat.hpp/flat_map.hpp index 8a11a26..4f651b3 100644 --- a/headers/flat.hpp/flat_map.hpp +++ b/headers/flat.hpp/flat_map.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/flat_multimap.hpp b/headers/flat.hpp/flat_multimap.hpp index 486494c..f9fdb3c 100644 --- a/headers/flat.hpp/flat_multimap.hpp +++ b/headers/flat.hpp/flat_multimap.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/flat_multiset.hpp b/headers/flat.hpp/flat_multiset.hpp index fb3414e..0b232ab 100644 --- a/headers/flat.hpp/flat_multiset.hpp +++ b/headers/flat.hpp/flat_multiset.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/headers/flat.hpp/flat_set.hpp b/headers/flat.hpp/flat_set.hpp index e590c70..eccd159 100644 --- a/headers/flat.hpp/flat_set.hpp +++ b/headers/flat.hpp/flat_set.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/scripts/bench_drawer.py b/scripts/bench_drawer.py index 0a15081..6e97dae 100755 --- a/scripts/bench_drawer.py +++ b/scripts/bench_drawer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Script to visualize google-benchmark output""" from __future__ import print_function import argparse @@ -62,6 +62,13 @@ def parse_args(): return args +def parse_input_size(name): + splits = name.split('/') + if len(splits) == 1: + return 1 + return int(splits[1]) + + def read_data(args): """Read and process dataframe using commandline args""" try: @@ -71,7 +78,7 @@ def read_data(args): logging.error(msg) exit(1) data['label'] = data['name'].apply(lambda x: x.split('/')[0]) - data['input'] = data['name'].apply(lambda x: int(x.split('/')[1])) + data['input'] = data['name'].apply(parse_input_size) data[args.metric] = data[args.metric].apply(TRANSFORMS[args.transform]) return data @@ -79,7 +86,7 @@ def read_data(args): def plot_groups(label_groups, args): """Display the processed data""" for label, group in label_groups.items(): - plt.plot(group['input'], group[args.metric], label=label) + plt.plot(group['input'], group[args.metric], label=label, marker='.') if args.logx: plt.xscale('log') if args.logy: @@ -101,7 +108,7 @@ def main(): if args.relative_to is not None: try: baseline = label_groups[args.relative_to][args.metric].copy() - except KeyError, key: + except KeyError as key: msg = 'Key %s is not present in the benchmark output' logging.error(msg, str(key)) exit(1) diff --git a/scripts/bench_map_foreach.sh b/scripts/bench_map_foreach.sh index 054d30f..9ef0f01 100755 --- a/scripts/bench_map_foreach.sh +++ b/scripts/bench_map_foreach.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_map_foreach --benchmark_format=csv > benchmark_map_foreach.csv -../../scripts/bench_drawer.py -f benchmark_map_foreach.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_map_foreach\ + --benchmark_format=csv > benchmark_map_foreach.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_foreach.csv) diff --git a/scripts/bench_map_insert.sh b/scripts/bench_map_insert.sh index ba8bb11..a3f1daf 100755 --- a/scripts/bench_map_insert.sh +++ b/scripts/bench_map_insert.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_map_insert --benchmark_format=csv > benchmark_map_insert.csv -../../scripts/bench_drawer.py -f benchmark_map_insert.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_map_insert\ + --benchmark_format=csv > benchmark_map_insert.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_insert.csv) diff --git a/scripts/bench_map_lookup.sh b/scripts/bench_map_lookup.sh index 0c4a544..d1d26ae 100755 --- a/scripts/bench_map_lookup.sh +++ b/scripts/bench_map_lookup.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_map_lookup --benchmark_format=csv > benchmark_map_lookup.csv -../../scripts/bench_drawer.py -f benchmark_map_lookup.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_map_lookup\ + --benchmark_format=csv > benchmark_map_lookup.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_map_lookup.csv) diff --git a/scripts/bench_set_foreach.sh b/scripts/bench_set_foreach.sh index be7dec0..6ae3144 100755 --- a/scripts/bench_set_foreach.sh +++ b/scripts/bench_set_foreach.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_set_foreach --benchmark_format=csv > benchmark_set_foreach.csv -../../scripts/bench_drawer.py -f benchmark_set_foreach.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_set_foreach\ + --benchmark_format=csv > benchmark_set_foreach.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_foreach.csv) diff --git a/scripts/bench_set_insert.sh b/scripts/bench_set_insert.sh index 7a29ca9..bf87b3d 100755 --- a/scripts/bench_set_insert.sh +++ b/scripts/bench_set_insert.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_set_insert --benchmark_format=csv > benchmark_set_insert.csv -../../scripts/bench_drawer.py -f benchmark_set_insert.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_set_insert\ + --benchmark_format=csv > benchmark_set_insert.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_insert.csv) diff --git a/scripts/bench_set_lookup.sh b/scripts/bench_set_lookup.sh index 8914163..c696d10 100755 --- a/scripts/bench_set_lookup.sh +++ b/scripts/bench_set_lookup.sh @@ -1,8 +1,18 @@ #!/bin/bash set -e +DIR="$( cd "$( dirname "${BASH_SOURCE}" )" && pwd )" -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build/release -cd $BUILD_DIR +ROOT_DIR="${DIR}/.." +BUILD_DIR="${ROOT_DIR}/build/unbench" -./unbench/flat.hpp.unbench --benchmark_filter=_set_lookup --benchmark_format=csv > benchmark_set_lookup.csv -../../scripts/bench_drawer.py -f benchmark_set_lookup.csv +mkdir -p "${BUILD_DIR}" +(cd "${BUILD_DIR}" && cmake "${ROOT_DIR}" -DCMAKE_BUILD_TYPE=Release\ + -DBUILD_WITH_UNBENCH=ON\ + -DBUILD_WITH_UNTESTS=OFF) +(cd "${BUILD_DIR}" && cmake --build .) + +(cd "${BUILD_DIR}" && ./unbench/flat.hpp.unbench\ + --benchmark_filter=_set_lookup\ + --benchmark_format=csv > benchmark_set_lookup.csv) + +(cd "${BUILD_DIR}" && "${ROOT_DIR}/scripts/bench_drawer.py" -f benchmark_set_lookup.csv) diff --git a/scripts/build_all.bat b/scripts/build_all.bat deleted file mode 100644 index 9e778dc..0000000 --- a/scripts/build_all.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -set SCRIPT_DIR=%~dp0% -call %SCRIPT_DIR%\build_debug_x86.bat || goto :error -call %SCRIPT_DIR%\build_debug_x64.bat || goto :error -call %SCRIPT_DIR%\build_release_x86.bat || goto :error -call %SCRIPT_DIR%\build_release_x64.bat || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_all.sh b/scripts/build_all.sh deleted file mode 100755 index d9cd585..0000000 --- a/scripts/build_all.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e -SCRIPT_DIR=`dirname "$BASH_SOURCE"` -$SCRIPT_DIR/build_debug.sh -$SCRIPT_DIR/build_release.sh diff --git a/scripts/build_clear.bat b/scripts/build_clear.bat deleted file mode 100644 index 44375fb..0000000 --- a/scripts/build_clear.bat +++ /dev/null @@ -1,9 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -rmdir /s /q %BUILD_DIR% || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_clear.sh b/scripts/build_clear.sh deleted file mode 100755 index ef8a2e3..0000000 --- a/scripts/build_clear.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -rm -rf $BUILD_DIR diff --git a/scripts/build_debug.sh b/scripts/build_debug.sh deleted file mode 100755 index a069095..0000000 --- a/scripts/build_debug.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/Debug -pushd $BUILD_DIR/Debug -cmake -DCMAKE_BUILD_TYPE=Debug ../.. -cmake --build . -ctest --verbose -popd diff --git a/scripts/build_debug_x64.bat b/scripts/build_debug_x64.bat deleted file mode 100644 index f80c2f3..0000000 --- a/scripts/build_debug_x64.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Debug\x64 || goto :error -pushd %BUILD_DIR%\Debug\x64 || goto :error -cmake ..\..\.. -A x64 || goto :error -cmake --build . --config Debug || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_debug_x86.bat b/scripts/build_debug_x86.bat deleted file mode 100644 index ee05129..0000000 --- a/scripts/build_debug_x86.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Debug\x86 || goto :error -pushd %BUILD_DIR%\Debug\x86 || goto :error -cmake ..\..\.. -A Win32 || goto :error -cmake --build . --config Debug || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_release.sh b/scripts/build_release.sh deleted file mode 100755 index 1377504..0000000 --- a/scripts/build_release.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/Release -pushd $BUILD_DIR/Release -cmake -DCMAKE_BUILD_TYPE=Release ../.. -cmake --build . -ctest --verbose -popd diff --git a/scripts/build_release_x64.bat b/scripts/build_release_x64.bat deleted file mode 100644 index 65e251e..0000000 --- a/scripts/build_release_x64.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Release\x64 || goto :error -pushd %BUILD_DIR%\Release\x64 || goto :error -cmake ..\..\.. -A x64 || goto :error -cmake --build . --config Release || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/build_release_x86.bat b/scripts/build_release_x86.bat deleted file mode 100644 index 1be857b..0000000 --- a/scripts/build_release_x86.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -set BUILD_DIR=%~dp0%\..\build -mkdir %BUILD_DIR%\Release\x86 || goto :error -pushd %BUILD_DIR%\Release\x86 || goto :error -cmake ..\..\.. -A Win32 || goto :error -cmake --build . --config Release || goto :error -ctest --verbose || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/scripts/upload_coverage.sh b/scripts/upload_coverage.sh deleted file mode 100755 index 981c94f..0000000 --- a/scripts/upload_coverage.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e - -BUILD_DIR=`dirname "$BASH_SOURCE"`/../build -mkdir -p $BUILD_DIR/coverage -cd $BUILD_DIR/coverage -cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_WITH_COVERAGE=ON ../.. -cmake --build . - -lcov -d . -z -ctest --verbose - -lcov -d . -c -o "coverage.info" -lcov -r "coverage.info" "*/usr/*" "*/doctest/*" "*/untests/*" -o "coverage.info" -lcov -l "coverage.info" - -bash <(curl -s https://codecov.io/bash) -f "coverage.info" || echo "Codecov did not collect coverage reports" diff --git a/unbench/bench_base.hpp b/unbench/bench_base.hpp index ef40bdf..f4d68de 100644 --- a/unbench/bench_base.hpp +++ b/unbench/bench_base.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once diff --git a/unbench/map_foreach_bench.cpp b/unbench/map_foreach_bench.cpp index e8fe698..b21b3b2 100644 --- a/unbench/map_foreach_bench.cpp +++ b/unbench/map_foreach_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/unbench/map_insert_bench.cpp b/unbench/map_insert_bench.cpp index 39d8f4c..885391f 100644 --- a/unbench/map_insert_bench.cpp +++ b/unbench/map_insert_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/unbench/map_lookup_bench.cpp b/unbench/map_lookup_bench.cpp index 2f05af6..b0fdd98 100644 --- a/unbench/map_lookup_bench.cpp +++ b/unbench/map_lookup_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/unbench/set_foreach_bench.cpp b/unbench/set_foreach_bench.cpp index 1cd1772..597e352 100644 --- a/unbench/set_foreach_bench.cpp +++ b/unbench/set_foreach_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/unbench/set_insert_bench.cpp b/unbench/set_insert_bench.cpp index 20b04f6..47b369a 100644 --- a/unbench/set_insert_bench.cpp +++ b/unbench/set_insert_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/unbench/set_lookup_bench.cpp b/unbench/set_lookup_bench.cpp index 03cd0db..9fab95c 100644 --- a/unbench/set_lookup_bench.cpp +++ b/unbench/set_lookup_bench.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include "bench_base.hpp" diff --git a/untests/flat_detail_tests.cpp b/untests/flat_detail_tests.cpp index 4c0c821..1232463 100644 --- a/untests/flat_detail_tests.cpp +++ b/untests/flat_detail_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/flat_map_tests.cpp b/untests/flat_map_tests.cpp index 86d1733..8b5b9ad 100644 --- a/untests/flat_map_tests.cpp +++ b/untests/flat_map_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/flat_multimap_tests.cpp b/untests/flat_multimap_tests.cpp index f6fb609..038559d 100644 --- a/untests/flat_multimap_tests.cpp +++ b/untests/flat_multimap_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/flat_multiset_tests.cpp b/untests/flat_multiset_tests.cpp index 4a15b9e..cb9471d 100644 --- a/untests/flat_multiset_tests.cpp +++ b/untests/flat_multiset_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/flat_set_tests.cpp b/untests/flat_set_tests.cpp index dee3781..32fd4db 100644 --- a/untests/flat_set_tests.cpp +++ b/untests/flat_set_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/flat.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2020, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include