mirror of
https://github.com/QubesOS/qubes-doc.git
synced 2025-08-09 15:12:41 -04:00
Correct code-block lexers
Changing `bash` lexer to `console` because it is appropriate most of the time. Then after a manual review, some lexer have been changed. I used `text` each time I was unsure, and for prompt outputs. The page `/developer/building/qubes-iso-building.rst` still need to be reviewed (look for lines starting with `$ #`). I'm not sure about the Windows pages, should we use [doscon](https://pygments.org/docs/lexers/#pygments.lexers.shell.MSDOSSessionLexer) or `powershell`? Is there an appropriate lexer for `guid.conf` content? **Statistics - Before** 870 bash 9 python 9 c 2 yaml **Statistics - After** 684 console 111 text 44 bash 16 yaml 9 systemd 9 c 8 python 4 ini 4 doscon 2 markdown 2 desktop 1 xorg.conf 1 xml+jinja 1 xml 1 kconfig 1 html This suggests that the default lexer should be `console`.
This commit is contained in:
parent
b53776e1eb
commit
ba399ac488
98 changed files with 1022 additions and 1029 deletions
|
@ -46,11 +46,11 @@ You can use ``python3 -m qubes.tests.run -h`` to get usage information:
|
|||
[--do-not-clean] [--do-clean] [--loglevel LEVEL]
|
||||
[--logfile FILE] [--syslog] [--no-syslog] [--kmsg] [--no-kmsg]
|
||||
[TESTNAME [TESTNAME ...]]
|
||||
|
||||
|
||||
positional arguments:
|
||||
TESTNAME list of tests to run named like in description
|
||||
(default: run all tests)
|
||||
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--verbose, -v increase console verbosity level
|
||||
|
@ -74,7 +74,7 @@ You can use ``python3 -m qubes.tests.run -h`` to get usage information:
|
|||
allow running in parallel with qubesd; this is
|
||||
DANGEROUS and WILL RESULT IN INCONSISTENT SYSTEM STATE
|
||||
--break-to-repl break to REPL after tests
|
||||
|
||||
|
||||
When running only specific tests, write their names like in log, in format:
|
||||
MODULE+"/"+CLASS+"/"+FUNCTION. MODULE should omit initial "qubes.tests.".
|
||||
Example: basic/TC_00_Basic/test_000_create
|
||||
|
@ -117,7 +117,7 @@ Example test run:
|
|||
|
||||
Tests are also compatible with nose2 test runner, so you can use this instead:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
sudo systemctl stop qubesd; sudo -E nose2 -v --plugin nose2.plugins.loader.loadtests qubes.tests; sudo systemctl start qubesd
|
||||
|
||||
|
@ -138,7 +138,7 @@ The below example however will assume that you set up a build environment as des
|
|||
|
||||
Assuming you cloned the ``qubes-builder`` repository to your home directory inside a fedora VM, you can use the following commands to run the unit tests:
|
||||
|
||||
.. code:: bash
|
||||
.. code:: console
|
||||
|
||||
cd ~
|
||||
sudo dnf install python3-pip lvm2 python35 python3-virtualenv
|
||||
|
@ -213,37 +213,37 @@ When testing (Py)QT applications, it’s useful to create a separate QApplicatio
|
|||
import quamash
|
||||
import unittest
|
||||
import gc
|
||||
|
||||
|
||||
class SomeTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
[...]
|
||||
|
||||
|
||||
# force "cleanlooks" style, the default one on Xfce (GtkStyle) use
|
||||
# static variable internally and caches pointers to later destroyed
|
||||
# objects (result: SEGV)
|
||||
self.qtapp = QtGui.QApplication(["test", "-style", "cleanlooks"])
|
||||
|
||||
|
||||
# construct event loop even if this particular test doesn't use it,
|
||||
# otherwise events with qtapp references will be queued there anyway and the
|
||||
# first test that actually use event loop will try to dereference (already
|
||||
# destroyed) objects, resulting in SEGV
|
||||
self.loop = quamash.QEventLoop(self.qtapp)
|
||||
|
||||
|
||||
def tearDown(self):
|
||||
[...]
|
||||
# process any pending events before destroying the object
|
||||
self.qtapp.processEvents()
|
||||
|
||||
|
||||
# queue destroying the QApplication object, do that for any other QT
|
||||
# related objects here too
|
||||
self.qtapp.deleteLater()
|
||||
|
||||
|
||||
# process any pending events (other than just queued destroy), just in case
|
||||
self.qtapp.processEvents()
|
||||
|
||||
|
||||
# execute main loop, which will process all events, _including just queued destroy_
|
||||
self.loop.run_until_complete(asyncio.sleep(0))
|
||||
|
||||
|
||||
# at this point it QT objects are destroyed, cleanup all remaining references;
|
||||
# del other QT object here too
|
||||
self.loop.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue