Code Monkey home page Code Monkey logo

ksstest's People

Contributors

stevenklassen8376 avatar

Watchers

 avatar  avatar

ksstest's Issues

Add a means of randomized tests

See the go language books for some examples. Note that it will be important that although random, the failures must be repeatable. This will mean using and recording some type of seed that will be reported along with the test failure.

completesWithin does not handle infinite times

Specifically, it does not give up after the requested time, but always attempts to complete its lambda and only then checks the time. It needs to stop when the requested time has been passed and report the failure.

Add a command line option to stop on the first error

Definitely default this to off, but some may want to stop immediately rather than continuing the tests. Of course this is a little more complex when they are running in separate threads. This will require a form of early termination to be added to the threads.

Can I improve the messages provided for the lambda extensions?

For example, if the user has

KSS_ASSERT(isEqualTo(23, []{ return 21; }));

instead of

KSS_ASSERT(23 == 21);

can we include some kind of "expected '23' but found '21'" in the error message?

Technical idea: One way to do this may be to have a thread local optional message that the "is..." methods fill if they are going to fail.

error reported, but passing anyway

When running tests in parallel I am sometimes getting an E in the initial output, but no error is reported in the summary and all tests are reported as passed.

Add a means of creating and publishing the API

Need to ensure that we use the header comments in the code. They are written to support headerdoc which makes the docs available in Xcode. So we either need to use headerdoc or something that has compatible markup abilities.

  • Find a suitable document generator
  • Determine how we want to publish (e.g. GitHub pages)
  • Update the build system to generate the docs.

embedded version is sensitive to the order of compilation

When embedding ksstest.cpp into your own project, any files that create TestSuite objects that are compiled before ksstest.cpp have their tests ignore. This appears to be due to the use of the static testSuites vector.

The workaround is to ensure that ksstest.cpp is compiled before any other source files (perhaps by renaming it to _ksstest.cpp). Then it works as intended.

However we need to fix this. Perhaps by replacing the static object with a singleton pattern?

Add a mechanism for table driven tests

See the books on the go language for some examples. The key trick in C++ will be getting the test result to show the position of the failed test in the table rather than the position of the failed assertion.

add an isCloseTo method

This would be targeted at floating point values and would need to accept a target value and an epsilon with the epsilon defaulting based on the numeric_limits of the underlying type. The details of the result would output the values in a manner similar to isEqualTo.

There should also be a corresponding isNotCloseTo.

Ideally it would also give a compiler error if used on a non-floating point type.

KSS_ASSERT fails if run in another thread

I believe this is due to the currentTest state variable. Even though it is thread local, I get a bad access when it is accessed in another thread. Not yet sure why this would be the case.

The following example will fail (assuming it is in a test)...

thread th { []{
    KSS_ASSERT(true);
}};
th.join();

The following example will also fail...

auto fut = async([]{ KSS_ASSERT(true); });
fut.wait();

Make updating the build system easier

I've decided against having the build system as a git submodule, primarily due to how that adds a required step before you can build anything. So instead I'm going to add a build system upgrade script that when run will update to the latest master of the build system.

Add memory checking

This may prove difficult, but it would be nice if we could check for memory leaks and show where they come from.

Look into adding support for TDD

In particular, could we add a "test driven development" syntax on top of the existing framework that would allow tests to be specified in a "given, when, then/should" format?

Add more comparative tests

Specifically the following, together with more helpful messages:

  • isLessThan
  • isLessThanOrEqualTo
  • isGreaterThan
  • isGreaterThanOrEqualTo

Update to the c++17 standard

  • init statement in if and switch
  • inline static variables
  • [[nodiscard]] attribute
  • [[maybe_unused]] attributre
  • string conversions

Add a short option to the test infrastructure

Look at how the GO test platform works. This would be specified on the command line and be accessible in the infrastructure to allow tests to do different things if you want to run a short (quick) version as opposed to a complete one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.