[glib-networking/wip/nacho/openssl-fix: 3/9] Add a way to skip backends for tests



commit 4008c1e3e09985409147819e99f423b07322e0cd
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Mon Sep 10 15:34:23 2018 +0200

    Add a way to skip backends for tests

 tls/tests/meson.build | 74 ++++++++++++++++++++++++++-------------------------
 1 file changed, 38 insertions(+), 36 deletions(-)
---
diff --git a/tls/tests/meson.build b/tls/tests/meson.build
index f8afde6..bf05aad 100644
--- a/tls/tests/meson.build
+++ b/tls/tests/meson.build
@@ -22,52 +22,54 @@ envs = [
 ]
 
 test_programs = [
-  ['certificate', [], deps],
-  ['file-database', [], deps],
-  ['connection', ['mock-interaction.c'], deps],
-  ['dtls-connection', ['mock-interaction.c'], deps],
+  ['certificate', [], deps, []],
+  ['file-database', [], deps, []],
+  ['connection', ['mock-interaction.c'], deps, []],
+  ['dtls-connection', ['mock-interaction.c'], deps, ['openssl']],
 ]
 
 foreach backend: backends
   foreach program: test_programs
-    program_name = program[0] + '-' + backend
+    if not program[3].contains(backend)
+      program_name = program[0] + '-' + backend
 
-    test_conf = configuration_data()
-    test_conf.set('installed_tests_dir', installed_tests_execdir)
-    test_conf.set('program', program_name)
+      test_conf = configuration_data()
+      test_conf.set('installed_tests_dir', installed_tests_execdir)
+      test_conf.set('program', program_name)
 
-    if enable_installed_tests
-      configure_file(
-        input: test_template,
-        output: program_name + '.test',
-        install_dir: installed_tests_metadir,
-        configuration: test_conf
-      )
-    endif
+      if enable_installed_tests
+        configure_file(
+          input: test_template,
+          output: program_name + '.test',
+          install_dir: installed_tests_metadir,
+          configuration: test_conf
+        )
+      endif
 
-    test_cflags = cflags + [
-      '-DBACKEND="@0@"'.format(backend),
-    ]
+      test_cflags = cflags + [
+        '-DBACKEND="@0@"'.format(backend),
+      ]
 
-    exe = executable(
-      program_name,
-      [program[0] + '.c'] + program[1],
-      include_directories: incs,
-      dependencies: program[2],
-      c_args: test_cflags,
-      install: enable_installed_tests,
-      install_dir: installed_tests_execdir
-    )
+      exe = executable(
+        program_name,
+        [program[0] + '.c'] + program[1],
+        include_directories: incs,
+        dependencies: program[2],
+        c_args: test_cflags,
+        install: enable_installed_tests,
+        install_dir: installed_tests_execdir
+      )
 
-    test_envs = envs + [
-      'GIO_MODULE_DIR=' + join_paths(meson.build_root(), 'tls', backend)
-    ]
+      test_envs = envs + [
+        'GIO_MODULE_DIR=' + join_paths(meson.build_root(), 'tls', backend)
+      ]
 
-    test(
-      program_name,
-      exe,
-      env: test_envs
-    )
+      test(
+        program_name,
+        exe,
+        env: test_envs
+      )
+    endif
   endforeach
 endforeach
 


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