summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPawel Szewczyk <p.szewczyk@samsung.com>2014-11-17 13:02:59 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2015-03-06 16:12:07 +0100
commitb7556eb93236389ff1ba21df09f01954a1142e24 (patch)
tree769c1baa6886ad0447fb144f5e5bc5502f8c3778 /tests
parent51678c89fef837d76176fd0b25599f1c6de9975b (diff)
downloadlibusbg-b7556eb93236389ff1ba21df09f01954a1142e24.tar.gz
libusbg-b7556eb93236389ff1ba21df09f01954a1142e24.tar.bz2
libusbg-b7556eb93236389ff1ba21df09f01954a1142e24.zip
libusbg: tests: Add doxygen macros for documenting test cases
Also proceed doxygen config file with autoconf now. Autoconf copy .in file, substituting found variable values. It allows to specify what documentation should be build by configure script. Change-Id: I00cae61aefcc5b6444b0afc0dfe73c5973de34a9 Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com> Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test.c116
-rw-r--r--tests/usbg-test.h4
2 files changed, 93 insertions, 27 deletions
diff --git a/tests/test.c b/tests/test.c
index 8a0d2d0..cb1e2fe 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -454,55 +454,117 @@ void teardown_state(void **state)
#define USBG_TEST_TS(name, test, setup) \
USBG_TEST(name, test, setup, teardown_state)
+/**
+ * @page usbg_tests Tests
+ * @brief This is list of test cases
+ * @tests_start
+ */
+
+#ifndef DOXYGEN
static UnitTest tests[] = {
- /* Check if init was successfull on simple configfs state */
+#endif
+
+ /**
+ * @usbg_test
+ * @test_desc{test_init_simple,
+ * Check if init was successfull on simple configfs state,
+ * usbg_init}
+ */
USBG_TEST_TS("test_init_simple",
test_init, setup_simple_state),
-
- /* Check if init was successfull when all avaible functions
- * are present in configfs */
+ /**
+ * @usbg_test
+ * @test_desc{test_init_all_funcs,
+ * Check if init was successfull when all avaible functions
+ * are present in configfs,
+ * usbg_init}
+ */
USBG_TEST_TS("test_init_all_funcs",
test_init, setup_all_funcs_state),
-
- /* Check if simple gadget will be correcty returned */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_gadget_simple,
+ * Check if simple gadget will be correcty returned,
+ * usbg_get_gadget}
+ */
USBG_TEST_TS("test_get_gadget_simple",
test_get_gadget, setup_simple_state),
-
- /* Check if getting non-existing and wrong gadgets cause
- * expected failure and error codes are correct */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_gadget_fail_simple,
+ * Check if getting non-existing and wrong gadgets cause
+ * expected failure and error codes are correct,
+ * usbg_get_gadget}
+ */
USBG_TEST_TS("test_get_gadget_fail_simple",
test_get_gadget_fail, setup_simple_state),
-
- /* Check if gadget returned by get_first_gadget
- * is actually first one */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_first_gadget_simple,
+ * Check if gadget returned by get_first_gadget
+ * is actually first one,
+ * usbg_get_first_gadget}
+ */
USBG_TEST_TS("test_get_first_gadget_simple",
test_get_first_gadget, setup_simple_state),
-
- /* Check if getting first gadget from state returns NULL when
- * invalid parameters are passed */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_first_gadget_fail,
+ * Check if getting first gadget from state returns NULL when
+ * invalid parameters are passed,
+ * usbg_get_first_gadget}
+ */
unit_test(test_get_first_gadget_fail),
-
- /* Check if returned gadget name matches expected value */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_gadget_name_simple,
+ * Check if returned gadget name matches expected value,
+ * usbg_get_gadget_name}
+ */
USBG_TEST_TS("test_get_gadget_name_simple",
test_get_gadget_name, setup_simple_state),
-
- /* Check if returned simple gadget name length matches expected value */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_gadget_name_len,
+ * Check if returned simple gadget name length matches expected value,
+ * usbg_get_gadget_name}
+ */
USBG_TEST_TS("test_get_gadget_name_len_simple",
test_get_gadget_name_len, setup_simple_state),
-
- /* Check if trying to get name of invalid gadget
- * cause expected failure (name is null) */
+ /**
+ * @usbg_test
+ * @test_desc{test_get_gadget_name_fail,
+ * Check if trying to get name of invalid gadget
+ * cause expected failure (name is null),
+ * usbg_get_gadget_name}
+ */
unit_test(test_get_gadget_name_fail),
-
- /* Check if getting simple gadget name into buffer work as expected*/
+ /**
+ * @usbg_test
+ * @test_desc{test_cpy_gadget_name_simple,
+ * Check if getting simple gadget name into buffer work as expected,
+ * usbg_cpy_gadget_name}
+ */
USBG_TEST_TS("test_cpy_gadget_name_simple",
test_cpy_gadget_name, setup_simple_state),
-
- /* Check if writting gadget name into buffer fail when
- * invalid parameters are passed */
+ /**
+ * @usbg_test
+ * @test_desc{test_cpy_gadget_name_fail_simple,
+ * Check if writting gadget name into buffer fail when
+ * invalid parameters are passed,
+ * usbg_cpy_gadget_name}
+ */
USBG_TEST_TS("test_cpy_gadget_name_fail_simple",
test_cpy_gadget_name_fail, setup_simple_state),
+
+#ifndef DOXYGEN
};
+#endif
+
+/**
+ * @usbg_test
+ * @tests_end
+ */
#define TESTS_TAG "tests"
/* for autotools compability */
diff --git a/tests/usbg-test.h b/tests/usbg-test.h
index 53de1dc..f04e275 100644
--- a/tests/usbg-test.h
+++ b/tests/usbg-test.h
@@ -7,6 +7,10 @@
/* Simple structures for defining gadgets. All arrays should be null-terminated.*/
+/**
+ * @file tests/usbg-test.h
+ */
+
struct test_function
{
usbg_function_type type;