24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 * POSSIBILITY OF SUCH DAMAGE. |
26 * POSSIBILITY OF SUCH DAMAGE. |
27 */ |
27 */ |
28 |
28 |
|
29 #include "cx/common.h" |
29 #include "cx/test.h" |
30 #include "cx/test.h" |
30 |
31 |
31 CxTestSuite *cx_test_suite_testing_allocator(void); |
32 CxTestSuite *cx_test_suite_testing_allocator(void); |
32 CxTestSuite *cx_test_suite_utils(void); |
33 CxTestSuite *cx_test_suite_utils(void); |
33 CxTestSuite *cx_test_suite_compare(void); |
34 CxTestSuite *cx_test_suite_compare(void); |
49 CxTestSuite *cx_test_suite_properties(void); |
50 CxTestSuite *cx_test_suite_properties(void); |
50 CxTestSuite *cx_test_suite_json(void); |
51 CxTestSuite *cx_test_suite_json(void); |
51 |
52 |
52 #define run_tests(suite) cx_test_run_stdout(suite); success += (suite)->success; failure += (suite)->failure |
53 #define run_tests(suite) cx_test_run_stdout(suite); success += (suite)->success; failure += (suite)->failure |
53 #define execute_test_suites(...) unsigned success = 0, failure = 0; CxTestSuite* test_suites[] = {__VA_ARGS__}; \ |
54 #define execute_test_suites(...) unsigned success = 0, failure = 0; CxTestSuite* test_suites[] = {__VA_ARGS__}; \ |
54 for (size_t i = 0; i < sizeof(test_suites)/sizeof(void*) ; i++) {run_tests(test_suites[i]);} (void)0 |
55 for (size_t i = 0; i < cx_nmemb(test_suites) ; i++) {run_tests(test_suites[i]);} (void)0 |
55 #define free_test_suites for (size_t i = 0 ; i < sizeof(test_suites)/sizeof(void*) ; i++) {cx_test_suite_free(test_suites[i]);} (void)0 |
56 #define free_test_suites for (size_t i = 0 ; i < cx_nmemb(test_suites) ; i++) {cx_test_suite_free(test_suites[i]);} (void)0 |
56 |
57 |
57 int main(void) { |
58 int main(void) { |
58 printf("UCX Tests\n---------\n"); |
59 printf("UCX Tests\n---------\n"); |
59 |
60 |
60 execute_test_suites( |
61 execute_test_suites( |