Skip to content

test(json): verify every public header compiles independently #555

Description

@GaspardKirira

Summary

Add compile tests ensuring each public JSON header includes everything required for independent use.

Current behavior

The module exposes:

  • build.hpp;
  • convert.hpp;
  • dumps.hpp;
  • jpath.hpp;
  • json.hpp;
  • loads.hpp;
  • Simple.hpp.

Headers are often included through the umbrella header, which can hide missing direct dependencies.

Expected behavior

Every public header must compile as the first and only Vix JSON include in a translation unit.

Scope

  • Add one compile target per public header.
  • Compile with GCC.
  • Compile with Clang.
  • Compile with MSVC.
  • Test with strict warnings.
  • Test normal literal configuration.
  • Test enabled literal configuration.
  • Test standalone installation headers.
  • Preserve header-only usage.

Suggested files

  • modules/json/tests/headers/build_header_test.cpp
  • modules/json/tests/headers/convert_header_test.cpp
  • modules/json/tests/headers/dumps_header_test.cpp
  • modules/json/tests/headers/jpath_header_test.cpp
  • modules/json/tests/headers/json_header_test.cpp
  • modules/json/tests/headers/loads_header_test.cpp
  • modules/json/tests/headers/simple_header_test.cpp
  • modules/json/tests/CMakeLists.txt

Acceptance criteria

  • Every public header compiles independently.
  • Header order does not affect compilation.
  • Literal macro configurations compile.
  • Installed headers pass the same checks.
  • No transitive include is required accidentally.
  • Supported compilers pass.

Non-goals

This issue does not include:

  • reducing compile time;
  • changing public APIs;
  • testing private headers;
  • module-header generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuild system, CMake, compiler, linker, CI/CD issuesgood first issueGood for newcomersscope:jsonChanges related to the Vix JSON modulestatus:readyIssue is fully specified and ready for implementationtestsTests, CI coverage and validationtype:ciCI, tests, or tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions