aboutsummaryrefslogtreecommitdiff
path: root/run_tests.py
AgeCommit message (Collapse)AuthorFilesLines
2019-02-02Never access environment.properties downstreamJohn Ericson1-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.
2019-01-31find_library: Check arch of libraries on DarwinNirbheek Chauhan1-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
2019-02-01Rewrite appleframework and extraframework dependency classesNirbheek Chauhan1-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.
2019-01-31unit tests: Fix sdl2 failure test on macOSNirbheek Chauhan1-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
2019-01-31unit tests: Simplify get_fake_env()Nirbheek Chauhan1-2/+2
Almost every test already uses '' for the srcdir/builddir/etc. Make it official.
2019-01-02Remove cross_info; cross file is parsed up front and discardedJohn Ericson1-2/+4
2018-12-11Only autodetect 'vs' backend on windowsDaniel Mensinger1-1/+1
2018-11-14Get basic native config file loading workingDylan Baker1-0/+1
2018-10-14Merge pull request #4340 from jon-turney/azure-pipelinesJussi Pakkanen1-1/+1
Add Azure pipelines CI
2018-10-14Use 'CI' environment variable to detect CI environmentJon Turney1-1/+1
Use the 'CI' environment variable to detect CI environment, rather than a collection of CI-specific ones.
2018-10-10tests: Merge backend guessing into one functionNiklas Claesson1-17/+23
2018-10-10Fix type-bug cannot add str to listNiklas Claesson1-1/+4
2018-10-10Add option to fail fast in testsNiklas Claesson1-0/+15
2018-10-10tests runners: Refactor out global variables and add argparseNiklas Claesson1-38/+54
2018-10-04Use a single ArgumentParser for all subcommandsXavier Claessens1-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.
2018-09-23Add flag to NOT use new build system in xcode because it fails in Xcode9 ↵Guillermo Ignacio Enriquez Gutierrez1-1/+3
when using custom build directories
2018-08-22Test that system shlibs with undefined symbols can be foundNirbheek Chauhan1-10/+26
2018-07-09cross: Be more permissive about not-found exe_wrapperNirbheek Chauhan1-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.
2018-06-10run_tests: Run all cross tests togetherNirbheek Chauhan1-14/+7
There is a lot of overhead for each travis job, because docker pull takes 3 minutes. Each cross test takes 3-4 minutes. To make things worse, sometimes Dockerhub is slow and docker pull takes longer than 3 minutes.
2018-06-06Convert args.projectoptions into a dictXavier Claessens1-0/+1
This simplifies a lot of code, and centralize "key=value" parsing in a single place. Unknown command line options becomes an hard error instead of merely printing warning message. It has been warning it would become an hard error for a while now. This has exceptions though, any unknown option starting with "<lang>_" or "b_" are ignored because they depend on which languages gets added and which compiler gets selected. Also any option for unknown subproject are ignored because they depend on which subproject actually gets built. Also write more command line parsing tests. "19 bad command line options" is removed because bad cmd line option became hard error and it's covered with new tests in "30 command line".
2018-06-05.travis.yml: Add CI for armhf and mingwNirbheek Chauhan1-20/+23
Also split them out to their own jobs. Travis gives us 5 parallel jobs now, so we can parallelize it a bit more.
2018-06-05Add MinGW-w64 64-bit to the Travis CINirbheek Chauhan1-3/+10
Includes new cross files for MinGW-w64
2018-06-01Set the meson command to use when we know what it isNirbheek Chauhan1-7/+36
Instead of using fragile guessing to figure out how to invoke meson, set the value when meson is run. Also rework how we pass of meson_script_launcher to regenchecker.py -- it wasn't even being used With this change, we only need to guess the meson path when running the tests, and in that case: 1. If MESON_EXE is set in the env, we know how to run meson for project tests. 2. MESON_EXE is not set, which means we run the configure in-process for project tests and need to guess what meson to run, so either - meson.py is found next to run_tests.py, or - meson, meson.py, or meson.exe is in PATH Otherwise, you can invoke meson in the following ways: 1. meson is installed, and mesonbuild is available in PYTHONPATH: - meson, meson.py, meson.exe from PATH - python3 -m mesonbuild.mesonmain - python3 /path/to/meson.py - meson is a shell wrapper to meson.real 2. meson is not installed, and is run from git: - Absolute path to meson.py - Relative path to meson.py - Symlink to meson.py All these are tested in test_meson_commands.py, except meson.exe since that involves building the meson msi and installing it.
2018-05-31Revert "mesonlib: handle meson exe wrappers"Nirbheek Chauhan1-22/+0
This reverts commit 0627e9d616dc311b7c9b0ef17301f680ac9e78a7. Breaks installation: https://github.com/mesonbuild/meson/issues/3647 Will be restored once that can be fixed.
2018-05-30mesonlib: handle meson exe wrappersMartin Kelly1-0/+22
There are cases when it is useful to wrap the main meson executable with a script that sets up environment variables, passes --cross-file, etc. For example, in a Yocto SDK, we need to point to the right meson.cross so that everything "just works", and we need to alter CC, CXX, etc. In such cases, it can happen that the "meson" found in the path is actually a wrapper script that invokes the real meson, which may be in another location (e.g. "meson.real" or similar). Currently, in such a situation, meson gets confused because it tries to invoke itself using the "meson" executable (which points to the wrapper script) instead of the actual meson (which may be called "meson.real" or similar). In fact, the wrapper script is not necessarily even Python, so the whole thing fails. Fix this by using Python imports to directly find mesonmain.py instead of trying to detect it heuristically. In addition to fixing the wrapper issue, this should make the detection logic much more robust.
2018-04-02Imported Debian fixes by Matthias Klose.Jussi Pakkanen1-1/+1
2017-12-03unit tests: Remove all instances of FakeEnvironmentNirbheek Chauhan1-9/+0
We don't need to use that, and it causes build failures when code actually uses the environment.
2017-11-20Replaced sys.executable use with the mesonlib equivalent.Jussi Pakkanen1-3/+4
2017-11-20Tests can be run with an external Meson command.Jussi Pakkanen1-2/+18
2017-10-28Use GCC 7 for cross compilation tests.Jussi Pakkanen1-1/+1
2017-10-01tests: Always run ninja with -d explainNirbheek Chauhan1-1/+1
Will help us figure out the occasional ninja loops we see in our CI: https://github.com/mesonbuild/meson/pull/2394#issuecomment-333340112 https://travis-ci.org/mesonbuild/meson/jobs/281637736
2017-09-18Revert "Revert "Merge pull request #1931 from centricular/use-patched-ninja""Nirbheek Chauhan1-0/+6
This reverts commit 5eb64a6f3e47b570f544524ef48dc6ef0e4dce59. Let's try again, with a fixed Ninja by QuLogic.
2017-09-14run_tests.py: Haiku has no nice().Jérôme Duval1-1/+1
2017-08-13unit tests: Select test cases inside run_unittests.pyNirbheek Chauhan1-9/+1
This allows people to directly run ./run_unittests.py without having to worry about selecting the right test cases for the platform they are on.
2017-08-06Merged singleexe branch.Jussi Pakkanen1-1/+1
2017-08-06Print system information to aid in debugging remote machines.Jussi Pakkanen1-1/+11
2017-08-02Print deprecation warnings on old style commands.Jussi Pakkanen1-1/+1
2017-07-18Revert "Merge pull request #1931 from centricular/use-patched-ninja"Jussi Pakkanen1-6/+0
This reverts commit aab7ada356e02033e4030143cf363d06d975283b, reversing changes made to e1b24765afd9e7d2d8043a408d69c7ad814d3551.
2017-07-17tests: Restore sleep for ninja on HFS+ (macOS)Nirbheek Chauhan1-1/+4
QuLogic discovered that HFS+ only stores dates in uint32 seconds since the epoch, so ninja cannot report sub-1s resolution timestamps there. Sometime in the future Apple FS will become widely-available and we will have to add a filesystem check at startup. https://developer.apple.com/legacy/library/technotes/tn/tn1150.html#HFSPlusDates
2017-07-17CI: Use QuLogic's Ninja patchesNirbheek Chauhan1-0/+3
This way we get some testing for the patches, and speed up our builds. My server is hosted on a UK Linode, so it should have good uptimes. However, we should likely move this into the Docker image at least for Linux, and perhaps put it in a CI cache for the rest.
2017-06-22Add some colour to test output.Elliott Sales de Andrade1-2/+5
Bold the section names and colourize errors&skips.
2017-06-09unit tests: Add class to generate failing testsNirbheek Chauhan1-1/+15
It is not feasible to test all failure modes by creating projects in `test cases/failing` that would be an explosion of files, and that mechanism is too coarse anyway. We have no way to ensure that the expected error is being raised. See FailureTests.test_dependency for an example.
2017-06-09dependencies: Add a new class ExternalDependencyNirbheek Chauhan1-0/+2
This class now consolidates a lot of the logic that each external dependency was duplicating in its class definition. All external dependencies now set: * self.version * self.compile_args and self.link_args * self.is_found (if found) * self.sources * etc And the abstract ExternalDependency class defines the methods that will fetch those properties. Some classes still override that for various reasons, but those should also be migrated to properties as far as possible. Next step is to consolidate and standardize the way in which we call 'configuration binaries' such as sdl2-config, llvm-config, pkg-config, etc. Currently each class has to duplicate code involved with that even though the format is very similar. Currently only pkg-config supports multiple version requirements, and some classes don't even properly check the version requirement. That will also become easier now.
2017-05-21Add coverage export for tests.Elliott Sales de Andrade1-6/+23
2017-05-21Fix cross environment pollution.Ole André Vadla Ravnås1-1/+6
Environment variables like CFLAGS and LDFLAGS should not affect the cross environment. Fixes #1772
2017-05-09project tests: Also regen before buildingNirbheek Chauhan1-0/+8
This actually caught a cached-dependency related bug for me that the test-time regen did not. I also increased the ninja wait time to 1 second because that's actually how long you need to sleep to be guaranteed that a change will be detected. Must poke upstream about https://github.com/ninja-build/ninja/issues/371
2017-04-09unit tests: exe_suffix is '.exe' on CygwinNirbheek Chauhan1-1/+1
2017-04-09tests: Move appveyor platform workaround to run_tests.pyNirbheek Chauhan1-0/+15
This is also needed for the unit tests
2017-04-09unit tests: Fix running specific targets with MSBuildNirbheek Chauhan1-9/+31
/t:targetname syntax doesn't work, but running the vcxproj does work Also use the Backend enum everywhere.
2017-04-09unit tests: Run on all backends, not just NinjaNirbheek Chauhan1-10/+13