Skip to content

[BUG] Custom context with JSON file reporter produces invalid JSON #1181

@miki-shapr

Description

@miki-shapr

Describe the bug
Adding a custom context (--benchmark_context) and using the JSON reporter (--benchmark_out_format), the line preceding the custom context entry does not have a comma at the end resulting in an invalid JSON file.

System
Which OS, compiler, and compiler version are you using:

  • OS: macOS
  • Compiler and version: Apple clang version 12.0.5

To reproduce
Steps to reproduce the behavior:

  1. sync to commit 80a6261
  2. cmake -DCMAKE_BUILD_TYPE=Release ...
  3. make
  4. See error

Expected behavior
The line before the custom context entry should have a comman (,) at the end if there is a context entry.

Screenshots
Screenshot 2021-06-18 at 15 50 55

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions