[glib-networking/mcatanzaro/tls1.2: 4/10] tests: simplify meson.build a bit



commit ec8df5b6b0164deffb310b9bbfca48a3adaff7e4
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Aug 17 15:59:51 2019 -0500

    tests: simplify meson.build a bit
    
    I need to open-code more backend-specific differences here, so keeping
    generic support for excluding tests from specific backends no longer
    makes a ton of sense. We already have an OpenSSL-specific include here
    anyway.

 tls/tests/meson.build | 93 ++++++++++++++++++++++++++++-----------------------
 1 file changed, 51 insertions(+), 42 deletions(-)
---
diff --git a/tls/tests/meson.build b/tls/tests/meson.build
index df9dba4..4cf289d 100644
--- a/tls/tests/meson.build
+++ b/tls/tests/meson.build
@@ -22,58 +22,67 @@ envs = [
 ]
 
 test_programs = [
-  ['certificate', [], deps, []],
-  ['file-database', [], deps, []],
-  ['connection', ['mock-interaction.c'], deps, []],
+  ['certificate', [], deps],
+  ['file-database', [], deps],
+  ['connection', ['mock-interaction.c'], deps],
 # DTLS tests are disabled until we fix https://gitlab.gnome.org/GNOME/glib-networking/issues/49
-#  ['dtls-connection', ['mock-interaction.c'], deps, ['openssl']],
+#  ['dtls-connection', ['mock-interaction.c'], deps],
 ]
 
 foreach backend: backends
   foreach program: test_programs
-    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)
-
-      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),
-        '-DBACKEND_IS_' + backend.to_upper(),
-      ]
+    # OpenSSL does not support DTLS yet.
+    if program[0] == 'dtls-connection' and backend == 'openssl'
+      continue
+    endif
+
+    program_name = program[0] + '-' + backend
 
-      if backend == 'openssl'
-        incs += openssl_inc
-      endif
-
-      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_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
+
+    test_cflags = cflags + [
+      '-DBACKEND="@0@"'.format(backend),
+      '-DBACKEND_IS_' + backend.to_upper(),
+    ]
 
-      test_envs = envs + [
-        'GIO_MODULE_DIR=' + join_paths(meson.build_root(), 'tls', backend)
+    if backend == 'openssl'
+      incs += openssl_inc
+    endif
+
+    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)
+    ]
+
+    if backend == 'gnutls'
+      test_envs += [
+        'G_TLS_GNUTLS_PRIORITY=NORMAL:%COMPAT:-VERS-TLS1.3'
       ]
+    endif
 
-      # OpenSSL tests are disabled until we fix https://gitlab.gnome.org/GNOME/glib-networking/issues/54
-      if backend != 'openssl'
-        test(program_name, exe, env: test_envs)
-      endif
+    # OpenSSL tests are disabled until we fix https://gitlab.gnome.org/GNOME/glib-networking/issues/54
+    if backend != 'openssl'
+      test(program_name, exe, env: test_envs)
     endif
   endforeach
 endforeach


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