Coder Social home page Coder Social logo

fctx's People

Contributors

imb avatar okxchg avatar rhysu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fctx's Issues

Better "data" blocks for initialization and teardown

Sometimes the following pattern,

char _data;
FCT_SUITE_BGN(xxx) {
FCT_SETUP_BGN() {
data = malloc(sizeof(char)_N);
}FCT_SETUP_END();
FCT_TEARDOWN_BGN() {
free(data);
} FCT_TEARDOWN_END();
FCT_TEST_BGN() { /* do test */ } FCT_TEST_END();
FCT_SUITE_END();

is akward. It is especially akward when the "data" is a C++ object that lacks a default constructor. Perhaps you have an object you would like to do a one-time initialization on, for instance:

config_t config("name", 123);
config.add(some_object_t(someparam));
config.add(other_object_t(otherparam));

Those "add" commands can't be in the "global" space, but you don't really want to call them over and over again with the setup/teardown. Its a config object that is read-only for the test suite for example.

doc: fix 'python module index'

The documentation module index refers to the "Python Module Index". Could be a bug in Sphinx (which grew up from Python), or a missing configuration parameter.

Junit/XML reporter deadlocks if too much output

The Junit/XML reporter captures stdout/stderr by redirecting into a pipe, then reading it back in the same process. If an individual test prints enough output to fill up the pipe, the test process deadlocks waiting for a reader that is never going to drain the pipe.

Reproduce on Ubuntu 10 by:

#include "fct.h"

FCT_BGN()
{
    FCT_QTEST_BGN(too_much_output)
    {
        int x;
        for (x =0; x<100000; x++ ) 
            printf("xxx\n");
    }
    FCT_QTEST_END();
}
FCT_END();

and then:

./a.out --logger junit

This affects the junit logger and custom loggers that use the same mechanism to capture stdout/stderr.

If I get a chance, I will try replacing the pipe with a temp file, but I'm not sure I will get to it any time soon.

The simple workaround is: Don't let the test blab so much.

Provide ability to skip a test and describe why

Sometimes you have a test that you know is wrong, but are waiting for some further changes to the API in order to finally bring that test back online.

It would be useful if we can tell FCTX to skip a certain test, and describe why to skip it.

Rough idea is,

fct_skip(<test_name>, "reason why");

That might suffer in a "typo" not causing a skip, so,

fct_skipnext("reason why");
FCT_TEST_BGN(xyz) {
} FCT_TEST_END();

and in the log you would get a "SKIP" and the next line would be a reason why you skipped it.

Ability to manage test data throughout a unit test

The goal of this is to be able to somehow manage data in a pristine state from test to test. Some tests require files in order run tests against them. It would be nice if you could somehow take care to load/unload these files and not have to worry about making sure the file hasn't been corrupted by some previous unit test.

Handle Exceptions (aka survive!)

FCTest needs to be able to handle exceptions well. It should be able to survive a system failure with minimal issues.

Ideas:

Launch the program in a separate process? Using the full test name would technically make this doable.
Look into structured exception handling, can write some wrappers? What do to on a Linux system?

Optional?

define FCT_OPTION__USE_EXCEPTION_HANDLING

include "fct.h"

Providing timing results on a test by test basis

Pretty straightforward. Just run the fct_timer object for each test as well as for the entire test run.

The main reason for this is to provide some immediate feedback on tests that appear to be getting longer and longer to execute.

Use the check routines within an if statement

Have the ability to use the result of a check to avoid a set of other checks.

For example,

{{{
if ( !fct_chk(CONDITION) ) {
/* No point running the following fct_chk, because that CONDITION was important. /
}
/
We can run other checks here... */

}}}

Add ability to randomize the testing order

I found that this was an interesting idea because it helps flush out inter-dependencies between tests that may result in a "correct" test.

In a way it helps check for dependencies.

If we did this we would need to have the ability to,

  1. Randomize with a specified seed.
  2. Report the seed used to generate the error (so it is reproducible).

Provide IDE Support

It would be nice if the all the error strings where displayed in an IDE "output window". This way when the user double clicks on the line with the error message it will jump them to the test in the code.

I know for Visual Studio if you use the WIN32 OutputString call it will go to the output window.

Add Helpful String Check

Currently FCTX has the fct_chk_eq_str with its neq and case-insenstive variants. This blueprint is to track some additional checks, namely,

fct_chk_str_incl : determines if the target string includes the substring.
fct_chk_str_excl : determines if the target string excludes the substring.
fct_chk_str_starts : determines if the target string starts with the substring.
fct_chk_str_ends: determines if the target string ends with the substring.
fct_chk_str_empty: returns true if the string is empty.
fct_chk_str_full: returns true if the string is full.

These should help some common tests quickly indicate the reason for their failure.

fctx.wildbearsoftware.com appears to be down / dead

Does anyone have a complete copy of the previous website? Do we want to duplicate that somewhere (GitHub?) so the information remains available? Obviously one can use archive.org to get to (most of) the old site. However, that doesn't seem like the best solution going forward.

ability to hook in different loggers

With the start of issue #10, it would be nice set up the ability to hook in different loggers. The first pass should look to be able to hook in "built-in" loggers, but the second pass should be too difficult for folks to extend fctx and register their own loggers.

Allow fct_req within test fixtures

Please consider allowing the use of fct_req within FCT_SETUP_BGN "blocks".
This is useful to allow for sanity checking fixture setup conditions.

Currently, using fct_req within FCT_SETUP_BGN causes

fct_test__add: Assertion `test != ((void *)0)' failed.

for an example like the following

char * filename = NULL;

FCT_FIXTURE_SUITE_BGN(example_suite)
{
    FCT_SETUP_BGN()
    {
        /* filename = malloc(....) */
        fct_req(filename);
    }
    FCT_SETUP_END();

    FCT_TEARDOWN_BGN()
    {
        if (filename) free(filename);
    }
    FCT_TEARDOWN_END();

    FCT_TEST_BGN(debug)
    {
        /* NOP */
    }
    FCT_TEST_END();
}
FCT_FIXTURE_SUITE_END();

provide unicode support

The FCTX code base should have been written with wchar_t* in mind, instead of using char*. This issue is to track support for it.

gcc runs out of memory with 1024 tests in release

When trying to compile the test_big, with 1024 tests cases, using gcc with release flags, my system runs out of memory. The debug build proceeds happily.

I can only speculate that the release optimizer can not handle a single "function" with 1024 test cases within it, because this is what test_big looks like.

At the moment the test was modified to only generate 256 tests in release. The
number was picked out of the air, and was not precisely generated.

A workaround is not to let your test suites get this large, and to break up
your tests either with different EXE's or with the FCTMF (FCTX Multi-file API).

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.