aboutsummaryrefslogtreecommitdiff
path: root/test cases/unit
AgeCommit message (Collapse)AuthorFilesLines
2021-04-26Condense test directory names.Jussi Pakkanen153-0/+0
2021-04-26introspection: export all sources for custom targetsJason Francis1-3/+8
Also adds some test cases for source files in target_sources.
2021-04-26store the list of initializes subprojects in the coredata structureDylan Baker2-0/+5
We need to konw on rconfigure which options have already bee set not just for the super project, but also for the subproject. However, using first_invocation is not sufficient, as a reconfigure could add a new subpproject that wasn't present before, and we need to initialize that project's builtins.
2021-04-26Interpreter: Fallback when required is false but forcefallback is trueXavier Claessens2-0/+11
2021-03-29Do not add custom target dir automatically when implicit false.Jussi Pakkanen6-0/+43
2021-03-23environment(): Allow stacking append() and prepend() (#8547)Xavier Claessens2-21/+0
* environment(): Allow stacking append() and prepend() * Update docs/markdown/Reference-manual.md Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
2021-03-18Allow add_dist_script() in subprojectsXavier Claessens5-0/+27
Fixes: #8440.
2021-03-16clangformat: Add include and ignore filesXavier Claessens7-0/+17
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens5-0/+50
2021-03-04use python2-compatible syntax because needed on macOSEli Schwartz1-2/+2
Apparently this unittest runs on macOS using the system python2.
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz1-1/+1
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz2-2/+0
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-02-26interpreter: correctly track whether a subproject is initializedDylan Baker4-0/+23
The way the tracking is currently done it works if no new subprojects are added to a configured build directory. For cases where we want to add a new subproject, it fails because we don't initialize builtins for that subproject. This corrects that by checking to see if the subproject already exists, and if it doesn't initializes the bultins for it. Fixes: #8421
2021-02-26Allow printing UserOptions in the summaryStephen Gregoratto2-0/+2
2021-02-22minstall: Add --skip-subprojects optionXavier Claessens10-0/+27
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 Baker3-0/+40
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 Pakkanen16-0/+0
2021-02-02interpreter, mtest: introduce add_test_setup(exclude_suites: ...)Paolo Bonzini1-1/+2
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 Bonzini1-0/+5
2021-01-20ninjabackend: Correct RPATH orderFini Jastrow6-0/+44
[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 Hirsch1-5/+27
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 Pakkanen12-0/+92
C++ module support
2020-12-13Support native tests in crossbuildOleg B2-0/+23
2020-12-11Create unit test for C++ modules and accept ixx as C++ source extension.Jussi Pakkanen12-0/+92
2020-12-03Add prelinking support for static libraries.Jussi Pakkanen8-0/+73
2020-11-13Use c99 instead of c11 for buildoptions testjpark371-1/+1
Older verisons of MSVC do not support C11 properly.
2020-11-03Condense test directory names again.Jussi Pakkanen33-0/+0
2020-11-01interpreter: store correct files for project regenerationDylan Baker4-0/+14
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 Mensinger3-3/+12
2020-10-07Tests: py.dependency() now has required:true by defaultXavier Claessens1-1/+1
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 Baker3-0/+27
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 Busse2-0/+2
`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 Claessens3-0/+23
2020-09-09Merge pull request #7428 from jon-turney/introspector-add-languagesJussi Pakkanen1-0/+2
Handle add_languages(native:) in introspector
2020-09-09Add a test of add_languages(native:) introspectionJon Turney1-0/+2
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 Bonzini1-0/+1
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 Bonzini2-2/+10
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 Claessens1-0/+17
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 Mensinger1-0/+1
2020-08-18Interpreter: Fix c_stdlib usageXavier Claessens6-0/+82
- 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 Baker20-0/+0
2020-07-30Allow setting project options from cross or native filesDylan Baker2-0/+4
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 Claessens1-0/+1
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 Claessens1-2/+1
2020-06-30wrap: Apply patch even in VCS casesXavier Claessens3-0/+11
2020-06-22unittests: Fix test_identity_cross on SolarisAlan Coopersmith2-4/+16
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 Mensinger1-2/+15
2020-05-18pass exe_wrapper to test scripts through the environmentDylan Baker3-0/+36
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 Baker13-0/+0
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 Baker3-0/+25
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