summaryrefslogtreecommitdiff
path: root/unittests/datatests.py
AgeCommit message (Collapse)Author
2025-10-29environment: move detection functions to envconfig.pyPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06unittests: do not use coredata.set_optionPaolo Bonzini
optstore is able to set buildtype correctly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06options: replace get_value with get_value_forPaolo Bonzini
The two methods are identical. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-03-14Move variables to InterpreterBaseCharles Brunet
subproject_dir, environment, and coredata
2025-03-05options: Remove BuiltinOption classDylan Baker
It basically served two purposes, to allow us to initialize UserOptions, and to convert those options into Argparse values. The latter has been transformed into a standalone function, the former can be easily achieved without this class. This reduces LOC, simplifies setup, and helps with our type safety.
2024-07-17Remove module type from OptionKey.Jussi Pakkanen
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-06-14Replace direct indexing with named methods.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-05-23Refactor option classes to their own file.Jussi Pakkanen
2024-04-09modules: rename qt.py -> _qt.pyDylan Baker
Since it's an implementation detail, and shouldn't be exposed. This also helps give better error messages when a user writes `import('qt')`, since otherwise you get an error about `qt doesn't have an initialize method`, and now you get `qt module doesn't exist`.
2024-01-25interpreter: replace mock keyword argument with unittest.mockDylan Baker
Python provides some nifty tools for mocking, without relying on altering running code. We should use these to simplify the actual run paths and move the complicated logic into tests.
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-03-01interpreter: Add testcase..endtestcase clause supportXavier Claessens
This is currently only enabled when running unit tests to facilitate writing failing unit tests. Fixes: #11394
2022-04-19docs: Add documentation on pkgconfig.relocatableFredrik Salomonsson
- Documentation for the pkgconfig.relocatable module option in Builtin-options. Gives an explanation on what it does, usefulness and what error that can occur when using it. - Add pkgconfig.relocatable release snippet. Similar to the documentation in Builtin-options. Just a bit more brief. - Add Pkgconfig to DataTests.test_builtin_options_documented in the docs unit tests.
2022-04-14unittests: make datatests capable of parsing module subsections properlyEli Schwartz
We will need to update the tests for each module that gets newly added, apparently, but the basic structure for doing so is hopefully there.
2022-01-10port from embedded data to importlib.resourcesEli Schwartz
2021-10-08python: Add platlibdir and purelibdir optionsXavier Claessens
2021-10-04various python neatness cleanupsEli Schwartz
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-08-15editorconfig: add setting to trim trailing whitespaceEli Schwartz
and clean up all outstanding issues Skip 'test cases/common/141 special characters/meson.build' since it intentionally uses trailing newlines.
2021-07-26Split run_unittests.py fileXavier Claessens