1 /*
2 * This library is free software: you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License as published by
4 * the Free Software Foundation.
5 *
6 * This library is distributed in the hope that it will be useful, but
7 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
8 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
9 * for more details.
10 *
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this library. If not, see <http://www.gnu.org/licenses/>.
13 */
14
15 /* store testing, for remote folders */
16
17 #include "camel-test.h"
18 #include "camel-test-provider.h"
19 #include "folders.h"
20 #include "session.h"
21
22 static const gchar *nntp_drivers[] = { "nntp" };
23
24 static const gchar *remote_providers[] = {
25 "NNTP_TEST_URL",
26 };
27
main(gint argc,gchar ** argv)28 gint main (gint argc, gchar **argv)
29 {
30 CamelSession *session;
31 gint i;
32 gchar *path;
33
34 camel_test_init (argc, argv);
35 camel_test_provider_init (1, nntp_drivers);
36
37 /* clear out any camel-test data */
38 system ("/bin/rm -rf /tmp/camel-test");
39
40 session = camel_test_session_new ("/tmp/camel-test");
41
42 /* todo: cross-check everything with folder_info checks as well */
43 /* todo: subscriptions? */
44 for (i = 0; i < G_N_ELEMENTS (remote_providers); i++) {
45 path = getenv (remote_providers[i]);
46
47 if (path == NULL) {
48 printf ("Aborted (ignored).\n");
49 printf ("Set '%s', to re-run test.\n", remote_providers[i]);
50 /* tells make check to ignore us in the total count */
51 _exit (77);
52 }
53 camel_test_nonfatal ("Not sure how many tests apply to NNTP");
54 test_folder_basic (session, path, FALSE, FALSE);
55 camel_test_fatal ();
56 }
57
58 g_object_unref (session);
59
60 return 0;
61 }
62