diff --git a/.gitignore b/.gitignore index 59954bb..a807c71 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ !*.c !*.h !*.rst +!samples/tests/*.sh !LICENSE !HEADER diff --git a/README.md b/README.md index 95a1845..2cdb128 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,15 @@ the user would have with other frameworks: reported and tested. * [x] Progress and statistics can be followed in real time with report hooks. * [x] TAP output format can be enabled with an option. -* [x] Runs on Linux and OS X. +* [x] Runs on Linux, Mac OS X, and Windows (compiles only with Cygwin for the moment). + +## Downloads + +* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v0.3/criterion-0.3-linux-x86_64.tar.bz2) +* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v0.3/criterion-0.3-osx-x86_64.tar.bz2) +* [Windows (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v0.3/criterion-0.3-win-x86_64.tar.bz2) + +If you have a different platform, you can still [build the library from source](http://criterion.readthedocs.org/en/latest/setup.html#installation) ## Documentation @@ -60,12 +68,14 @@ A. I worked with CUnit and Check, and I must say that they do their job **Q. Where has this been tested?** A. Currently, on Linux 2.6.32 and Linux 3.15.7, although it should work on - most \*nix systems. More tests will be added on the build matrix. + most \*nix systems; Mac OS X Yosemite 10.10, and finally Windows 7 (with + the Cygwin port of GCC). + More tests will be added on the build matrix. -**Q. Will this work under Windows/MSVC?** -A. Windows support with MinGW/MSVC is coming, but MSVC is a bit of a lost cause - to compile the library itself: the project internally uses c99 features and gnu - extensions. +**Q. Can I use it on Windows without Cygwin?** +A. Yes, you can, Cygwin is only required to compile the static library if + you build it from source -- otherwise, a GNU C compatible compiler (like + GCC or Clang) is needed to compile your tests with the library. [online-docs]: http://criterion.readthedocs.org/ [pdf-docs]: http://readthedocs.org/projects/criterion/downloads/pdf/latest/ diff --git a/samples/Makefile.am b/samples/Makefile.am index 3fb962a..e92ca78 100644 --- a/samples/Makefile.am +++ b/samples/Makefile.am @@ -6,6 +6,16 @@ TESTS = \ asserts \ simple +TESTS += tests/tap_test.sh \ + tests/early_exit.sh \ + tests/verbose.sh \ + tests/help.sh + +tests/tap_test.sh: simple signal asserts +tests/early_exit.sh: simple +tests/verbose.sh: simple +tests/help.sh: simple + TESTS_ENVIRONMENT = CRITERION_ALWAYS_SUCCEED=1 check_PROGRAMS = $(TESTS) diff --git a/samples/tests/early_exit.sh b/samples/tests/early_exit.sh new file mode 100755 index 0000000..30f513a --- /dev/null +++ b/samples/tests/early_exit.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./simple --no-early-exit --always-succeed diff --git a/samples/tests/help.sh b/samples/tests/help.sh new file mode 100755 index 0000000..21daba7 --- /dev/null +++ b/samples/tests/help.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./simple --help diff --git a/samples/tests/tap_test.sh b/samples/tests/tap_test.sh new file mode 100755 index 0000000..79bf13c --- /dev/null +++ b/samples/tests/tap_test.sh @@ -0,0 +1,4 @@ +#!/bin/sh +./simple --tap --always-succeed +./signal --tap --always-succeed +./asserts --tap --always-succeed diff --git a/samples/tests/verbose.sh b/samples/tests/verbose.sh new file mode 100755 index 0000000..73410b8 --- /dev/null +++ b/samples/tests/verbose.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./simple --verbose --always-succeed diff --git a/src/stats.c b/src/stats.c index ab67456..e12db58 100644 --- a/src/stats.c +++ b/src/stats.c @@ -75,7 +75,7 @@ void stat_push_event(s_glob_stats *stats, }; assert(data->kind > 0); - assert(data->kind <= (ssize_t) (sizeof (handles) / sizeof (void (*)(void)))); + assert(data->kind <= (signed long long) (sizeof (handles) / sizeof (void (*)(void)))); handles[data->kind](stats, test, data->data); }