aboutsummaryrefslogtreecommitdiffstats
path: root/t/test.c
diff options
context:
space:
mode:
authorJason Woodward2007-06-05 02:33:44 +0000
committerJason Woodward2007-06-05 02:33:44 +0000
commite2c6073c3078a666cf672c6d7a24b20bafe9e643 (patch)
treec610e8ea989826b1402de067ddb7858f024a600d /t/test.c
parent77a80e03c3eaa9f73b37ce73ffdf257584cfd713 (diff)
downloadslapt-get-e2c6073c3078a666cf672c6d7a24b20bafe9e643.tar.gz
* Wrapped generated slapt.h in ifndef guard
* Added initial unit testing to tree
Diffstat (limited to 't/test.c')
-rw-r--r--t/test.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/t/test.c b/t/test.c
new file mode 100644
index 0000000..5b67cad
--- /dev/null
+++ b/t/test.c
@@ -0,0 +1,55 @@
+#include "common.h"
+#include "test_common.h"
+#include "test_configuration.h"
+#include "test_curl.h"
+#include "test_packages.h"
+#include "test_transaction.h"
+
+slapt_pkg_info_t pkg = {
+ "8598a2a6d683d098b09cdc938de1e3c7",
+ "gslapt",
+ "0.3.15-i386-1",
+ "http://software.jaos.org/slackpacks/11.0/",
+ ".",
+ "gslapt: gslapt (GTK slapt-get, an APT like system for Slackware)\n",
+ "",
+ "",
+ "",
+ ".tgz",
+ 115,
+ 440
+};
+
+Suite *slapt_test_suite()
+{
+ Suite *s = suite_create ("Slapt");
+
+ /* generic tests */
+ TCase *tc_packages = tcase_create ("Core");
+ /* tcase_add_checked_fixture (tc_packages, setup, teardown); */
+ /* tcase_add_test (tc_packages, test_money_create); */
+ suite_add_tcase (s, tc_packages);
+
+ return s;
+
+}
+
+int main(void)
+{
+ int number_failed;
+
+ Suite *s = slapt_test_suite();
+ SRunner *sr = srunner_create (s);
+
+ srunner_add_suite(sr, common_test_suite());
+ srunner_add_suite(sr, configuration_test_suite());
+ srunner_add_suite(sr, curl_test_suite());
+ srunner_add_suite(sr, packages_test_suite());
+ srunner_add_suite(sr, transaction_test_suite());
+
+ srunner_run_all (sr, CK_NORMAL);
+ number_failed = srunner_ntests_failed (sr);
+
+ srunner_free (sr);
+ return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}