From 1127e5ebe3b23fcd6b99fe5f50e9d083c4b247cf Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 11 Mar 2015 19:42:32 +0100 Subject: [PATCH 1/5] Added command-line tests --- .gitignore | 1 + samples/Makefile.am | 10 ++++++++++ samples/tests/early_exit.sh | 2 ++ samples/tests/help.sh | 2 ++ samples/tests/tap_test.sh | 2 ++ samples/tests/verbose.sh | 2 ++ 6 files changed, 19 insertions(+) create mode 100755 samples/tests/early_exit.sh create mode 100755 samples/tests/help.sh create mode 100755 samples/tests/tap_test.sh create mode 100755 samples/tests/verbose.sh 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/samples/Makefile.am b/samples/Makefile.am index 3fb962a..9781f65 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 +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..517d3da --- /dev/null +++ b/samples/tests/tap_test.sh @@ -0,0 +1,2 @@ +#!/bin/sh +./simple --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 From 00780ead30c768baca5578368f0ff6c2f1d0d034 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 11 Mar 2015 20:02:20 +0100 Subject: [PATCH 2/5] Changed tap test to cover more ground --- samples/Makefile.am | 2 +- samples/tests/tap_test.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/samples/Makefile.am b/samples/Makefile.am index 9781f65..e92ca78 100644 --- a/samples/Makefile.am +++ b/samples/Makefile.am @@ -11,7 +11,7 @@ TESTS += tests/tap_test.sh \ tests/verbose.sh \ tests/help.sh -tests/tap_test.sh: simple +tests/tap_test.sh: simple signal asserts tests/early_exit.sh: simple tests/verbose.sh: simple tests/help.sh: simple diff --git a/samples/tests/tap_test.sh b/samples/tests/tap_test.sh index 517d3da..79bf13c 100755 --- a/samples/tests/tap_test.sh +++ b/samples/tests/tap_test.sh @@ -1,2 +1,4 @@ #!/bin/sh ./simple --tap --always-succeed +./signal --tap --always-succeed +./asserts --tap --always-succeed From d11d2e4a3fb5adf0f38854efb2489216c5b4b750 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Mon, 16 Mar 2015 00:47:39 +0100 Subject: [PATCH 3/5] Added download links, precisions on cross-platform capabilities, and versions tested upon --- README.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 95a1845..d085084 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/ From 1a265e7823ed0b107cdb6405690718ccd9973c92 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Mon, 16 Mar 2015 00:56:03 +0100 Subject: [PATCH 4/5] Fixed assert failing to compile when activated --- src/stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } From b29af09758c58336ccc7c5c1554a8c3919a3f23e Mon Sep 17 00:00:00 2001 From: Snaipe Date: Mon, 16 Mar 2015 00:58:20 +0100 Subject: [PATCH 5/5] Fixed formatting in FAQ --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d085084..2cdb128 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ A. Currently, on Linux 2.6.32 and Linux 3.15.7, although it should work on the Cygwin port of GCC). More tests will be added on the build matrix. -**Q. Can I use it on Windows without Cygwin?** +**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.