aboutsummaryrefslogtreecommitdiff
path: root/unittests
AgeCommit message (Collapse)AuthorFilesLines
2021-11-02python.dependency(): Do not stop when first candidate is not foundXavier Claessens1-0/+4
It has to lookup the dependency with required=False otherwise it raises an exception when the first candidate (pkg-config) failed.
2021-10-31Fix cygwin test failure due to shortpath usageNirbheek Chauhan2-8/+21
Two tests are failing on Cygwin because the argument is passed as a long-path and the Path is ending up as a short-path: AllPlatformTests.test_run_target_files_path Traceback (most recent call last): File "/cygdrive/d/a/meson/meson/test cases/common/51 run target/check-env.py", line 22, in <module> assert build_root == env_build_root AssertionError SubprojectsCommandTests.test_purge > self.assertEqual(deleting(out), sorted([ str(self.subprojects_dir / 'redirect.wrap'), str(self.subprojects_dir / 'sub_file'), str(self.subprojects_dir / 'sub_git'), ])) E AssertionError: Lists differ: ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49[205 chars]git'] != ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/s[196 chars]git'] [...] ['/cygdrive/c/Users/runneradmin/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^^^^ ['/cygdrive/c/Users/RUNNER~1/AppData/Local/Temp/tmpeaa2a49z/src/subprojects/redirect.wrap', ^^^^^^^^ The fix is to not use the tempdir for all tests, but only for tests that check the mode.
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens1-10/+12
Fixes: #9454
2021-10-27test_clang_format: Do not assume meson source is in gitXavier Claessens1-0/+8
Fixes: #9437
2021-10-26unittests: use better assert methodsEli Schwartz3-25/+25
assertTrue and assertFalse are recommended against, if you can get a more specific assertion. And sometimes it is considerably shorter, for example we have a custom assertPathExists which we can take advantage of.
2021-10-26do not save unused variableEli Schwartz1-1/+1
Constructing a PackageDefinition is enough to assert that it raises an error.
2021-10-26remove unused variableEli Schwartz1-1/+1
It never made sense here to save self.init() which returns a string containing a log or stdout or something, and which was never actually used. Also we then overwrote the variable with a pathname...
2021-10-26remove dead code that is immediately overriddenEli Schwartz1-4/+0
In commit d932cd9fb48e8fecb167641c3d6bee8a68831c6e, we migrated to meson's own static linker definition, and the old code that hardcoded two of the possible exelists should have been removed in the process.
2021-10-26do not save variable when all we want is the side effect of popping itEli Schwartz1-1/+1
It's redefined on every loop iteration, and as the comment says, we just want to make sure the next loop skips a value.
2021-10-14optinterpreter: Fix builtin option names not being reserved anymoreXavier Claessens1-0/+34
2021-10-14introspect: include choices for array optionsPaolo Bonzini1-2/+5
There was even a test covering this, but it did not fail due to a typo.
2021-10-10Fix typos discovered by codespellChristian Clauss2-2/+2
2021-10-10clangformat: Only format files tracked by git by defaultXavier Claessens1-0/+14
2021-10-10ar linker: generate thin archives for uninstalled static librariesEli Schwartz1-1/+1
Since they will never be used outside of the build directory, they do not need to literally contain the .o files, and references will be sufficient. This covers a major use of object libraries, which is that the static library would potentially take up a lot of space by including another copy of every .o file. Fixes #9292 Fixes #8057 Fixes #2129
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-08python: Add platlibdir and purelibdir optionsXavier Claessens1-3/+4
2021-10-08cmake: handle arguments in the [binaries] section of the machine filePaolo Bonzini1-0/+32
Sometimes, the machine file can include compiler command line options, in order to pick the correct multilib. For example, Meson uses "$cc --print-search-dirs" to find the library search path, where $cc is the cc from the machine file. Because the outputs of "gcc -m32 --print-search-dirs" and "gcc --print-search-dirs" are different, this only works if you have [binaries] cc = ['gcc', '-m32'] in the machine file. Right now, however, the cmake module assumes that the compiler listed in the machine file is either a compiler, or a "launcher" followed by the compiler. Check if the second argument starts with a slash (for Microsoft-like compilers) or a dash (for everyone else), and if so presume that the CMAKE_*_COMPILER_LAUNCHER need not be defined.
2021-10-04various python neatness cleanupsEli Schwartz3-6/+6
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-10-01rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker1-0/+32
Otherwise changes to a dependency don't propogate
2021-09-30Make custom_target() name argument optionalXavier Claessens1-0/+8
2021-09-29pkgconfig: pkg-configs version<0.29.1 escape variables incorrectlymakise-homura1-1/+2
2021-09-28Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen1-0/+14
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-27fix test case instances where undefined message(true) occurredEli Schwartz1-2/+2
2021-09-25unittests: Make test_prelinking work on SolarisAlan Coopersmith1-3/+6
Running 'cc --version' finds the Solaris Studio C compiler, not gcc, and it doesn't support --version.
2021-09-24compilers/rust: Add support for clippyDylan Baker2-2/+16
Clippy is a compiler wrapper for rust that provides an extra layer of linting. It's quite popular, but unfortunately doesn't provide the output of the compiler that it's wrapping in it's output, so we don't detect that clippy is rustc. This small patch adds a new compiler class (that is the Rustc class with a different id) and the necessary logic to detect that clippy is in fact rustc) Fixes: #8767
2021-09-21coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens2-26/+18
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-09-21Add platform agnostic testsXavier Claessens1-0/+34
This adds a new category of tests that does not need to run on all platforms during CI. For now only run them on Linux runners because they are not the bottleneck.
2021-09-16Fix ignored install_tag kwarg in install_subdir()Xavier Claessens1-0/+2
Fixes: #9263
2021-09-14backends/vs: Do not emit dummy command for alias_command().Andres Freund1-3/+0
Alias commands did not work with the vs backend, due to trying to access target.command[0] with an empty command. Fix this by just not emitting a CustomBuild node for alias targets - the project references are enough to trigger the necessary actions. Fixes: #9247
2021-09-07unittests: test external dependency in summaryPaolo Bonzini1-3/+8
This requires a bit of extra code because the version might change, but otherwise it fits in the existing AllPlatformTests.test_summary testcase Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-07add test case for mixed language link testsPaolo Bonzini1-0/+14
2021-09-06mintro: add installed_planFilipe Laíns1-3/+179
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-03tests: when generating git repositories, make sure that pgpsign is offEli Schwartz2-6/+6
I have a local configuration tag.forcesignannotated=true commit.gpgsign=true This causes the tests to fail with e.g. error: gpg failed to sign the data fatal: failed to write commit object Since this is a unittest, it is never wrong to tell git "just ignore prior configuration, and disable all PGP signing".
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens1-1/+7
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
2021-09-01run_target: do not yield broken names with subdirsEli Schwartz1-0/+2
A run_target object created in a subdir/meson.build always has a ninja rule name of "name", not "subdir/name". Fixes #9175
2021-09-01msvc: Assume UTF8 source by defaultXavier Claessens1-0/+13
Currently every project that uses UTF8 for its source files must add '/utf-8' argument otherwise they don't work non-English locale MSVC. Since meson.build itself is assumed to be UTF8 by default, seems better to assume it for source files by default too. For example: - https://gitlab.freedesktop.org/gstreamer/gst-build/-/blob/master/meson.build#L62 - https://gitlab.gnome.org/GNOME/glib/-/blob/main/meson.build#L29
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-31pylint: turn on superflous-parensDylan Baker1-1/+1
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-31Merge pull request #9193 from dcbaker/submit/aarch64-beJussi Pakkanen1-0/+95
Handle aarch64_be as a cpu family
2021-08-30decorators: Make unknown kwarg fatalXavier Claessens1-3/+3
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-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens1-0/+5
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-20unittests: Ensure that symlink is removed after tests completeDylan Baker1-3/+7
using `TestCase.addCleanup` is both neat and tidy, and also ensures that the cleanup will be done, even if the test fails.
2021-08-17Add install tagsXavier Claessens1-9/+116
Fixes: #7007.