Replacing existing summary that only contained information about
existing cross compilers with a full summary for all targets.
We add gdb and container information.
We specify cc for each target (softmmu + linux-user) independently
in case we would use different cc for bare metal vs user binaries.

Users can query full command line for tests by building tests with
tcg-tests target, so no need to repeat it here.

Output before change:

$ ./configure
  Cross compilers
    aarch64                         : /path/to/qemu/build/pyvenv/bin/python3 -B 
/path/to/qemu/tests/docker/docker.py --engine auto cc --cc 
aarch64-linux-gnu-gcc -i qemu/debian-arm64-cross -s /path/to/qemu --
    aarch64_be                      : /path/to/qemu/build/pyvenv/bin/python3 -B 
/path/to/qemu/tests/docker/docker.py --engine auto cc --cc 
aarch64-linux-gnu-gcc -i qemu/debian-all-test-cross -s /path/to/qemu --
    alpha                           : alpha-linux-gnu-gcc
    ...

Output after change:

$ ./configure --disable-containers
  TCG tests
    gdb                             : /usr/bin/gdb-multiarch
    container command               : NO
    cc for aarch64-softmmu          : NO
    cc for aarch64-linux-user       : NO
    cc for aarch64_be-linux-user    : NO
    cc for alpha-softmmu            : alpha-linux-gnu-gcc

$ ./configure --gdb=gdb --container-command=podman
  TCG tests
    gdb                             : /usr/bin/gdb
    container command               : podman
    cc for aarch64-softmmu          : aarch64-linux-gnu-gcc (from 
'debian-all-test-cross' container)
    cc for aarch64-linux-user       : aarch64-linux-gnu-gcc (from 
'debian-all-test-cross' container)
    cc for aarch64_be-linux-user    : aarch64-linux-gnu-gcc (from 
'debian-all-test-cross' container)
    cc for alpha-softmmu            : alpha-linux-gnu-gcc
    ...

Signed-off-by: Pierrick Bouvier <[email protected]>
---
 meson.build           | 19 ++++---------------
 tests/tcg/meson.build | 20 +++++++++++++++++---
 2 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/meson.build b/meson.build
index d59c86ab2bc..f66c466dddd 100644
--- a/meson.build
+++ b/meson.build
@@ -4605,6 +4605,7 @@ subdir('docs')
 subdir('pyvenv')
 # Tests are disabled on emscripten because they rely on host features that 
aren't
 # supported by emscripten (e.g. fork and unix socket).
+tcg_tests_summary = {}
 if host_os != 'emscripten'
   subdir('tests')
 endif
@@ -4792,21 +4793,9 @@ summary_info += {'sparse':            sparse}
 summary_info += {'mingw32 support':   host_os == 'windows'}
 summary(summary_info, bool_yn: true, section: 'Compilation')
 
-# snarf the cross-compilation information for tests
-summary_info = {}
-have_cross = false
-foreach target: target_dirs
-  tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 
'config-target.mak'
-  if fs.exists(tcg_mak)
-    config_cross_tcg = keyval.load(tcg_mak)
-    if 'CC' in config_cross_tcg
-      summary_info += {config_cross_tcg['TARGET_NAME']: config_cross_tcg['CC']}
-      have_cross = true
-    endif
-  endif
-endforeach
-if have_cross
-  summary(summary_info, bool_yn: true, section: 'Cross compilers')
+# TCG tests configuration
+if tcg_tests_summary != {}
+  summary(tcg_tests_summary, bool_yn: true, section: 'TCG tests')
 endif
 
 # Targets and accelerators
diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index 8dd6623ad1d..5a634c7fdf5 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -77,25 +77,30 @@ if gdb.found()
     gdb_arch_supported += {arch: true}
   endforeach
 endif
+tcg_tests_summary += {'gdb': gdb}
 
 docker_supported = false
+container_command = false
 if get_option('containers')
   if get_option('container_command') != ''
     # make sure command is working
-    cmd = get_option('container_command').split()
+    container_command = get_option('container_command')
+    cmd = container_command.split()
     run_command([cmd, 'info'], check: true)
     docker_supported = true
     docker_wrapper = [docker_wrapper, '--command',
-                      get_option('container_command')]
+                      container_command]
   else
     docker_probe = run_command(docker_wrapper, 'probe', check: false)
     docker_supported = docker_probe.returncode() == 0
     if docker_supported
+      container_command = docker_probe.stdout().strip()
       docker_wrapper = [docker_wrapper, '--command',
-                        docker_probe.stdout().strip()]
+                        container_command]
     endif
   endif
 endif
+tcg_tests_summary += {'container command': container_command}
 
 # plugins come first, as we need to build the list
 test_plugins = {}
@@ -269,6 +274,15 @@ foreach target, plan: tcg_tests
     endif
   endif
 
+  summary_cc = false
+  if has_cc
+    summary_cc = plan['cc']
+    if not cc_from_system
+      summary_cc += ' (from \'' + plan['cc_dockerfile'] + '\' container)'
+    endif
+  endif
+  tcg_tests_summary += {'cc for ' + target: summary_cc}
+
   folder = plan['folder']
   gdb_arch = plan['gdb_arch']
   qemu = plan['qemu']
-- 
2.47.3


Reply via email to