[glib-networking/wip/nacho/openssl: 12/21] Add a way to skip backends for tests



commit 70a3dd40c77232954243f68fa31e239ef288c44a
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 3bdba0e..6198f70 100644
--- a/tls/tests/meson.build
+++ b/tls/tests/meson.build
@@ -22,10 +22,10 @@ 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']],
 ]
 
 if pkcs11_dep.found()
@@ -44,44 +44,46 @@ endif
 
 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]