summaryrefslogtreecommitdiff
path: root/test cases/unit
AgeCommit message (Collapse)Author
2019-03-11Add unit test for pkgconfig relative pathsIgnacio Casal Quinteiro
2019-03-10Condense directory numbering for release.Jussi Pakkanen
2019-03-03Added test casesDaniel Mensinger
2019-02-26mconf: Fixed crash for variables in targets (closes #4960)Daniel Mensinger
2019-02-11allow paths to be set in the cross fileDylan Baker
Just like the previous patch, but for cross files Fixes #1433
2019-02-11allow setting directory locations in a native fileDylan Baker
This allows the person running configure (either a developer, user, or distro maintainer) to keep a configuration of where various kinds of files should end up.
2019-01-17tests: Don't return an undefined value from main()Simon McVittie
This caused test failures while backporting meson to an old runtime environment. Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-16mintro: Introspection interpreter refactoring (#4733)Daniel Mensinger
* Fixed spelling * Merged the Buildoptions and Projectinfo interpreter * Moved detect_compilers to Environment * Added removed test case * Split detect_compilers and moved even more code into Environment * Moved set_default_options to coredata * Small code simplification in mintro.run * Move cmd_line_options back to `environment` We don't actually wish to persist something this unstructured, so we shouldn't make it a field on `coredata`. It would also be data denormalization since the information we already store in coredata depends on the CLI args.
2019-01-16Renamed unit test directoriesDaniel Mensinger
2019-01-16do_subproject: Improve log messages and formattingXavier Claessens
2019-01-06Documentation and unit test updateDaniel Mensinger
2019-01-06Update intro dump on meson configureDaniel Mensinger
2019-01-06Added unit testDaniel Mensinger
2018-12-29Tests and docsDaniel Mensinger
2018-12-30Add a clang-format target.Jussi Pakkanen
2018-12-12pkgconfig: Fix link order of library dependenciesNiklas Haas
Since `_process_libs` appends the lib's dependencies this list already, the final return value of `_process_libs` will end up after its dependencies, which is the wrong way around. (The lib must come first, then its dependencies) The easiest solution is to simply pre-pend the return value of `_process_libs` rather than appending it, so that its dependencies come after the library itself. Closes #4091.
2018-12-06Deduplicate export-dynamic and pthread. Closes #4567.Jussi Pakkanen
2018-11-21pkgconfig: add support for pkgconfig generation for c#Marcel Hollerbach
this adds support for generating pkgconfig files for c#. The difference to c and cpp is that the -I flag is not known to the c# compiler, but rather the -r flag which is used to link a .dll file into the compiled library. However this opens the question of validating which pkgconfig files can be generated (depending on the language). This implements 4409.
2018-11-14modules/python: Allow use of the native fileDylan Baker
Currently this just allows setting a "python" variable that always overrides, probably we want to have the option for "python2" and "python3" as well.
2018-11-14modules/python3: allow specifying in the native fileDylan Baker
2018-11-14dependencies: Allow config tool dependencies to use native filesDylan Baker
This allows tools like llvm-config to be selected from the config file Fixes: #3327
2018-11-14interpreter: allow find_program to use the native fileDylan Baker
2018-11-14unittests: Add framework for testing native config filesDylan Baker
2018-11-12Add kwarg is_default to add_test_setup()Stian Selnes
is_default may be used to set the name of the test setup that will be used by default whenever the option --setup is not given. Fixes #4430
2018-11-06Add reconfigure/wipe unit testXavier Claessens
2018-11-06Don't use host pkg-config for native dependenciesLyude Paul
When trying to cross-compile mesa on an aarch64 system, I noticed some strange behavior. Meson would only ever find the wayland-scanner binary in my host machine's sysroot (/mnt/amethyst): Native dependency wayland-scanner found: YES 1.16.0 Program /mnt/amethyst/usr/bin/wayland-scanner found: YES (/mnt/amethyst/usr/bin/wayland-scanner) It should be finding /usr/bin/wayland-scanner instead, since the wayland-scanner dependency is created as native. On closer inspection, it turned out that meson was ignoring the native argument passed to dependency(), and wuld always use the pkgconfig binary specified in my toolchain instead of the native one (/usr/bin/pkg-config): Native dependency wayland-scanner found: YES 1.16.0 Called `/home/lyudess/Projects/panfrost/scripts/amethyst-pkg-config --variable=wayland_scanner wayland-scanner` -> 0 Turns out that if we create a dependency() object with native:false, we end up caching the pkg-config path for the host machine in PkgConfigDependency.class_pkgbin, instead of the build machine's pkg-config path. This results causing in all pkg-config invocations for dependency() objects to use the host machine's pkg-config binary, regardless of whether or not 'native: true' was specified when the dependency() object was instantiated. So, fix this by never setting PkgConfigDependency.class_pkgbin for cross dependency() objects. Also, add some test cases for this. Since triggering this bug can be avoided by creating a dependency() objects with native:true before creating any with native:false, we make sure that our test has two modes: one where it starts with a native dependency first, and another where it starts with a cross dependency first. As a final note here: We currently skip this test on windows, because windows doesn't support directly executing python scripts as executables: something that we need in order to point pkgconfig to a wrapper script that sets the PKG_CONFIG_LIBDIR env appropriately before calling pkg-config. Signed-off-by: Lyude Paul <thatslyude@gmail.com>
2018-10-24Move VS C++17 test to a unit test since it requires env setup.Jussi Pakkanen
2018-10-04Make custom dist scripts accept arguments.Jan Tojnar
meson.add_dist_script, introduced in #3906, did not accept any arguments other than script name. Since all other meson.add_*_script methods do accept args, this makes the dist script accept them as well.
2018-09-16Fix ICC on macOSDavid Seifert
2018-09-16find_installation: Add support for feature option in required kwargXavier Claessens
Closes: #4165.
2018-09-13Merge pull request #4017 from jon-turney/version-comparison-rewriteJussi Pakkanen
Use rpmvercmp version comparison
2018-09-13Fix flake8 'imported but unused' reportsJon Turney
$ flake8 | grep F401 ./mesonbuild/compilers/d.py:19:1: F401 '.compilers.GCC_CYGWIN' imported but unused ./test cases/unit/35 dist script/replacer.py:3:1: F401 'sys' imported but unused
2018-09-12Correct version_compare_condition_with_min()Jon Turney
Correct version_compare_condition_with_min() for the case where no minimum version is established by the version constraint. Add a simple test. Also fix test_feature_check_usage_subprojects by escaping regex metacharacters. if |condition| is '<', '<=' or '!=', the minimum version satisfying the condition is 0, so the minimum version for a feature is never met. if |condition| is '>=' or '==', the minimum version satisfying the condition is the version compared with, so the minimum version for a feature must be less than or equal to that. if |condition| is '>', the minimum version satisfying the condition is greater than the version compared with, so the minimum version for a feature must be less than that (it's this last condition that makes this function necessary, as in all other cases we could establish a definite minimum version which we could compare to see if it's less than or equal to the current version)
2018-09-06Condense test dirs.Jussi Pakkanen
2018-08-27Add support for custom dist scripts.Jussi Pakkanen
2018-08-22Test that system shlibs with undefined symbols can be foundNirbheek Chauhan
2018-08-19Condense test dirs.Jussi Pakkanen
2018-08-17wraptool: fix manual selection of wrap file to promoteDaniel Pirch
Fixed manually promoting wrap files with a full path, e.g. `meson wrap promote subprojects/s1/subprojects/projname.wrap`, which resulted in an error before (new test added: `./run_unittests.py AllPlatformTests.test_subproject_promotion_wrap`). Additionally, running promote with an invalid subproject path now fails properly. Before, it just silently did nothing (added to test: `./run_unittests.py AllPlatformTests.test_subproject_promotion`).
2018-08-15Kill tabs dead! For good!Jussi Pakkanen
2018-08-04Merge pull request #3945 from mesonbuild/dircondenserJussi Pakkanen
Condense directory names with script.
2018-07-31Merge pull request #3850 from mesonbuild/nirbheek/exe-wrapper-compiler-fallbacksJussi Pakkanen
Be more permissive about not-found exe_wrapper
2018-07-31Condense test dirs.Jussi Pakkanen
2018-07-27Move test from common to unit.Rafael Ávila de Espíndola
When I initially added the test the intention was to use it from run_unittests.py only, but I placed it in the wrong directory.
2018-07-25Make the rpath order deterministic. (#3932)Rafael Ávila de Espíndola
2018-07-09cross: Be more permissive about not-found exe_wrapperNirbheek Chauhan
We used to immediately try to use whatever exe_wrapper was defined in the cross file, but some people generate the cross file once and use it for several projects, most of which do not even need an exe wrapper to build. Now we're a bit more resilient. We quietly fall back to using non-exe-wrapper paths for compiler checks and skip the sanity check. However, if some code needs the exe wrapper, f.ex., if you run a built executable using custom_target() or run_target(), we will error out during setup. Tests will, of course, continue to error out when you run them if the exe wrapper was not found. We don't want people's tests to silently "pass" (aka skip) because of a bad CI setup. Closes https://github.com/mesonbuild/meson/issues/3562 This commit also adds a test for the behaviour of exe_wrapper in these cases, and refactors the unit tests a bit for it.
2018-07-02FeatureNew: Make all checks subproject-specificNirbheek Chauhan
We now pass the current subproject to every FeatureNew and FeatureDeprecated call. This requires a bunch of rework to: 1. Ensure that we have access to the subproject in the list of arguments when used as a decorator (see _get_callee_args). 2. Pass the subproject to .use() when it's called manually. 3. We also can't do feature checks for new features in meson_options.txt because that's parsed before we know the meson_version from project()
2018-07-01Allow command lists for find_program cross file overridesNirbheek Chauhan
This is accepted by all other binaries in the cross file. With this change, we also don't check whether the specified command exists at configure time, but that's probably a feature anyway. Fixes https://github.com/mesonbuild/meson/issues/3737
2018-07-01Nirbheek/fix pkgconfig library dedup (#3813)Nirbheek Chauhan
* Add a test case for bad de-dup of -framework args https://github.com/mesonbuild/meson/issues/3800 * pkgconfig: Don't naively de-dup all arguments Honestly don't know what I was smoking. Of course the `Libs:` field in a pkg-config file can have arguments other than -l and -L Closes https://github.com/mesonbuild/meson/issues/3800 * pkgconfig module: Fix needlessly aggressive de-dup
2018-06-18macos: Rewrite install_name for dependent built libraries on installNirbheek Chauhan
On macOS, we set the install_name for built libraries to @rpath/libfoo.dylib, and when linking to the library, we set the RPATH to its path in the build directory. This allows all built binaries to be run as-is from the build directory (uninstalled). However, on install, we have to strip all the RPATHs because they point to the build directory, and we change the install_name of all built libraries to the absolute path to the library. This causes the install name in binaries to be out of date. We now change that install name to point to the absolute path to each built library after installation. Fixes https://github.com/mesonbuild/meson/issues/3038 Fixes https://github.com/mesonbuild/meson/issues/3077 With this, the default workflow on macOS matches what everyone seems to do, including Autotools and CMake. The next step is providing a way for build files to override the install_name that is used after installation for use with, f.ex., private libraries when combined with the install_rpath: kwarg on targets.
2018-06-18Test that binaries that use external libraries workNirbheek Chauhan
When we link to an external library either with find_library() without any dirs:, or with dependency(), we should be able to run uninstalled out of the box without having to set any environment variables or other shenanigans. This is especially important on macOS because only the system frameworks directory is in the default runtime path, and all other frameworks and libraries need to be found with RPATH or absolute path to the dylib.