summaryrefslogtreecommitdiff
path: root/test cases/unit
AgeCommit message (Collapse)Author
2021-02-26Allow printing UserOptions in the summaryStephen Gregoratto
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens
By default all subprojects are installed. If --skip-subprojects is given with no value only the main project is installed. If --skip-subprojects is given with a value, it should be a coma separated list of subprojects to skip and all others will be installed. Fixes: #2550.
2021-02-17Environment: Fix passing envrionment variables CPPFLAGS and CFLAGSDylan Baker
Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem here is actually rather simple, `dict.setdefault()` doesn't work like I thought it did, I thought it created a weak entry, but it actually is equivalent to: ```python if k not in dict: dict[k] = v ``` Instead we'll use an intermediate dictionary (a default dictionary actually, since that makes things a little cleaner) and then add the keys from that dict to self.options as applicable. Test case written by Jussi, Fix by Dylan Co-authored-by: Jussi Pakkanen Fixes: #8361 Fixes: #8345
2021-02-09Condense test directory names in preparation for rc1.Jussi Pakkanen
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini
This new keyword argument makes it possible to run specific test setups only on a subset of the tests. For example, to mark some tests as slow and avoid running them by default: add_test_setup('quick', exclude_suites: ['slow'], is_default: true) add_test_setup('slow') It will then be possible to run the slow tests with either `meson test --setup slow` or `meson test --suite slow`.
2021-01-21interpreter: accept external programs and dependencies for summaryPaolo Bonzini
2021-01-20ninjabackend: Correct RPATH orderFini Jastrow
[why] If we build and test a library we need to make sure that we find the currently build library object first, before an older system installed one. This can be broken if the library in question is installed in a custom path, and another library we depend on also is installed there. [how] Just move the rpath to the current build artifacts to the front. Solves #8030. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-04unit:cpp17: make C++17 test stricter checkMichael Hirsch
many compilers allowed "nodiscard" C++17 feature with pre-c++17 flags. The C++17 filesystem typically actually does require -std=c++17. This makes this unit test more representative of C++17 flag support.
2020-12-14Merge pull request #8013 from mesonbuild/cppmodulesJussi Pakkanen
C++ module support
2020-12-13Support native tests in crossbuildOleg B
2020-12-11Create unit test for C++ modules and accept ixx as C++ source extension.Jussi Pakkanen
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen
2020-11-13Use c99 instead of c11 for buildoptions testjpark37
Older verisons of MSVC do not support C11 properly.
2020-11-03Condense test directory names again.Jussi Pakkanen
2020-11-01interpreter: store correct files for project regenerationDylan Baker
Right now sub-sub projects are not correctly registered, because we don't have a way to pass up past the first level of subproject. This patch changes that by making the build_Def_files as defined in the Interpreter initializer accurate for translated dependencies, ie, cmake dependencies won't define a dependency on a non-existent meson.build. This means that it can always add the subi.build_def_files because they are always accurate.
2020-10-15intro: Add extra_files key to intro output (fixes #7310)Daniel Mensinger
2020-10-07Tests: py.dependency() now has required:true by defaultXavier Claessens
It used to ignore the required argument and got fixed to be consistent with dependency() function.
2020-10-05options: Handle updates to choices in optionsDylan Baker
Currently if you change the `choices` field in the meson_options.txt file, no update will be done until `meson setup --wipe` is called. Now if the choices change then the options will be properly merged. If the currently select value is still valid it is guaranteed to be kept, if it is now invalid the new default value will be used and a warning will be printed. Fixes #7386
2020-10-05Never run clang-format / clang-tidy against directoriesBernd Busse
`pathlib.Path.glob()` also returns directories that match source filenames (i.e. a directory named `test.h/`), but `clang-format` and `clang-tidy` fail when handed a directory. We manually skip calling `clang-format` and `clang-tidy` on those directories.
2020-09-14InternalDependency: Add as_link_whole() methodXavier Claessens
2020-09-09Merge pull request #7428 from jon-turney/introspector-add-languagesJussi Pakkanen
Handle add_languages(native:) in introspector
2020-09-09Add a test of add_languages(native:) introspectionJon Turney
If the meson.build doesn't use a native compiler, the native compiler options (e.g. 'c_args') shouldn't be present in the output of 'meson introspect --buildoptions'.
2020-09-08IntrospectInterpreter: allow dictionaries with nonconstant keysPaolo Bonzini
Something like {a: foo} currently stymies the IntrospectionInterpreter and breaks introspection of the source directory. The fix is just to walk the keys and return a dummy dictionary. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-04introspect: add test dependencies info to test/benchmark JSONPaolo Bonzini
Add the ids of any target that needs to be rebuilt before running the tests as computed by the backend, to the introspection data for tests and benchmarks. This also includes anything that appears on the test's command line. Without this information, IDEs must update the entire build before running any test. They can now instead selectively build the test executable itself and anything that is needed to run it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-02Special case meson.version().version_compare() statementXavier Claessens
when that statement gets evaluated, the interpreter remembers the version target and if it was part of the evaluation of a `if` condition then the target meson version is temporally overriden within that if-block. Fixes: #7590
2020-08-27tests: update .gitignoreDaniel Mensinger
2020-08-18Interpreter: Fix c_stdlib usageXavier Claessens
- Exceptions raised during subproject setup were ignored. - Allow c_stdlib in native file, was already half supported. - Eliminate usage of subproject variable name by overriding '<lang>_stdlib' dependency name.
2020-08-01run dircondensor.pyDylan Baker
2020-07-30Allow setting project options from cross or native filesDylan Baker
This allows adding a `[project options]` section to a cross or native file that contains the options defined for a project in it's meson_option.txt file.
2020-07-21summary: Wrap lines when printing listsXavier Claessens
When a list_sep is provided (e.g. ', ') all items are printed on the same line, which gets ugly on very long lists (e.g. list of plugins enabled).
2020-07-01wrap: Add 'provide' sectionXavier Claessens
2020-06-30wrap: Apply patch even in VCS casesXavier Claessens
2020-06-22unittests: Fix test_identity_cross on SolarisAlan Coopersmith
Since mesonbuild/environment.py doesn't recognize Studio compilers, force use of gcc on Solaris for now. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-05-23ast: add unittestDaniel Mensinger
2020-05-18pass exe_wrapper to test scripts through the environmentDylan Baker
This adds a new MESON_EXE_WRAPPER environment variable containing the string form of the exe_wrapper, if there is an exe_wrapper defined. Fixes #4427
2020-05-18backends: Consider arguments passed to a test when cross compilingDylan Baker
Otherwise a wrapper script which takes an executable as an argument will mistakenly run when that executable is cross compiled. This does not wrap said executable in an exe_wrapper, just skip it. Fixes #5982
2020-05-18backends: ensure that test executables can be run when passed as argumentsDylan Baker
If an executable is passed as an argument to a script in the build directory that it resides in then it will not execute (on *nix) due to a lack of ./. Ie, `foo` must be called as `./foo`. If it is called from a different directory it will work. Ie `../foo` or `bar/foo`. Fixes #5984
2020-05-18Merge pull request #7103 from dankegel/bug4027-rpath-rememberJussi Pakkanen
Let .pc files and LDFLAGS provide rpaths.
2020-05-16Let LDFLAGS specify rpath.Dan Kegel
Fixes #2567
2020-05-16Let .pc files specify rpath.Dan Kegel
Fixes #4027
2020-05-14interpreter: Rename has_exe_wrapper -> can_run_host_binariesDylan Baker
The implementation of this function has changed enough that the name doesn't really reflect what it actually does. It basically returns true unless you're cross compiling, need and exe_wrapper, and don't have one. The original function remains but is marked as deprecated. This makes one small change the meson source language, which is that it defines that can_run_host_binaries will return true in build == host compilation, which was the behavior that already existed. Previously this was undefined in build == host compilation.
2020-05-04Add regression test for libdir reset.Jussi Pakkanen
2020-04-30allow postconf and dist scripts to use Files, ExternalPrograms, andDylan Baker
ConfigureFiles These things are all known to be ready when these scripts are run, and thus they can safely consume them.
2020-04-17interpreter: Correctly ignore def files in build directoryXavier Claessens
See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/85.
2020-03-06ast: Implement dummy evaluate_notstatementDaniel Mensinger
2020-02-26summary: Add list_sep keyword argumentXavier Claessens
This allows having lists on a single line instead of having each value aligned on a new line.
2020-02-01summary: Fix empty list caseXavier Claessens
Fixes: #6557.
2020-01-21Use python3 in some tests which were still using pythonSebastien Bacher
The unversioned command is deprecated and removed from some distributions
2020-01-17wrap: Fix support of file:// URLsXavier Claessens
Fixes: #6445
2020-01-08Rename test dirs to sequential order.Jussi Pakkanen