From: Paul Ramsey Date: Thu, 19 Feb 2015 00:13:37 +0000 (+0000) Subject: update readme X-Git-Tag: 2.2.0rc1~657 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=460fe79eab3c0bbed1ae6601406f870885245306;p=postgis update readme git-svn-id: http://svn.osgeo.org/postgis/trunk@13241 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/cunit/README b/liblwgeom/cunit/README index 5edc167dc..978653ca4 100644 --- a/liblwgeom/cunit/README +++ b/liblwgeom/cunit/README @@ -67,18 +67,18 @@ will find a block that looks like this (this example is from cu_print.c): /* ** Used by the test harness to register the tests in this file. */ -CU_TestInfo print_tests[] = { - PG_TEST(test_lwprint_default_format), - PG_TEST(test_lwprint_format_orders), - PG_TEST(test_lwprint_optional_format), - PG_TEST(test_lwprint_oddball_formats), - PG_TEST(test_lwprint_bad_formats), - CU_TEST_INFO_NULL +void print_suite_setup(void); +void print_suite_setup(void) +{ + CU_pSuite suite = CU_add_suite("Print", init_print_suite, clean_print_suite); + PG_ADD_TEST(test_lwprint_default_format); + PG_ADD_TEST(test_lwprint_format_orders); + PG_ADD_TEST(test_lwprint_optional_format); }; Add a new line for your test: - PG_TEST(), + PG_ADD_TEST(); The tests will be run in the order they appear in the list. CU_TEST_INFO_NULL must always be the last entry. @@ -122,18 +122,16 @@ of the file, construct the array of tests (example taken from cu_print.c): /* ** Used by the test harness to register the tests in this file. */ -CU_TestInfo print_tests[] = { - PG_TEST(test_lwprint_default_format), - PG_TEST(test_lwprint_format_orders), - PG_TEST(test_lwprint_optional_format), - PG_TEST(test_lwprint_oddball_formats), - PG_TEST(test_lwprint_bad_formats), - CU_TEST_INFO_NULL +void print_suite_setup(void); +void print_suite_setup(void) +{ + CU_pSuite suite = CU_add_suite("Print", init_print_suite, clean_print_suite); + PG_ADD_TEST(test_lwprint_default_format); + PG_ADD_TEST(test_lwprint_format_orders); + PG_ADD_TEST(test_lwprint_optional_format); }; -Note that each test function must be wrapped with the PG_TEST macro, and -the last entry must be CU_TEST_INFO_NULL. The naming convention is -generally _tests. +The naming convention is generally _suite_setup. 3.3 Construct the init / clean functions and the suite struct. @@ -148,18 +146,10 @@ The naming convention is generally: static int init_(void) static int clean_(void) -The very last line of the file (after all the functions and the tests -array) should look like this: - -CU_SuiteInfo = {"", , , }; - -The naming convention is generally _suite. If you do not have -an init function, you may pass "NULL" instead. Same with the clean function. - 3.4 Add your suite to cu_tester.c. Edit cu_tester.c. Search for "ADD YOUR SUITE HERE" and add new lines in -the appropriate places, using the suite info name you used in the last step. +the appropriate places, using the _suite_setup name you used in the last step. Now run make (remember to run configure first), then ./cu_tester and your new suite should run.