Skip to content

Support expected output in compile-time failure test #1

@ldionne

Description

@ldionne

For example, I want to be able to check that a specific error message is emitted (a static_assert, say). The way I do that right now is by putting the following in the source file:

// in foo.cpp
int main() {
  // MESSAGE[Incomplete definition of your concept map]
  auto const& map = dyno::complete_concept_map<Fooable, int>(dyno::concept_map<Fooable, int>);
}

I then create a compile_fail test for foo.cpp and that checks whether there's an expected message. See https://github.com/ldionne/dyno/blob/master/cmake/CompileFailTest.cmake for an implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions