Skip to content

Commit 935efca

Browse files
committed
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-09-06' into staging
* Add definitions of terms for CI/testing * Fix g_setenv problem discovered by Coverity * Gitlab CI improvements * Build system improvements (configure script + meson.build) * Removal of the show-fixed-bugs.sh script * Clean up of the sdl and curses options # gpg: Signature made Mon 06 Sep 2021 10:51:49 BST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "[email protected]" # gpg: Good signature from "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [unknown] # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/thuth-gitlab/tags/pull-request-2021-09-06: softmmu/vl: Deprecate the -sdl and -curses option softmmu/vl: Deprecate the old grab options softmmu/vl: Add a "grab-mod" parameter to the -display sdl option scripts: Remove the "show-fixed-bugs.sh" file configure / meson: Move the GBM handling to meson.build meson.build: Don't use internal libfdt if the user requested the system libfdt meson.build: Fix the check for a usable libfdt gitlab-ci: Don't try to use the system libfdt in the debian job libqtest: check for g_setenv() failure docs: add definitions of terms for CI/testing Signed-off-by: Peter Maydell <[email protected]>
2 parents 88afdc9 + 6695e4c commit 935efca

File tree

11 files changed

+192
-124
lines changed

11 files changed

+192
-124
lines changed

.gitlab-ci.d/buildtest.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ build-system-debian:
7474
job: amd64-debian-container
7575
variables:
7676
IMAGE: debian-amd64
77-
CONFIGURE_ARGS: --enable-fdt=system
7877
TARGETS: arm-softmmu avr-softmmu i386-softmmu mipsel-softmmu
7978
riscv64-softmmu sh4eb-softmmu sparc-softmmu xtensaeb-softmmu
8079
MAKE_CHECK_ARGS: check-build

configure

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,13 +3451,6 @@ esac
34513451
##########################################
34523452
# opengl probe (for sdl2, gtk)
34533453

3454-
gbm="no"
3455-
if $pkg_config gbm; then
3456-
gbm_cflags="$($pkg_config --cflags gbm)"
3457-
gbm_libs="$($pkg_config --libs gbm)"
3458-
gbm="yes"
3459-
fi
3460-
34613454
if test "$opengl" != "no" ; then
34623455
epoxy=no
34633456
if $pkg_config epoxy; then
@@ -4688,13 +4681,6 @@ if test "$opengl" = "yes" ; then
46884681
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
46894682
fi
46904683

4691-
if test "$gbm" = "yes" ; then
4692-
echo "CONFIG_GBM=y" >> $config_host_mak
4693-
echo "GBM_LIBS=$gbm_libs" >> $config_host_mak
4694-
echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak
4695-
fi
4696-
4697-
46984684
if test "$avx2_opt" = "yes" ; then
46994685
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
47004686
fi

contrib/vhost-user-gpu/meson.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
if 'CONFIG_TOOLS' in config_host and virgl.found() \
2-
and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
3-
and pixman.found()
1+
if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \
2+
and 'CONFIG_LINUX' in config_host and pixman.found()
43
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
54
dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
65
install: true,

docs/about/deprecated.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,26 @@ an underscore between "window" and "close").
138138
The ``-no-quit`` is a synonym for ``-display ...,window-close=off`` which
139139
should be used instead.
140140

