summaryrefslogtreecommitdiff
path: root/run_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* mlog: add __str__ method to AnsiDecoratorPaolo Bonzini2021-01-211-3/+3
| | | | | | Automatically colorize the text when printing the AnsiDecorator, based on the result of mlog.colorize_console(). This is how AnsiDecorator is used most of the time anyway.
* Use a single coredata dictionary for optionsDylan Baker2021-01-041-1/+1
| | | | | | | This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
* move OptionKey to mesonlibDylan Baker2021-01-041-1/+2
| | | | | There's starting to be a lot of things including coredata that coredata needs to itself include. putting it in mesonlib makes more sense
* use OptionKey for compiler_optionsDylan Baker2021-01-041-2/+2
|
* use real pathlib moduleDylan Baker2020-11-201-1/+1
| | | | | We added the _pathlib module to work around defeciencies in python 3.5's implementation, since we now rely on 3.6 lets drop this
* pathlib: Fix resolve() by overriding it in Python 3.5Daniel Mensinger2020-10-041-1/+1
|
* compilers/mixins/clike: fix mypy issuesDylan Baker2020-09-241-2/+0
|
* tests: Make monkey patching smarterDylan Baker2020-09-171-25/+13
| | | | | | | | There are two problems here. The first is that we're doing manual monkey patching which is fragile and verbose, when unittest.mock is designed specifically to solve this exact problem. The second is that we're monkey patching os.environ at two different levels with the same information. So let's only do it once.
* Add a test run in an environment which only has a cross compilerJon Turney2020-09-101-2/+4
| | | | | | Add '--cross-only' option to run_tests.py, so we can arrange not to run tests in the 'native' suite when only a cross-compiler is available, as they can't succeed.
* typing: fixup of #7688Daniel Mensinger2020-09-081-2/+2
| | | | | This bug not beeing caught in review is another reason for adding strict typing support to meson.
* run_*tests*.py: print Meson version at start of test suiteMichael Hirsch2020-06-151-2/+3
| | | | | | | | | | on some systems, tests may take over an hour to run--only to find you might have used an unintended Meson version (e.g. release instead of dev). This change prints the Meson version at the start of the run_*tests*.py scripts. Also, raise SystemExit(main()) is preferred in general over sys.exit(main())
* Make colourize_console() a functionJon Turney2020-04-301-3/+3
| | | | | | | | | | | | | | | | Currently, colourize_console is a constant, set at process initialization. To allow the actual stdout to be easily compared with the expected when running tests, we want to allow colourization to be on for the test driver, but not for the in-process configure done by run_configure, which has stdout redirected from a tty to a pipe. v2: Cache _colorize_console per file object v3: Reset cache on setup_console()
* Compiler options per langJohn Ericson2020-04-201-1/+1
| | | | | | | | | | | A current rather untyped storage of options is one of the things that contributes to the options code being so complex. This takes a small step in synching down by storing the compiler options in dicts per language. Future work might be replacing the langauge strings with an enum, and defaultdict with a custom struct, just like `PerMachine` and `MachineChoice`.
* ninjabackend: List PDBs in output list for targetsNirbheek Chauhan2020-02-221-10/+8
| | | | | | | | | | This is more correct, and forces the target(s) to be rebuilt if the PDB files are missing. Increases the minimum required Ninja to 1.7, which is available in Ubuntu 16.04 under backports. We can't do the same for import libraries, because it is impossible for us to know at configure time whether or not an import library will be generated for a given DLL.
* Specify crossfile use in CI job configurationJon Turney2020-01-281-18/+14
| | | | | | | Pull the crossfile specification out of run_test.py so it can be specified in the CI job configuration. Also make some fixes to output ordering in run_test.py.
* run_tests: Fix detection of ninja 1.9Nirbheek Chauhan2020-01-151-16/+22
| | | | | | | `get_backend_commands()` doesn't get called when we run tests as subprocesses, so detect ninja on import. This should speed up CI. Fixes https://github.com/mesonbuild/meson/issues/5888
* run_tests.py: use mlog.log_once to avoid spamming ninja < 1.9 warningsDylan Baker2019-12-131-3/+3
|
* lgtm: Fix Module imported with `import` and `import from`Daniel Mensinger2019-12-051-9/+9
|
* Fix all flake8 warningsDaniel Mensinger2019-10-201-1/+0
|
* mesonlib.split_args/quote_arg/join_argsAleksey Gurtovoy2019-09-051-1/+1
|
* tests: Require ninja 1.9 on CINirbheek Chauhan2019-09-011-9/+19
| | | | | Also, print messages when we have to enable the timestamp resolution workaround.
* tests: Upgrade to ninja v1.9 for LinuxNirbheek Chauhan2019-09-011-1/+1
| | | | | Also use the upstream release. This eliminates Meson CI's dependence on my server.
* tests: Detect ninja v1.9 and disable timestamp hackNirbheek Chauhan2019-09-011-5/+18
| | | | | The high-res timestamp PR by QuLogic was merged in v1.9, so we can switch back to upstream ninja.
* Intel-Cl tests: increase robustness of Windows Intel compilers detection (#5828)Michael Hirsch, Ph.D2019-08-241-3/+27
| | | | | | | | | | | | | | | * intel-cl tests: more rigorous detection of intent to use Intel Windows compilers * fortran coarray test: make skipping more robust in that underlying MPI stack is .run() This is useful for any Fortran coarray work, and especially for intel-cl where multiple Intel compiler versions are often installed, and the wrong underlying MPI library may be dynamically linked, and so a runtime check is needed to exercise the MPI stack underlying Fortran coarray. This is done by fc.run('sync all; end', dependencies: coarray) * pep8
* Put native file before cross file in options listJohn Ericson2019-08-121-1/+1
| | | | | I think this makes more sense by matching how build comes before host. Native builds are also more common than cross builds.
* fortran tests: non-gfortran compilers on Windows are best static libsMichael Hirsch, Ph.D2019-07-301-1/+1
| | | | collapsed get_relative_files_list_from_dir to a one-liner via pathlib.Path
* run_tests: ifort / intel-cl must have ninja backendMichael Hirsch, Ph.D2019-07-301-2/+4
|
* cmake: added test case for environment variablesDaniel Mensinger2019-07-231-6/+11
|
* Add command line argument to skip unit tests.Jussi Pakkanen2019-07-091-6/+12
|
* Make `PerMachine` and `MachineChoice` have just `build` and `host`John Ericson2019-05-161-1/+1
| | | | | | | | | | | | | | | | | | Meson itself *almost* only cares about the build and host platforms. The exception is it takes a `target_machine` in the cross file and exposes it to the user; but it doesn't do anything else with it. It's therefore overkill to put target in `PerMachine` and `MachineChoice`. Instead, we make a `PerThreeMachine` only for the machine infos. Additionally fix a few other things that were bugging me in the process: - Get rid of `MachineInfos` class. Since `envconfig.py` was created, it has no methods that couldn't just got on `PerMachine` - Make `default_missing` and `miss_defaulting` work functionally. That means we can just locally bind rather than bind as class vars the "unfrozen" configuration. This helps prevent bugs where one forgets to freeze a configuration.
* Fix unused variables warningsDaniel Mensinger2019-04-291-1/+1
|
* Flush run_tests output so it appears before the test subprocesses it runsJon Turney2019-04-151-3/+3
| | | | | This makes 'System information', 'Running unittests', etc. appear before any test output.
* Never access environment.properties downstreamJohn Ericson2019-02-021-1/+1
| | | | | | | | | | | | | | | | | Instead use coredata.compiler_options.<machine>. This brings the cross and native code paths closer together, since both now use that. Command line options are interpreted just as before, for backwards compatibility. This does introduce some funny conditionals. In the future, I'd like to change the interpretation of command line options so - The logic is cross-agnostic, i.e. there are no conditions affected by `is_cross_build()`. - Compiler args for both the build and host machines can always be controlled by the command line. - Compiler args for both machines can always be controlled separately.
* find_library: Check arch of libraries on DarwinNirbheek Chauhan2019-01-311-0/+1
| | | | | | | | | | | macOS provides the tool `lipo` to check the archs supported by an object (executable, static library, dylib, etc). This is especially useful for fat archives, but it also helps with thin archives. Without this, the linker will fail to link to the library we mistakenly 'found' like so: ld: warning: ignoring file /path/to/libfoo.a, missing required architecture armv7 in file /path/to/libfoo.a
* Rewrite appleframework and extraframework dependency classesNirbheek Chauhan2019-02-011-0/+1
| | | | | | | | | | | | | Instead of only doing a naive filesystem search, also run the linker so that it can tell us whether the -F path specified actually contains the framework we're looking for. Unfortunately, `extraframework` searching is still not 100% correct in the case when since we want to search in either /Library/Frameworks or in /System/Library/Frameworks but not in both. The -Z flag disables searching in those prefixes and would in theory allow this, but then you cannot force the linker to look in those by manually adding -F args, so that doesn't work.
* unit tests: Fix sdl2 failure test on macOSNirbheek Chauhan2019-01-311-0/+8
| | | | | | | Also ensure that the test's no-pkg-config codepath will always be run, even on the CI where we always have pkg-config available. This counts as a test case for #4728
* unit tests: Simplify get_fake_env()Nirbheek Chauhan2019-01-311-2/+2
| | | | | Almost every test already uses '' for the srcdir/builddir/etc. Make it official.
* Remove cross_info; cross file is parsed up front and discardedJohn Ericson2019-01-021-2/+4
|
* Only autodetect 'vs' backend on windowsDaniel Mensinger2018-12-111-1/+1
|
* Get basic native config file loading workingDylan Baker2018-11-141-0/+1
|
* Merge pull request #4340 from jon-turney/azure-pipelinesJussi Pakkanen2018-10-141-1/+1
|\ | | | | Add Azure pipelines CI
| * Use 'CI' environment variable to detect CI environmentJon Turney2018-10-141-1/+1
| | | | | | | | | | Use the 'CI' environment variable to detect CI environment, rather than a collection of CI-specific ones.
* | tests: Merge backend guessing into one functionNiklas Claesson2018-10-101-17/+23
| |
* | Fix type-bug cannot add str to listNiklas Claesson2018-10-101-1/+4
| |
* | Add option to fail fast in testsNiklas Claesson2018-10-101-0/+15
| |
* | tests runners: Refactor out global variables and add argparseNiklas Claesson2018-10-101-38/+54
|/
* Use a single ArgumentParser for all subcommandsXavier Claessens2018-10-041-1/+1
| | | | | | This has the adventage that "meson --help" shows a list of all commands, making them discoverable. This also reduce the manual parsing of arguments to the strict minimum needed for backward compatibility.
* Add flag to NOT use new build system in xcode because it fails in Xcode9 ↵Guillermo Ignacio Enriquez Gutierrez2018-09-231-1/+3
| | | | when using custom build directories
* Test that system shlibs with undefined symbols can be foundNirbheek Chauhan2018-08-221-10/+26
|
* cross: Be more permissive about not-found exe_wrappernirbheek/exe-wrapper-compiler-fallbacksNirbheek Chauhan2018-07-091-9/+25
| | | | | | | | | | | | | | | | | | | | | | 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.