Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for compatibility for check 0.15 #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
GEM
remote: http://rubygems.org/
specs:
mini_portile (0.6.0)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
nokogiri (1.12.5-x86_64-linux)
racc (~> 1.4)
racc (1.5.2)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
nokogiri

BUNDLED WITH
2.2.28
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ An addon to [Check](http://check.sourceforge.net/) to support C-language tests i

Read the header and the example file for documentation.

- Install [Ruby](https://www.ruby-lang.org/en/downloads/), [Bundler](https://bundler.io/) and [Nokogiri](https://nokogiri.org/#installation).
- Compile with `make`.
- Install with `make install PREFIX=/usr` (defaults to `/usr/local`).
- Use `make run-example` to run the example. Requires `make install` to be done first.
10 changes: 10 additions & 0 deletions tmc-check.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ void tmc_set_tcase_points(TCase *tc, const char *tc_name, const char *points)
parse_points(points, &all_points);
}

#if CHECK_MINOR_VERSION < 15
void _tmc_register_test(Suite *s, TFun tf, const char *fname, const char *points)
{
TCase *tc = tcase_create(fname);
tmc_set_tcase_points(tc, fname, points);
_tcase_add_test(tc, tf, fname, 0, 0, 0, 1);
suite_add_tcase(s, tc);
}
#else
void _tmc_register_test(Suite *s, const TTest *tt, const char *fname, const char *points)
{
TCase *tc = tcase_create(fname);
tmc_set_tcase_points(tc, fname, points);
_tcase_add_test(tc, tt, 0, 0, 0, 1);
suite_add_tcase(s, tc);
}
#endif

void tmc_set_suite_points(Suite *s, const char *s_name, const char *points)
{
Expand Down
5 changes: 5 additions & 0 deletions tmc-check.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ Suite* tmc_suite_create(const char *name, const char *points);
*
* One can also register the test function normally and then call tmc_set_tcase_points.
*/
#if CHECK_MINOR_VERSION < 15
#define tmc_register_test(suite, tf, points) _tmc_register_test((suite), (tf), "" # tf, points)
void _tmc_register_test(Suite *s, TFun tf, const char *fname, const char *points);
#else
#define tmc_register_test(suite, tt, points) _tmc_register_test((suite), (tt), "" # tt, points)
void _tmc_register_test(Suite *s, const TTest *tt, const char *fname, const char *points);
#endif


/**
Expand Down