]> granicus.if.org Git - check/commitdiff
* add eclipse support to contrib dir from Bogdan Cristea
authorcpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 23 Jan 2011 22:36:51 +0000 (22:36 +0000)
committercpickett <cpickett@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 23 Jan 2011 22:36:51 +0000 (22:36 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@600 64e312b2-a51f-0410-8e61-82d0ca0eb02a

AUTHORS
contrib/eclipse/README [new file with mode: 0644]
contrib/eclipse/check_template_eclipse_helios.xml [new file with mode: 0644]

diff --git a/AUTHORS b/AUTHORS
index e8b581fa5de77f89624e2f86c7254f86e9d13de8..cb41d5b9a5650ec4a7f6c76872fc7b98a8201e79 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,6 +23,7 @@ Patches:         Bernhard Reiter (configure issues)
                 Robert Collins (subunit support)
                  Micah Cowan (checkmk tool, docs and tests)
                 Zdenek Crha (new Check API docs, fixes, and tests)
+                Bogdan Cristea (eclipse support in contrib dir)
 
 Anybody who has contributed code to Check or Check's build system is
 considered an author.  Send patches to this file to 
diff --git a/contrib/eclipse/README b/contrib/eclipse/README
new file mode 100644 (file)
index 0000000..b1e9a19
--- /dev/null
@@ -0,0 +1,16 @@
+Eclipse template for creating unit tests with check framework
+
+The template has been tested with Eclipse Helios CDT. Note that check
+framework should be installed first and the check library should be
+found in system path.
+
+Installation:
+
+From the "New Source File" dialog, press "Configure...", then
+"Import..." and select the template XML file
+(e.g. check_template_eclipse_helios.xml). The template should appear
+under "C Source File" tree as "C source template with check unit
+testing" in "Preferences" dialog.
+
+The newly installed template should be available when creating a "New
+Source File" in "Template" combo box.
diff --git a/contrib/eclipse/check_template_eclipse_helios.xml b/contrib/eclipse/check_template_eclipse_helios.xml
new file mode 100644 (file)
index 0000000..b25dda7
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="org.eclipse.cdt.core.cSource.contenttype_context" deleted="false" description="uses check library for unit testing (C only)" enabled="true" name="C source template with check unit testing">${filecomment}
+
+#include &lt;check.h&gt;
+#include &lt;stdlib.h&gt;
+
+START_TEST (test_template)
+{
+}
+END_TEST
+
+Suite* test_suite(void)
+{
+        Suite *s = suite_create("templated_suite");
+
+        /* Core test case */
+        TCase *tc_core = tcase_create("Core");
+        tcase_add_test(tc_core, test_template);
+        suite_add_tcase(s, tc_core);
+
+        return s;
+}
+
+int main()
+{
+        int number_failed;
+        Suite *s = test_suite();
+        SRunner *sr = srunner_create(s);
+        srunner_run_all(sr, CK_NORMAL);
+        number_failed = srunner_ntests_failed(sr);
+        srunner_free(sr);
+        return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+</template></templates>
\ No newline at end of file