summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAgeFilesLines
* add message option to since_values and deprecated_valuesDylan Baker2021-12-061-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
* unittests/internal: use more subTestDylan Baker2021-12-061-13/+11
|
* Add deprecated_message and since_message to KwargInfoDylan Baker2021-12-061-6/+6
| | | | | | For passing an extra message to Feature* This allows providing a more detailed message.
* unittests/internal: use mock and subTestDylan Baker2021-12-061-7/+9
| | | | | This just makes things a little cleaner, and allows more accurate error reporting.
* interpreterbase/decorators: Fix types of deprecated_values and since_valuesDylan Baker2021-12-061-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.
* make sure files arguments to compiler.compiles and friends, performs rebuildEli Schwartz2021-11-281-0/+7
| | | | | | | | | | | If the compiler check is updated as a string in meson.build, we force rebuild, which is a good thing since the outcome of that check changes the configuration context and can enable or disable parts of the build. If the compiler check came from a files() object then we didn't add a regen rule on those files. Fixes #1656
* Merge pull request #9599 from dcbaker/submit/typed_kwargs-message-improvementsJussi Pakkanen2021-11-271-4/+4
|\ | | | | Improve error messages for typed_kwarg type mismatches in containers
| * unittests: cover cases here two of the same wrong type are providedDylan Baker2021-11-221-1/+1
| | | | | | | | | | We don't want to get something like "expected array[str], but got array[int | int]", we really want `arrayp[int]`.
| * typed_kwargs: use | for type unions, not ,Dylan Baker2021-11-221-2/+2
| | | | | | | | Python uses this syntax now, as does typescript and other languages
| * typed_kwargs: provide better error messages for wrong container typesDylan Baker2021-11-221-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.
* | tests: add a test for OptionKey.from_stringDylan Baker2021-11-251-0/+19
| |
* | shared_module: Add soname when used as a link targetNirbheek Chauhan2021-11-242-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Emit a detailed deprecation warning that explains what to do instead. Also add a unittest. ``` DEPRECATION: target prog links against shared module mymod, which is incorrect. This will be an error in the future, so please use shared_library() for mymod instead. If shared_module() was used for mymod because it has references to undefined symbols, use shared_libary() with `override_options: ['b_lundef=false']` instead. ``` Fixes https://github.com/mesonbuild/meson/issues/9492
* | unit tests: Extend prebuilt test to test intermediateDylan Baker2021-11-241-0/+23
| | | | | | | | | | This provides coverage for the bug: https://github.com/mesonbuild/meson/issues/9542
* | unittests: use UnitTest.addCleanup a bitDylan Baker2021-11-241-11/+14
| |
* | interpreter: extract_objects provides a valid sourcePaolo Bonzini2021-11-231-0/+6
|/ | | | | | | This ensures that there is no warnings when running meson on test cases/common/22 object extraction. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Feature kwargs decorator: automatically report the nodes which trigger an issueEli Schwartz2021-11-201-2/+2
|
* tests: replace python2 framework with metalDylan Baker2021-11-181-3/+3
| | | | | The bundled python is deprecated, metal is unlikely to be deprecated any time soon, so let's use that.
* python.dependency(): Do not stop when first candidate is not foundXavier Claessens2021-11-021-0/+4
| | | | | It has to lookup the dependency with required=False otherwise it raises an exception when the first candidate (pkg-config) failed.
* Fix cygwin test failure due to shortpath usageNirbheek Chauhan2021-10-312-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.
* Fix add_install_script() ignoring install_tagXavier Claessens2021-10-271-10/+12
| | | | Fixes: #9454
* test_clang_format: Do not assume meson source is in gitXavier Claessens2021-10-271-0/+8
| | | | Fixes: #9437
* unittests: use better assert methodsEli Schwartz2021-10-263-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.
* do not save unused variableEli Schwartz2021-10-261-1/+1
| | | | | Constructing a PackageDefinition is enough to assert that it raises an error.
* remove unused variableEli Schwartz2021-10-261-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...
* remove dead code that is immediately overriddenEli Schwartz2021-10-261-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.
* do not save variable when all we want is the side effect of popping itEli Schwartz2021-10-261-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.
* optinterpreter: Fix builtin option names not being reserved anymoreXavier Claessens2021-10-141-0/+34
|
* introspect: include choices for array optionsPaolo Bonzini2021-10-141-2/+5
| | | | There was even a test covering this, but it did not fail due to a typo.
* Fix typos discovered by codespellChristian Clauss2021-10-102-2/+2
|
* clangformat: Only format files tracked by git by defaultXavier Claessens2021-10-101-0/+14
|
* ar linker: generate thin archives for uninstalled static librariesEli Schwartz2021-10-101-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
* typed_kwargs: Fix when ContainerTypeInfo is used in a tupleXavier Claessens2021-10-091-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.
* python: Add platlibdir and purelibdir optionsXavier Claessens2021-10-081-3/+4
|
* cmake: handle arguments in the [binaries] section of the machine filePaolo Bonzini2021-10-081-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.
* various python neatness cleanupsEli Schwartz2021-10-043-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.
* rust: dependencies need to cause a rebuild/relink not just reorderDylan Baker2021-10-011-0/+32
| | | | Otherwise changes to a dependency don't propogate
* Make custom_target() name argument optionalXavier Claessens2021-09-301-0/+8
|
* pkgconfig: pkg-configs version<0.29.1 escape variables incorrectlymakise-homura2021-09-291-1/+2
|
* Merge pull request #9014 from bonzini/mixed-language-linkJussi Pakkanen2021-09-281-0/+14
|\ | | | | Use appropriate compiler for the source file for "links" tests with file argument
| * add test case for mixed language link testsPaolo Bonzini2021-09-071-0/+14
| |
* | fix test case instances where undefined message(true) occurredEli Schwartz2021-09-271-2/+2
| |
* | unittests: Make test_prelinking work on SolarisAlan Coopersmith2021-09-251-3/+6
| | | | | | | | | | Running 'cc --version' finds the Solaris Studio C compiler, not gcc, and it doesn't support --version.
* | compilers/rust: Add support for clippyDylan Baker2021-09-242-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
* | coredata: 0.59.1 -> 0.59.99 is a major version differenceXavier Claessens2021-09-212-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
* | Add platform agnostic testsXavier Claessens2021-09-211-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.
* | Fix ignored install_tag kwarg in install_subdir()Xavier Claessens2021-09-161-0/+2
| | | | | | | | Fixes: #9263
* | backends/vs: Do not emit dummy command for alias_command().Andres Freund2021-09-141-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
* | unittests: test external dependency in summaryPaolo Bonzini2021-09-071-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>
* mintro: add installed_planFilipe Laíns2021-09-061-3/+179
| | | | Signed-off-by: Filipe Laíns <lains@riseup.net>
* tests: when generating git repositories, make sure that pgpsign is offEli Schwartz2021-09-032-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".