aboutsummaryrefslogtreecommitdiff
path: root/unittests/internaltests.py
AgeCommit message (Collapse)AuthorFilesLines
2023-03-16prevent lib prefix warning from pkg-configCharles Brunet1-1/+1
2023-03-04typed_kwargs: Extend since_values and deprecated_values for typesXavier Claessens1-2/+40
2023-02-08internaltests: Fix tests for /utf-8 removalDylan Baker1-5/+6
Now that we don't insert /utf-8 into the always args for MSVC < 19.00 we need to use a version > 19.00 for testing. This also means that /Zc:__cplusplus will be added to the always args.
2023-02-01remove /utf-8 option when /validate-charset- is presentCharles Brunet1-0/+22
2022-10-25Compilers: Keep ccache and exelist separatedXavier Claessens1-4/+4
Only combine them in the Compiler base class, this will make easier to run compiler without ccache.
2022-09-28Move classes used by scripts to their own moduleXavier Claessens1-1/+1
Those classes are used by wrapper scripts and we should not have to import the rest of mesonlib, build.py, and all their dependencies for that. This renames mesonlib/ directory to utils/ and add a mesonlib.py module that imports everything from utils/ to not have to change `import mesonlib` everywhere. It allows to import utils.core without importing the rest of mesonlib.
2022-09-19compilers: don't export every compiler as a top-level propertyEli Schwartz1-6/+7
This is wasteful and generally unneeded, since code can just use the compiler they detected instead of manually poking at the internals of this subpackage. It also avoids importing an absolute ton of code the instant one runs `from . import compilers`
2022-08-18unittests: Add additional tests for KwargInfo::since valuesDylan Baker1-0/+16
The first test is checking the added support for keys as either `dict` or `list`. The second checks that a default value which would otherwise trigger a value_since check doesn't, and that passing the default value explicitly does.
2022-05-19Reword message in warningZbigniew Jędrzejewski-Szmek1-9/+9
"targetting" is verb-derived adjective, which sort-of-works here, but makes the whole sentence awkward, because there's no verb. Let's just use present simple.
2021-12-06add message option to since_values and deprecated_valuesDylan Baker1-1/+9
This allows these two arguments to take a tuple of (version, message), where the message will be passed to Feature*'s message parameter
2021-12-06unittests/internal: use more subTestDylan Baker1-13/+11
2021-12-06Add deprecated_message and since_message to KwargInfoDylan Baker1-6/+6
For passing an extra message to Feature* This allows providing a more detailed message.
2021-12-06unittests/internal: use mock and subTestDylan Baker1-7/+9
This just makes things a little cleaner, and allows more accurate error reporting.
2021-12-06interpreterbase/decorators: Fix types of deprecated_values and since_valuesDylan Baker1-0/+5
Which shouldn't be Dict[str, str], they should be Dict[_T, str], as nay value that can be passed to types is valid here.
2021-11-27Merge pull request #9599 from dcbaker/submit/typed_kwargs-message-improvementsJussi Pakkanen1-4/+4
Improve error messages for typed_kwarg type mismatches in containers
2021-11-25tests: add a test for OptionKey.from_stringDylan Baker1-0/+19
2021-11-22unittests: cover cases here two of the same wrong type are providedDylan Baker1-1/+1
We don't want to get something like "expected array[str], but got array[int | int]", we really want `arrayp[int]`.
2021-11-22typed_kwargs: use | for type unions, not ,Dylan Baker1-2/+2
Python uses this syntax now, as does typescript and other languages
2021-11-22typed_kwargs: provide better error messages for wrong container typesDylan Baker1-3/+3
Currently, if you pass a `[]string`, but the argument expects `[]number`, then you get a message like `expected list[str] but got list`. That isn't helpful. With this patch arrays and dictionaries will both print messages with the types provided.
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-09typed_kwargs: Fix when ContainerTypeInfo is used in a tupleXavier Claessens1-4/+37
info.types could be a tuple like (str, ContainerTypeInfo()). That means we have to check types one by one and only print error if none of them matched. Also fix the case when default value is None for a container type, it should leave the value to None to be able to distinguish between unset and empty list.
2021-10-04various python neatness cleanupsEli Schwartz1-2/+2
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-09-21coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens1-1/+15
Remove test_minor_version_does_not_reconfigure_wipe() because when run during dev cycle that test reconfigure with .99 -> .100 which is considered a major version change now. It is covered by a more efficient internal test now anyway. While at it, remove no-op `with Path(self.builddir):` statement, the intention was clearly to set workdir. Fixes: #9260
2021-08-31interpreter: use python dunders instead of lock for unpicklabilityDylan Baker1-1/+1
This simplifies things for us, as we don't have to have threading imported for no other reason, and we can remove the `an_unpicklable_object` from the Interpreter and mesonlib, since there was only one user of this.
2021-08-31unittests: add a test to Interpreter is unpicklableDylan Baker1-7/+17
We want this, so let's test it.
2021-08-30environment: correctly handle cpu value aarch64_beDylan Baker1-0/+4
Fixes #9191
2021-08-30environment: add ppc -> ppc64 for aix to detect_cpuDylan Baker1-1/+1
This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
2021-08-30unittests: add tests for detect_cpuDylan Baker1-0/+35
Same thing, but for the more specific cases
2021-08-30unittests: Add a test case for detect_cpu_familyDylan Baker1-0/+56
This should help prevent regressions.
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker1-7/+8
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
2021-08-27interpreter: Add a helper for checking constrained inputsDylan Baker1-1/+2
This is quite valuable for enum-like inputs, where only a certain set of values is allowed.
2021-07-30interenaltests: Add some version strings with ansi escapes in themDylan Baker1-0/+11
AS we've run into a few programs using ansi escapes in their version outputs, we'd like to test them as well.
2021-07-26Split run_unittests.py fileXavier Claessens1-0/+1411