1. 15 Jun, 2020 3 commits
    • timers: use snprintf instead of sprintf · f25ea40a
      Brian Wolfe authored
    • timers: silence format overflow warning · f6ac240c
      Brian Wolfe authored
    • use rfc3339-formatted timestamps in output [output format change] (#965) · 99c52f14
      Brian Wolfe authored
      * timestamp: use rfc3339-formatted timestamps in output
      
      Replace localized timestamps with machine-readable IETF RFC 3339 format
      timestamps. This is an attempt to make the output timestamps easily
      machine-readable. ISO8601 specifies standards for time interchange
      formats. IETF RFC 3339: https://tools.ietf.org/html/rfc3339 defines a
      subset of these for use in the internet. The general form for these
      timestamps is:
      
      YYYY-MM-DDTHH:mm:SS[+-]hhmm
      
      This replaces the localized time formats that are currently being used
      in the benchmark output to prioritize interchangeability and
      machine-readability.
      
      This might break existing programs that rely on the particular date-time
      format. This might also may make times less human readable. RFC3339 was
      intended to balance human readability and simplicity for machine
      readability, but it is primarily intended as an internal representation.
      
      * timers: remove utc string formatting
      
      We only ever need local time printing. Remove the UTC printing
      and cosnolidate the logic slightly.
      
      * timers: manually create rfc3339 string
      
      The C++ standard library does not output the time offset in RFC3339
      format, it is missing the : between hours and minutes. VS does not
      appear to support timezone information by default. To avoid adding too
      much complexity to benchmark around timezone handling e.g. a full
      date library like https://github.com/HowardHinnant/date, we fall back
      to outputting GMT time with a -00:00 offset for those cases.
      
      * timers: use reentrant form for localtime_r & tmtime_r
      
      For non-windows, use the reentrant form for the time conversion
      functions.
      
      * timers: cleanup
      
      Use strtol instead of brittle moving characters around.
      
      * timers: only call strftime twice.
      
      Also size buffers to known maximum necessary size and name constants
      more appropriately.
      
      * timers: fix unused variable warning
  2. 09 Jun, 2020 1 commit
  3. 08 Jun, 2020 4 commits
  4. 05 Jun, 2020 1 commit
  5. 28 May, 2020 1 commit
  6. 26 May, 2020 1 commit
    • Drop unused mingw.py (#966) · 9284e90f
      Christian Clauss authored
      * Use ==/!= to compare constant literals (str, bytes, int, float, tuple)
      
      Avoid Syntax Warning on Python 3.8: `3 is 3`  # —> Syntax Warning
      
      * Delete mingw.py
  7. 06 May, 2020 1 commit
    • Add Python bindings. (#957) · d3ad0b9d
      Chris Jones authored
      * Add Python bindings.
      
      * Add license headers.
      
      * Change example to a test.
      
      * Add example usage to module docstring.
  8. 23 Apr, 2020 1 commit
    • Add missing <cerrno> header include - fixes Android build (#960) · 56898e9a
      Kai Wolf authored
      * Add missing <cerrno> header
      
      This commit fixes a current build error on Android where 'errno' is an unidentified
      symbol due to a missing header
      
      * Update string_util.cc
      
      Conditionally adds <cerrno> if BENCHMARK_STL_ANDROID_GNUSTL is defined
  9. 17 Apr, 2020 1 commit
  10. 14 Apr, 2020 1 commit
  11. 10 Apr, 2020 1 commit
    • Fix cycleclock::Now for RISC-V and PPC (#955) · a77d5f70
      Luís Marques authored
      Fixes the following issues with the implementation of `cycleclock::Now`:
      
      - The RISC-V implementation wouldn't compile due to a typo;
      
      - Both the PPC and RISC-V implementation's asm statements lacked the
        volatile keyword. This resulted in the repeated read of the counter's
        high part being optimized away, so overflow wasn't handled at all.
        Multiple counter reads could also be misoptimized, especially in LTO
        scenarios.
      
      - Relied on the zero/sign-extension of inline asm operands, which isn't
        guaranteed to occur and differs between compilers, namely GCC and Clang.
      
      The PowerPC64 implementation was improved to do a single 64-bit read of
      the time-base counter.
      
      The RISC-V implementation was improved to do the overflow handing in
      assembly, since Clang would generate a branch, defeating the purpose
      of the non-branching counter reading approach.
  12. 06 Apr, 2020 1 commit
    • Fix type conversion warnings. (#951) · 0ab2c290
      Dominic Hamon authored
      * Fix type conversion warnings.
      
      Fixes #949
      
      Tested locally (Linux/clang), but warnings are on MSVC so may differ.
      
      * Drop the ULP so the double test passes
  13. 30 Mar, 2020 1 commit
  14. 16 Mar, 2020 2 commits
  15. 25 Feb, 2020 1 commit
  16. 21 Feb, 2020 1 commit
    • Relax CHECK condition in benchmark_runner.cc (#938) · c0783374
      Paweł Bylica authored
      * Add State::error_occurred()
      
      * Relax CHECK condition in benchmark_runner.cc
      
      If the benchmark state contains an error, do not expect any iterations has been run.
      This allows using SkipWithError() and return early from the benchmark function.
      
      * README.md: document new possible usage of SkipWithError()
  17. 18 Feb, 2020 1 commit
  18. 07 Feb, 2020 1 commit
    • Fix MSVC warning. (#935) · 8982e1ee
      Ben Clayton authored
      This fixes the Visual Studio 2019 warning:
      
      `C4244: '=': conversion from 'int' to 'char', possible loss of data`
      
      When implicitly casting the return value of tolower() (int) to char.
      
      Fixes: #932
  19. 31 Jan, 2020 1 commit
  20. 30 Jan, 2020 1 commit
  21. 14 Jan, 2020 1 commit
    • Alias CMake Targets. Fixes #921 (#926) · daff5fea
      Jordan Williams authored
      * add Jordan Williams to both CONTRIBUTORS and AUTHORS
      
      * alias benchmark libraries
      
      Provide aliased CMake targets for the benchmark and benchmark_main targets.
      The alias targets are namespaced under benchmark::, which is the namespace when they are exported.
      I chose not to use either the PROJECT_NAME or the namespace variable but to hard-code the namespace.
      This is because the benchmark and benchmark_main targets are hard-coded by name themselves.
      Hard-coding the namespace is also much cleaner and easier to read.
      
      * link to aliased benchmark targets
      
      It is safer to link against namespaced targets because of how CMake interprets the double colon.
      Typo's will be caught by CMake at configuration-time instead of during compile / link time.
      
      * document the provided alias targets
      
      * add "Usage with CMake" section in documentation
      
      This section covers linking against the alias/import CMake targets and including them using either find_package or add_subdirectory.
      
      * format the "Usage with CMake" README section
      
      Added a newline after the "Usage with CMake" section header.
      Dropped the header level of the section by one to make it a direct subsection of the "Usage" section.
      Wrapped lines to be no longer than 80 characters in length.
  22. 05 Jan, 2020 1 commit
    • Add d postfix to Debug libraries (#923) · 5ce2429a
      Szitár Gergő authored
      * Add DEBUG_POSTFIX to libraries.
      
      Makes it possible to install Debug and Release versions on the
      same system. Without this, there were only linker errors when using
      the wrong configuration.
      
      * Update CONTRIBUTORS and AUTHORS according to guide
  23. 15 Dec, 2019 1 commit
  24. 02 Dec, 2019 1 commit
  25. 01 Dec, 2019 2 commits
  26. 25 Nov, 2019 1 commit
  27. 22 Nov, 2019 6 commits
  28. 05 Nov, 2019 1 commit
    • CMake: use full add_test(NAME <> COMMAND <>) signature (#901) · c50ac68c
      Gregor Jasny authored
      * CTest must use proper paths to executables
      
      With the following syntax:
      
      ```
        add_test(NAME <name> COMMAND <command> [<arg>...])
      ```
      
      if `<command>` specifies an executable target it will automatically
      be replaced by the location of the executable created at build time.
      
      This is important if a `<Configuration>_POSTFIX` like `_d` is used.
      
      * Fix typo in ctest invocation
      
      Instead of `-c` the uppercase `-C` must be used to select a config.
      But better use the longopt.