141+
``-alt-grab`` and ``-display sdl,alt_grab=on`` (since 6.2)
142+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
143+
144+
Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
145+
146+
``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (since 6.2)
147+
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
148+
149+
Use ``-display sdl,grab-mod=rctrl`` instead.
150+
151+
``-sdl`` (since 6.2)
152+
''''''''''''''''''''
153+
154+
Use ``-display sdl`` instead.
155+
156+
``-curses`` (since 6.2)
157+
'''''''''''''''''''''''
158+
159+
Use ``-display curses`` instead.
160+
141161

142162
Plugin argument passing through ``arg=<string>`` (since 6.1)
143163
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

docs/devel/ci-definitions.rst

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Definition of terms
2+
===================
3+
4+
This section defines the terms used in this document and correlates them with
5+
what is currently used on QEMU.
6+
7+
Automated tests
8+
---------------
9+
10+
An automated test is written on a test framework using its generic test
11+
functions/classes. The test framework can run the tests and report their
12+
success or failure [1]_.
13+
14+
An automated test has essentially three parts:
15+
16+
1. The test initialization of the parameters, where the expected parameters,
17+
like inputs and expected results, are set up;
18+
2. The call to the code that should be tested;
19+
3. An assertion, comparing the result from the previous call with the expected
20+
result set during the initialization of the parameters. If the result
21+
matches the expected result, the test has been successful; otherwise, it has
22+
failed.
23+
24+
Unit testing
25+
------------
26+
27+
A unit test is responsible for exercising individual software components as a
28+
unit, like interfaces, data structures, and functionality, uncovering errors
29+
within the boundaries of a component. The verification effort is in the
30+
smallest software unit and focuses on the internal processing logic and data
31+
structures. A test case of unit tests should be designed to uncover errors due
32+
to erroneous computations, incorrect comparisons, or improper control flow [2]_.
33+
34+
On QEMU, unit testing is represented by the 'check-unit' target from 'make'.
35+
36+
Functional testing
37+
------------------
38+
39+
A functional test focuses on the functional requirement of the software.
40+
Deriving sets of input conditions, the functional tests should fully exercise
41+
all the functional requirements for a program. Functional testing is
42+
complementary to other testing techniques, attempting to find errors like
43+
incorrect or missing functions, interface errors, behavior errors, and
44+
initialization and termination errors [3]_.
45+
46+
On QEMU, functional testing is represented by the 'check-qtest' target from
47+
'make'.
48+
49+
System testing
50+
--------------
51+
52+
System tests ensure all application elements mesh properly while the overall
53+
functionality and performance are achieved [4]_. Some or all system components
54+
are integrated to create a complete system to be tested as a whole. System
55+
testing ensures that components are compatible, interact correctly, and
56+
transfer the right data at the right time across their interfaces. As system
57+
testing focuses on interactions, use case-based testing is a practical approach
58+
to system testing [5]_. Note that, in some cases, system testing may require
59+
interaction with third-party software, like operating system images, databases,
60+
networks, and so on.
61+
62+
On QEMU, system testing is represented by the 'check-acceptance' target from
63+
'make'.
64+
65+
Flaky tests
66+
-----------
67+
68+
A flaky test is defined as a test that exhibits both a passing and a failing
69+
result with the same code on different runs. Some usual reasons for an
70+
intermittent/flaky test are async wait, concurrency, and test order dependency
71+
[6]_.
72+
73+
Gating
74+
------
75+
76+
A gate restricts the move of code from one stage to another on a
77+
test/deployment pipeline. The step move is granted with approval. The approval
78+
can be a manual intervention or a set of tests succeeding [7]_.
79+
80+
On QEMU, the gating process happens during the pull request. The approval is
81+
done by the project leader running its own set of tests. The pull request gets
82+
merged when the tests succeed.
83+
84+
Continuous Integration (CI)
85+
---------------------------
86+
87+
Continuous integration (CI) requires the builds of the entire application and
88+
the execution of a comprehensive set of automated tests every time there is a
89+
need to commit any set of changes [8]_. The automated tests can be composed of
90+
the unit, functional, system, and other tests.
91+
92+
Keynotes about continuous integration (CI) [9]_:
93+
94+
1. System tests may depend on external software (operating system images,
95+
firmware, database, network).
96+
2. It may take a long time to build and test. It may be impractical to build
97+
the system being developed several times per day.
98+
3. If the development platform is different from the target platform, it may
99+
not be possible to run system tests in the developer’s private workspace.
100+
There may be differences in hardware, operating system, or installed
101+
software. Therefore, more time is required for testing the system.
102+
103+
References
104+
----------
105+
106+
.. [1] Sommerville, Ian (2016). Software Engineering. p. 233.
107+
.. [2] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
108+
A Practitioner’s Approach. p. 48, 376, 378, 381.
109+
.. [3] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
110+
A Practitioner’s Approach. p. 388.
111+
.. [4] Pressman, Roger S. & Maxim, Bruce R. (2020). Software Engineering,
112+
A Practitioner’s Approach. Software Engineering, p. 377.
113+
.. [5] Sommerville, Ian (2016). Software Engineering. p. 59, 232, 240.
114+
.. [6] Luo, Qingzhou, et al. An empirical analysis of flaky tests.
115+
Proceedings of the 22nd ACM SIGSOFT International Symposium on
116+
Foundations of Software Engineering. 2014.
117+
.. [7] Humble, Jez & Farley, David (2010). Continuous Delivery:
118+
Reliable Software Releases Through Build, Test, and Deployment, p. 122.
119+
.. [8] Humble, Jez & Farley, David (2010). Continuous Delivery:
120+
Reliable Software Releases Through Build, Test, and Deployment, p. 55.
121+
.. [9] Sommerville, Ian (2016). Software Engineering. p. 743.

docs/devel/ci.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ found at::
88

99
https://wiki.qemu.org/Testing/CI
1010

11+
.. include:: ci-definitions.rst
1112
.. include:: ci-jobs.rst
1213
.. include:: ci-runners.rst

meson.build

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,6 @@ if not get_option('zstd').auto() or have_block
472472
required: get_option('zstd'),
473473
method: 'pkg-config', kwargs: static_kwargs)
474474
endif
475-
gbm = not_found
476-
if 'CONFIG_GBM' in config_host
477-
gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
478-
link_args: config_host['GBM_LIBS'].split())
479-
endif
480475
virgl = not_found
481476
if not get_option('virglrenderer').auto() or have_system
482477
virgl = dependency('virglrenderer',
@@ -816,11 +811,17 @@ coreaudio = not_found
816811
if 'CONFIG_AUDIO_COREAUDIO' in config_host
817812
coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
818813
endif
814+
819815
opengl = not_found
820816
if 'CONFIG_OPENGL' in config_host
821817
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
822818
link_args: config_host['OPENGL_LIBS'].split())
823819
endif
820+
gbm = not_found
821+
if (have_system or have_tools) and (virgl.found() or opengl.found())
822+
gbm = dependency('gbm', method: 'pkg-config', required: false,
823+
kwargs: static_kwargs)
824+
endif
824825

825826
gnutls = not_found
826827
gnutls_crypto = not_found
@@ -1244,6 +1245,7 @@ config_host_data.set('CONFIG_MPATH', mpathpersist.found())
12441245
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
12451246
config_host_data.set('CONFIG_CURL', curl.found())
12461247
config_host_data.set('CONFIG_CURSES', curses.found())
1248+
config_host_data.set('CONFIG_GBM', gbm.found())
12471249
config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found())
12481250
if glusterfs.found()
12491251
config_host_data.set('CONFIG_GLUSTERFS_XLATOR_OPT', glusterfs.version().version_compare('>=4'))
@@ -1912,10 +1914,13 @@ if have_system
19121914
int main(void) { fdt_check_full(NULL, 0); return 0; }''',
19131915
dependencies: fdt)
19141916
fdt_opt = 'system'
1917+
elif fdt_opt == 'system'
1918+
error('system libfdt requested, but it is too old (1.5.1 or newer required)')
19151919
elif have_internal
19161920
fdt_opt = 'internal'
19171921
else
19181922
fdt_opt = 'disabled'
1923+
fdt = not_found
19191924
endif
19201925
endif
19211926
if fdt_opt == 'internal'
@@ -3083,7 +3088,7 @@ summary_info += {'U2F support': u2f.found()}
30833088
summary_info += {'libusb': libusb.found()}
30843089
summary_info += {'usb net redir': usbredir.found()}
30853090
summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
3086-
summary_info += {'GBM': config_host.has_key('CONFIG_GBM')}
3091+
summary_info += {'GBM': gbm.found()}
30873092
summary_info += {'libiscsi support': libiscsi.found()}
30883093
summary_info += {'libnfs support': libnfs.found()}
30893094
if targetos == 'windows'

