[librest/wip/baedert/tests] add meson build files



commit baa0f8e2886be65122e188957a42d3cfd011a480
Author: Timm Bäder <mail baedert org>
Date:   Tue Feb 21 12:20:43 2017 +0100

    add meson build files
    
    WIP (enums?)

 docs/reference/rest/meson.build |    5 ++
 meson.build                     |   79 +++++++++++++++++++++++++++++++++++++++
 meson_options.txt               |    2 +
 rest-extras/meson.build         |   20 ++++++++++
 tests/meson.build               |   43 +++++++++++++++++++++
 tests/test-server.c             |    2 +-
 6 files changed, 150 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/rest/meson.build b/docs/reference/rest/meson.build
new file mode 100644
index 0000000..2823410
--- /dev/null
+++ b/docs/reference/rest/meson.build
@@ -0,0 +1,5 @@
+gnome.gtkdoc(
+  'rest',
+  main_xml : 'rest-docs.xml',
+  src_dir : meson.source_root() + '/rest/',
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..699d300
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,79 @@
+project('librest', 'c')
+
+gnome = import('gnome')
+
+librest_sources = files([
+  'rest/oauth-proxy-call.c',
+  'rest/oauth-proxy.c',
+  'rest/oauth2-proxy-call.c',
+  'rest/oauth2-proxy.c',
+  'rest/rest-main.c',
+  'rest/rest-param.c',
+  'rest/rest-params.c',
+  'rest/rest-proxy-auth.c',
+  'rest/rest-proxy-call.c',
+  'rest/rest-proxy.c',
+  'rest/rest-xml-node.c',
+  'rest/rest-xml-parser.c',
+  'rest/sha1.c',
+])
+
+librest_headers = files([
+  'rest/oauth-proxy-call.h',
+  'rest/oauth-proxy.h',
+  'rest/oauth2-proxy-call.h',
+  'rest/oauth2-proxy.h',
+  'rest/rest-enum-types.h',
+  'rest/rest-param.h',
+  'rest/rest-params.h',
+  'rest/rest-proxy-auth.h',
+  'rest/rest-proxy-call.h',
+  'rest/rest-proxy.h',
+  'rest/rest-xml-node.h',
+  'rest/rest-xml-parser.h',
+])
+
+
+
+# generate rest/rest-marshal.c
+rest_marshal = gnome.genmarshal(
+  'rest-marshal',
+  sources: files(['rest/rest-marshal.txt'])
+)
+
+
+cdata = configuration_data()
+configure_file(
+  input : 'config.h.in',
+  output: 'config.h',
+  configuration: cdata
+)
+
+soup_dep = dependency('libsoup-2.4', version: '>= 2.42')
+xml_dep  = dependency('libxml-2.0')
+
+rest_deps = [soup_dep, xml_dep]
+
+librest = shared_library(
+  'rest',
+  [librest_sources, rest_marshal],
+  dependencies: rest_deps,
+  install: true
+)
+install_headers(librest_headers)
+
+librest_dep = declare_dependency(
+  link_with: librest,
+  dependencies: rest_deps,
+  include_directories: [include_directories('.')]
+)
+
+if get_option('extras')
+  subdir('rest-extras')
+endif
+
+if get_option('gtk-doc')
+  subdir('docs/reference/rest/')
+endif
+
+subdir('tests')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..c4f5779
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,2 @@
+option('extras', type: 'boolean', value: 'false')
+option('gtk-doc', type: 'boolean', value: 'true')
diff --git a/rest-extras/meson.build b/rest-extras/meson.build
new file mode 100644
index 0000000..e15e72b
--- /dev/null
+++ b/rest-extras/meson.build
@@ -0,0 +1,20 @@
+
+
+rest_extras_sources = files([
+  'flickr-proxy.c',
+  'flickr-proxy-call.c',
+  'lastfm-proxy.c',
+  'lastfm-proxy-call.c',
+])
+
+
+librest_extras = shared_library(
+  'rest_extras',
+  rest_extras_sources,
+  dependencies : librest_dep
+)
+
+librest_extras_dep = declare_dependency(
+  link_with: librest_extras,
+  dependencies: librest_dep,
+)
diff --git a/tests/meson.build b/tests/meson.build
new file mode 100644
index 0000000..3c3a16d
--- /dev/null
+++ b/tests/meson.build
@@ -0,0 +1,43 @@
+
+tests = [
+  'custom-serialize',
+  'oauth',
+  'oauth2',
+  'oauth-async',
+  'proxy',
+  'proxy-continuous',
+  'threaded',
+  #  'xml'   Broken.
+]
+
+foreach test_name : tests
+  testcase = executable(
+    test_name,
+    test_name + '.c',
+    'test-server.c',
+    dependencies: librest_dep
+  )
+  test(test_name, testcase)
+
+endforeach
+
+
+# rest-extras tests
+
+if get_option('extras')
+  extras_tests = [
+    'flickr',
+    'lastfm'
+  ]
+
+  foreach test_name : extras_tests
+    testcase = executable(
+      test_name,
+      test_name + '.c',
+      dependencies: librest_extras_dep
+    )
+    test(test_name, testcase)
+
+  endforeach
+
+endif
diff --git a/tests/test-server.c b/tests/test-server.c
index 5e6c484..c7490e5 100644
--- a/tests/test-server.c
+++ b/tests/test-server.c
@@ -34,7 +34,7 @@ test_server_create (SoupServerCallback server_cb)
   context = g_main_context_new ();
   g_main_context_push_thread_default (context);
   main_loop = g_main_loop_new (context, FALSE);
-  server = soup_server_new (NULL);
+  server = soup_server_new (NULL, NULL);
 
   soup_server_listen_local (server, 0, 0, &error);
   g_assert_no_error (error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]