summaryrefslogtreecommitdiff
path: root/cutest-1.5/AllTests.c
diff options
context:
space:
mode:
authormartin@ashbysoft.com <martin@ashbysoft.com>2022-06-11 21:59:03 +0000
committermartin@ashbysoft.com <martin@ashbysoft.com>2022-06-11 21:59:03 +0000
commitbb40c4cbc74fe48a04069e6efb78c94bd0cc0451 (patch)
tree60580318d7c9cbb7df1aa95739e9171f76e824cf /cutest-1.5/AllTests.c
parent83e0861e200999ed46a1a1a8afa0b5638e48e14b (diff)
downloadlearn-c-bb40c4cbc74fe48a04069e6efb78c94bd0cc0451.tar.gz
learn-c-bb40c4cbc74fe48a04069e6efb78c94bd0cc0451.tar.bz2
learn-c-bb40c4cbc74fe48a04069e6efb78c94bd0cc0451.tar.xz
learn-c-bb40c4cbc74fe48a04069e6efb78c94bd0cc0451.zip
Add CuTest and test script.
Update ex1-9 with unit tests using CuTest.
Diffstat (limited to 'cutest-1.5/AllTests.c')
-rw-r--r--cutest-1.5/AllTests.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cutest-1.5/AllTests.c b/cutest-1.5/AllTests.c
new file mode 100644
index 0000000..5c849ef
--- /dev/null
+++ b/cutest-1.5/AllTests.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+#include "CuTest.h"
+
+CuSuite* CuGetSuite();
+CuSuite* CuStringGetSuite();
+
+void RunAllTests(void)
+{
+ CuString *output = CuStringNew();
+ CuSuite* suite = CuSuiteNew();
+
+ CuSuiteAddSuite(suite, CuGetSuite());
+ CuSuiteAddSuite(suite, CuStringGetSuite());
+
+ CuSuiteRun(suite);
+ CuSuiteSummary(suite, output);
+ CuSuiteDetails(suite, output);
+ printf("%s\n", output->buffer);
+}
+
+int main(void)
+{
+ RunAllTests();
+}