qemu-options.hx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
18341834
#endif
18351835
#if defined(CONFIG_SDL)
18361836
"-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n"
1837-
" [,show-cursor=on|off][,window-close=on|off]\n"
1837+
" [,grab-mod=<mod>][,show-cursor=on|off][,window-close=on|off]\n"
18381838
#endif
18391839
#if defined(CONFIG_GTK)
18401840
"-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
@@ -1880,9 +1880,15 @@ SRST
18801880
window; see the SDL documentation for other possibilities).
18811881
Valid parameters are:
18821882

1883-
``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing
1883+
``grab-mod=<mods>`` : Used to select the modifier keys for toggling
1884+
the mouse grabbing in conjunction with the "g" key. `<mods>` can be
1885+
either `lshift-lctrl-lalt` or `rctrl`.
1886+
1887+
``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing.
1888+
This parameter is deprecated - use ``grab-mod`` instead.
18841889

1885-
``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing
1890+
``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing.
1891+
This parameter is deprecated - use ``grab-mod`` instead.
18861892

18871893
``gl=on|off|core|es`` : Use OpenGL for displaying
18881894

@@ -1967,7 +1973,8 @@ SRST
19671973
``-alt-grab``
19681974
Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
19691975
this also affects the special keys (for fullscreen, monitor-mode
1970-
switching, etc).
1976+
switching, etc). This option is deprecated - please use
1977+
``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
19711978
ERST
19721979

19731980
DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
@@ -1977,7 +1984,8 @@ SRST
19771984
``-ctrl-grab``
19781985
Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
19791986
also affects the special keys (for fullscreen, monitor-mode
1980-
switching, etc).
1987+
switching, etc). This option is deprecated - please use
1988+
``-display sdl,grab-mod=rctrl`` instead.
19811989
ERST
19821990

19831991
DEF("no-quit", 0, QEMU_OPTION_no_quit,

0 commit comments

Comments
 (0)