Skip to content

mrowrpurr/Specs.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Almost ready for release ๐ŸŽ‰

TODO

  • Write Specs for Specs ๐Ÿ‘“
  • Rename GlobalSpecGroup (it's more than groups now) and make it (and GlobalInterface) nice for external consumption from DSL-makers
    • Extract the concept of data for 'next' component or spec into a structure
  • Parameterized tests
  • assert_multiple (like NUNit)
  • Parallel test runner
  • If possible, add support/adapter for BOOST_TEST
  • If possible, add support/adapter for GoogleTest's EXPECT_THAT and/or ASSERT_THAT
  • If possible, add support/adapter for Catch2 assertions
  • CLI options to include/exclude by:
    • tag (text or regex)
    • test name (text or regex)
    • group name (text or regex)
    • full test name with groups (text or regex)
    • file name (text or regex) if possible
  • CLI option to glob for .dll/.so/.dylib files
  • Provide example of programmatically providing those ^ filters, but from a custom entry point
    • e.g. How I will likely want to do for my Skyrim test runner
  • Maybe provide a Given, When, Then syntax
  • Bundle up the syntax options into simpler #include's
    • A bit simpler to BYO syntax selection
    • Provide RSpec-ish BeforeEach/It
  • current_test->var<PointerType>("name", new Something()) is a little confusing, can it be var<PointerType*> instead?
  • Finish docs :)

Specs

Beautiful C++ Test Framework

  • Syntax is simple and configurable
  • Supports Asynchronous tests
  • Supports runnings tests from shared libraries
  • Supports any C++ assertion library (e.g. snowhouse or libassert)

What?

C++ test framework with simple syntax which supports async tests.

#define SPEC_GROUP My_Tests

#include <Specs.h>

Setup { /* Setup Code */ }
Teardown { /* Teardown Code */ }

Test("Some thing") {
    assert_that(69 == 420);
    AssertThat(69, Equals(420));
}

TestAsync("Slow thing") {
    // Do something slow...
    done();
}

Documentation

https://specs.tools

LICENSE

Use however, no attribution required.

BSD Zero Clause License (SPDX: 0BSD)

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.