[libsoup] examples: move examples from tests/ to examples/
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] examples: move examples from tests/ to examples/
- Date: Sat, 23 Feb 2013 11:01:32 +0000 (UTC)
commit 4c7d4c4cd46f64538ca0b3e186b52bdfcaa97e29
Author: Dan Winship <danw gnome org>
Date: Sat Feb 23 02:13:26 2013 +0100
examples: move examples from tests/ to examples/
get, simple-httpd, and simple-proxy are more example code than test
programs, so move them into a separate directory.
Also, remove "dns", which was once a sort-of test of SoupAddress, but
is now just a redundant sort-of test of GResolver.
.gitignore | 7 ++--
Makefile.am | 2 +-
configure.ac | 1 +
examples/Makefile.am | 14 ++++++++
{tests => examples}/get.c | 4 ++-
{tests => examples}/simple-httpd.c | 6 ++-
{tests => examples}/simple-proxy.c | 5 ++-
tests/Makefile.am | 6 +---
tests/dns.c | 60 ------------------------------------
9 files changed, 31 insertions(+), 74 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 19686f4..b3a877b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,9 @@ docs/reference/libsoup-2.4.signals
docs/reference/libsoup-2.4.types
docs/reference/tmpl
docs/reference/xml
+examples/get
+examples/simple-httpd
+examples/simple-proxy
gtk-doc.make
install-sh
libsoup-zip
@@ -68,14 +71,10 @@ tests/*.log
tests/*.trs
tests/*-test
tests/date
-tests/dns
-tests/get
tests/getbug
tests/header-parsing
tests/httpd.conf
tests/ntlm-test-helper
tests/pull-api
-tests/simple-httpd
-tests/simple-proxy
tests/soup-tests.gresource
tests/uri-parsing
diff --git a/Makefile.am b/Makefile.am
index 18bf80a..66992d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-SUBDIRS = libsoup po tests docs
+SUBDIRS = libsoup po tests examples docs
EXTRA_DIST = \
data/effective_tld_names.dat \
diff --git a/configure.ac b/configure.ac
index 68293d3..36a1687 100644
--- a/configure.ac
+++ b/configure.ac
@@ -361,6 +361,7 @@ AC_CONFIG_FILES([
po/Makefile.in
po/Makefile
tests/Makefile
+ examples/Makefile
docs/Makefile
docs/reference/Makefile
libsoup/soup-version.h
diff --git a/examples/Makefile.am b/examples/Makefile.am
new file mode 100644
index 0000000..69e5b55
--- /dev/null
+++ b/examples/Makefile.am
@@ -0,0 +1,14 @@
+INCLUDES = \
+ -I$(top_srcdir) \
+ -DSRCDIR=\""$(abs_srcdir)"\" \
+ -DBUILDDIR=\""$(builddir)"\" \
+ $(GLIB_CFLAGS)
+
+LIBS = \
+ $(top_builddir)/libsoup/libsoup-2.4.la \
+ $(GLIB_LIBS)
+
+noinst_PROGRAMS = \
+ get \
+ simple-httpd \
+ simple-proxy
diff --git a/tests/get.c b/examples/get.c
similarity index 98%
rename from tests/get.c
rename to examples/get.c
index 15d6903..f28e535 100644
--- a/tests/get.c
+++ b/examples/get.c
@@ -3,13 +3,15 @@
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "test-utils.h"
#include <stdio.h>
+#include <stdlib.h>
#ifdef G_OS_WIN32
#include <getopt.h>
#endif
+#include <libsoup/soup.h>
+
static SoupSession *session;
static GMainLoop *loop;
static gboolean debug = FALSE, quiet = FALSE;
diff --git a/tests/simple-httpd.c b/examples/simple-httpd.c
similarity index 99%
rename from tests/simple-httpd.c
rename to examples/simple-httpd.c
index 75b7cd4..3d05c2a 100644
--- a/tests/simple-httpd.c
+++ b/examples/simple-httpd.c
@@ -3,18 +3,20 @@
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "test-utils.h"
-
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
#ifdef G_OS_WIN32
#include <getopt.h>
#endif
+#include <libsoup/soup.h>
+
static int
compare_strings (gconstpointer a, gconstpointer b)
{
diff --git a/tests/simple-proxy.c b/examples/simple-proxy.c
similarity index 98%
rename from tests/simple-proxy.c
rename to examples/simple-proxy.c
index 765fa5e..1a9e0ed 100644
--- a/tests/simple-proxy.c
+++ b/examples/simple-proxy.c
@@ -3,12 +3,15 @@
* Copyright (C) 2001-2003, Ximian, Inc.
*/
-#include "test-utils.h"
+#include <stdlib.h>
+#include <string.h>
#ifdef G_OS_WIN32
#include <getopt.h>
#endif
+#include <libsoup/soup.h>
+
/* WARNING: this is really really really not especially compliant with
* RFC 2616. But it does work for basic stuff.
*/
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5bbcba8..417b04c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -42,12 +42,8 @@ TESTS = \
xmlrpc-test
noinst_PROGRAMS = \
- $(TESTS) \
- dns \
- get \
ntlm-test-helper \
- simple-httpd \
- simple-proxy
+ $(TESTS)
noinst_DATA = soup-tests.gresource
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]