Commit Graph

700 Commits

Author SHA1 Message Date
Jussi Pakkanen 84ac5ce51e Convert some methods to use mandatory named kwargs. 2019-07-08 19:36:15 +03:00
Jussi Pakkanen 74611ecb1f Fix unittests. 2019-07-05 22:27:10 +03:00
Daniel Mensinger 54b1c43277 mintro: Add installed subdirs introspection (fixes #5556) 2019-07-01 11:28:54 -07:00
Aleksey Gurtovoy 7423247413 Fix failing test_find_program test (Windows-only)
Skip finding a .py script w/o extension on Windows if `.PY` isn't in
PATHEXT; closes #4355
2019-06-27 21:30:34 +03:00
Aleksey Gurtovoy 8ebe3d46bb Fix faling test_msvc_toolset_version test
VCToolsVersion is not always set, and MS docs  recommend getting the
info from a file
2019-06-27 20:44:29 +03:00
Dylan Baker 42bef8d418 run_unitests: Skip the native_file_is_pipe test on cygwin
Since it hangs and causes azure to time out.
2019-06-24 13:51:34 -07:00
Jussi Pakkanen 59e5ad66f2 Keep all build dirs inside the source tree.
VS and virus scanners complain when generating executables
in temporary directories.
2019-06-24 01:52:54 +03:00
Dylan Baker 56f7e5c74f coredata: Correctly handle receiving a pipe for native/cross files
* coredata: Correctly handle receiving a pipe for native/cross files

In some cases a cross/native file may be a pipe, such as when using bash
process replacement `meson --native-file
<([binaries]llvm-config='/opt/bin/llvm-config')`, for example. In this
case we copy the contents of the pipe into a file in the meson-private
directory so we can create a proper ninja dependency, and be able to
reload the file on --wipe/--reconfigure. This requires some extra
negotiation to preserve these native/cross files.

Fixes #5505

* run_unitests: Add a unit test for native files that are pipes

Using mkfifo.
2019-06-23 17:53:17 +03:00
Nirbheek Chauhan 9042130e9a compilers: Fix bitcode and other options for objc code
We were setting the base options for the Objective-C compiler
manually, due to which options such as b_bitcode and b_ndebug were not
getting set at all.

The base options here are the same as for C code with the Clang
compiler, so just use the same inherited list.

Also expand the bitcode test to ObjC and ObjC++ so this doesn't happen
again.
2019-06-23 16:50:24 +03:00
John Ericson 6d6af46edc Make test for identity
(cherry picked from commit ae6426cd8acfe0ccc5d7958d55edb613b4a5bf01)
2019-06-09 13:14:55 -04:00
John Ericson 07777e15d4 Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.

As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
2019-06-09 13:13:25 -04:00
Jussi Pakkanen 82e36a6bfe Add tests for std usage. Closes #5097.
(cherry picked from commit 27ae70dfaaff1298e68df70098acaa96f7ca748a)
2019-06-05 23:05:49 -04:00
John Ericson af2d7af998 Per machine do 'build.' and '' option prefixes
See the docs/ changes for details.
2019-06-05 23:05:34 -04:00
Dylan Baker 2e2c3c968c tests: Test the cmake parser more thuroughly
It turns out there are bugs, in particular with spaces in variables...
2019-05-29 11:25:27 -07:00
Dylan Baker 0714ba58c7 coredata: add cmake_prefix_path option 2019-05-27 01:24:08 +03:00
Christoph Reiter 7ce9e56a4b Fix path splitting in get_compiler_dirs() with GCC/clang on Windows
It was using ':' as a path separator while GCC uses ';' resulting in bogus
paths being returned. Instead assume that the compiler uses the platform native
separator.

The previous splitting code still worked sometimes because splitting
"C:/foo;C:/bar" resulted in the last part "/bar" being valid if "<DriveOfCWD>:/bar"
existed.

The fix also exposes a clang Windows bug where it uses the wrong separator:
https://reviews.llvm.org/D61121 . Use a regex to fix those first.

This resulted in linker errors when statically linking against a library which
had an external dependency linking against system libs.

Fixes #5386
2019-05-16 23:05:49 +03:00
Dylan Baker 61750494f5 run_unittests: make cross file location test robust against environment
Currently this test assumes that the user doesn't have XDG_DATA_HOME
set in their path, but this isn't a good assumption, and can result in
the test not actually testing what it means to.
2019-05-16 22:51:38 +03:00
John Ericson 957d8e051c Make `PerMachine` and `MachineChoice` have just `build` and `host`
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.
2019-05-16 00:27:57 +03:00
Jussi Pakkanen 7b8ef78bc0
Merge pull request #5331 from dcbaker/icl
ICL (Intel for Windows) support
2019-05-14 00:24:48 +03:00
Dylan Baker 080f59cf43 compilers: rename IntelCompiler to IntelGnuLikeCompiler
The Intel compiler is strange. On Linux and macOS it's called ICC, and
it tries to mostly behave like gcc/clang. On Windows it's called ICL,
and tries to behave like MSVC. This makes the code that's used to
implement ICC support useless for supporting ICL, because their command
line interfaces are completely different.
2019-05-13 11:22:31 -07:00
Antoine Jacoutot e2f6f47fa3 unittests: adapt pkg-config test for OpenBSD
pkg-config(1) on OpenBSD is not the one from freedesktop.org and hence has
subtle differences (which don't impact real usage). The meson test fails
because white space between operators are stripped by our pkg-config:

$ grep Require /usr/local/lib/pkgconfig/xmlsec1.pc
Requires: libxml-2.0 >= 2.8.0 libxslt >= 1.0.20
$ pkg-config --print-requires xmlsec1
libxml-2.0>=2.8.0
libxslt>=1.0.20
2019-05-13 02:46:51 +03:00
Dylan Baker dcfd918548 run_unittests: assume that on windows that intel means icl
There actually is an ICC for windows that can be used to cross compile
from Windows to Linux, but it's not supported in meson currently and I
don't plan to enable it.
2019-05-10 13:51:24 -07:00
Dylan Baker 3e82a4b517 run_unittests: intel-cl links like msvc 2019-05-10 13:43:20 -07:00
Dylan Baker 73eca8255b run_unittests: Don't assume that VS like compilers have MSVC versions 2019-05-10 13:38:20 -07:00
Dylan Baker c72fd1e333 run_unittests: ICL also doesn't do proper resource dependency detection 2019-05-10 13:38:20 -07:00
Dylan Baker 541523eeba compilers: Split C-Like functionality into a mixin classes
Currently C++ inherits C, which can lead to diamond problems. By pulling
the code out into a standalone mixin class that the C, C++, ObjC, and
Objc++ compilers can inherit and override as necessary we remove one
source of diamonding. I've chosen to split this out into it's own file
as the CLikeCompiler class is over 1000 lines by itself. This also
breaks the VisualStudio derived classes inheriting from each other, to
avoid the same C -> CPP inheritance problems. This is all one giant
patch because there just isn't a clean way to separate this.

I've done the same for Fortran since it effectively inherits the
CCompiler (I say effectively because was it actually did was gross
beyond explanation), it's probably not correct, but it seems to work for
now. There really is a lot of layering violation going on in the
Compilers, and a really good scrubbing would do this code a lot of good.
2019-05-03 10:36:50 -07:00
Martin Hostettler ed109801c6 munstable_coredata: Adapt to coredata changes. 2019-05-02 23:55:53 +03:00
Jussi Pakkanen 1f4023fa47
Merge pull request #5311 from mensinda/flake8Plugins
Added flake8 plugins and some code fixes
2019-05-02 23:30:29 +03:00
Peter Hutterer 70997ca969 mtest: check for an empty suite list
For consistency, it can be useful to have an explicit empty test suite list
for a test:

   test('test-name', binary, suite: [])

This currently passes meson but fails when running meson tests:

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 122, in run
    return options.run_func(options)
  File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 1005, in run
    return th.doit()
  File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 756, in doit
    self.run_tests(tests)
  File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 896, in run_tests
    visible_name = self.get_pretty_suite(test)
  File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 875, in get_pretty_suite
    rv = TestHarness.split_suite_string(test.suite[0])[0]
IndexError: list index out of range

Fix it by simply checking for the test suite to be a valid list we can pass on

Fixes #5340

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-05-02 22:12:58 +03:00
Daniel Mensinger 236221061a
Fixed unnecessary .items() 2019-04-29 12:23:13 +02:00
Daniel Mensinger e75211d321
Fix builtin variable names 2019-04-29 12:17:40 +02:00
Daniel Mensinger bf98ffca9e
Fix blind exceptions 2019-04-29 12:16:06 +02:00
Dylan Baker 914b591692 run_unittets: extend version tests to cover other cases
Before this we only covered >, <, and ==, but we an apply some basic
logic to know that a > b == !(a <= b), or that if a > b then a != b.
This uncovered some bugs I wrote while working on this code.
2019-04-25 12:28:51 -07:00
Dylan Baker 397ac5921a run_unittests: rewrite version test to not call private methods
We really should be testing using the operators themselves, not the
internal implementations, ie we should use a > b not a.__cmp__(b) == 1
in our tests, because __cmp__ is just an implementation detail.
2019-04-25 12:28:51 -07:00
Dylan Baker add821db64 Don't use mutable types as default arguments
This isn't safe given the way python implements default arguments.
Basically python store a reference to the instance it was passed, and
then if that argument is not provided it uses the default. That means
that two calls to the same function get the same instance, if one of
them mutates that instance every subsequent call that gets the default
will receive the mutated instance. The idiom to this in python is to use
None and replace the None,

def in(value: str, container: Optional[List[str]]) -> boolean:
   return src in (container or [])

if there is no chance of mutation it's less code to use or and take
advantage of None being falsy. If you may want to mutate the value
passed in you need a ternary (this example is stupid):

def add(value: str, container: Optional[List[str]]) -> None:
    container = container if container is not None else []
    container.append(value)

I've used or everywhere I'm sure that the value will not be mutated by
the function and erred toward caution by using ternaries for the rest.
2019-04-23 02:03:19 +03:00
Dylan Baker 3edc7f343b coredata: store cross/native files in the same form they will be used (#5224)
* coredata: store cross/native files in the same form they will be used

Currently they're forced to absolute paths when they're stored in the
coredata datastructure, then when they're loaded we de-absolute path
them to check if they're in the system wide directories. This doesn't
work at all, since the ninja backend will generat a dependency on a
file that is in the source directory unless the path was already given
as absolute. This results in builds being retriggereed forever due to
a non-existant file.

The right way to do this is to figure out whether the file is in the
build directory, is absolute, or is in one of the system paths at
creation time, and store that path as absolute. Then the code that
reads the file and the code that generates the dependencies in the
ninja backend just takes the computed list and there is no mismatch
between them.

Fixes #5257

* run_unittests: Add a test for correct native file storage

This tests the bug in #5257
2019-04-21 23:10:02 +03:00
makise-homura 94b7ff3823 Correctly find lfortran for Elbrus compiler 2019-04-19 18:39:04 +03:00
Nirbheek Chauhan 2795f942be interpreter: Check the meson version before parsing options
Also add a test for it so we don't regress this in the future.

Closes https://github.com/mesonbuild/meson/issues/5281
2019-04-18 19:18:21 +00:00
Nirbheek Chauhan 2e93ed58c3 unit tests: Skip toolset version test on VS2015 and older 2019-04-18 09:01:23 +00:00
Nirbheek Chauhan 7654db511c vs: Update toolset table for VS 2019
Also add a test to ensure that we don't forget it in the future.
2019-04-18 09:01:23 +00:00
Paolo Bonzini 2942467148 add test case for generator dependencies 2019-04-16 01:46:31 +00:00
Nirbheek Chauhan 10468b3a28 interpreter: Warn when environment() ops are overriden
Warn when someone tries to use append() or prepend() on an env var
which already has an operation set on it. People seem to think that
multiple append/prepend operations stack, but they don't.

Closes https://github.com/mesonbuild/meson/issues/5087
2019-04-13 22:53:33 +03:00
TheQwertiest 2499e25476 Added a unit test for built-in options docs 2019-04-12 00:24:07 +03:00
Daniel Mensinger d72d98d3af mintro: removed deprecated --target-files API 2019-04-08 21:06:15 +03:00
Nirbheek Chauhan ef87d11dcd
Merge pull request #4931 from dcbaker/pkg-config-builtin
dependencies: Add command line option for pkg_config_path
2019-04-07 07:55:36 +00:00
Dylan Baker 91b2475e30 dependencies/pkg-config: Add support for different cross_flags 2019-04-05 15:08:17 -07:00
Dylan Baker 569e646e1e dependencies: Add command line option for pkg_config_path
This creates a new command line option to store pkg_config_path into,
and store the environment variable into that option. Currently this
works like the environment variable, for both cross and native targets.
2019-04-05 15:08:17 -07:00
Antoine Jacoutot d4cece3b34 test_pkgconfig_formatting: OpenBSD, libintil is a separate library 2019-04-03 08:54:06 -07:00
Daniel Mensinger 1937bbafac
mintro: Fix crash when required is a function (closes #5177) 2019-04-02 11:21:05 +02:00
Jussi Pakkanen 75219989ca
Merge pull request #5128 from Ericson2314/sanity-check-with-flags
Sanity check with external args
2019-04-02 00:40:05 +03:00
Jussi Pakkanen e3e83e2acd Also format headers with Clang-Format. Closes #5184. 2019-04-01 01:26:53 +03:00
John Ericson 507b1dc40e Fix test_compiler_*_stds tests after last commit
Since sanity check now includes CFLAGS, the test fails earlier.

But if the compiler is ICC, it will only fail during the build proper as
before, since that's where where the flag making `-std=unknown` an error
not warning is used.
2019-03-27 10:54:56 -04:00
John Ericson d361da991b Change test to reflect new semantics 2019-03-27 14:45:42 +00:00
Jussi Pakkanen f46b485fc2
Merge pull request #5083 from rossburton/crossfiles
Support multiple --cross-file options
2019-03-20 18:46:32 +02:00
Dylan Baker ac627bcea7 replace library type strings with an enum
This patch creates an enum for selecting libtype as static, shared,
prefer-static, or prefer-shared. This also renames 'static-shared'
with 'prefer_static' and 'shared-static' with 'prefer_shared'. This is
just a refactor with no behavioral changes or user facing changes.
2019-03-20 18:45:56 +02:00
Ross Burton a87b51f75c Add test case for multiple cross files 2019-03-20 10:06:17 +00:00
Ross Burton 1a2b5d3b53 run_unittest: update for cross_file being a list 2019-03-20 10:06:17 +00:00
Nirbheek Chauhan 07818dac6a compilers: Try harder to dedup builtin libs
Compiler internal libs should always be de-duplicated, no matter what.

Closes https://github.com/mesonbuild/meson/issues/2150

Test case is by Bruce Richardson in the issue.
2019-03-14 12:21:05 +00:00
Antoine Jacoutot 5d3e20984d compilers: -fsanitize is not supported on OpenBSD (second pass)
Similar to https://github.com/mesonbuild/meson/pull/5067
This part was missed in my previous commit.
2019-03-13 08:57:46 +00:00
Antoine Jacoutot f7af1a6285 compilers: -fsanitize is not supported on OpenBSD
OpenBSD doesn't have any support for the compiler sanitizers yet.
While this may change in the future, better fix test suite run in "failfast"
mode for now. This can be revisited once (if) we get support in the future.

* clang 7.0.1
$ make CFLAGS=-fsanitize=address foo
cc -fsanitize=address   -o foo foo.c
cc: error: unsupported option '-fsanitize=address' for target 'amd64-unknown-openbsd6.5'

* gcc 4.2.1
*** Error 1 in /tmp (<sys.mk>:85 'foo')
$ make CC=gcc CFLAGS=-fsanitize=address foo
gcc -fsanitize=address   -o foo foo.c
cc1: error: unrecognized command line option "-fsanitize=address"

* gcc 8.2.0
$ make CC=egcc CFLAGS=-fsanitize=address foo
egcc -fsanitize=address   -o foo foo.c
ld: error: unable to find library -lasan
collect2: error: ld returned 1 exit status
2019-03-13 06:35:58 +00:00
John Ericson 9409155d5a Avoid module patching in `test_find_library_patterns`
This is less hacky, and also prepares the way for #4010.
2019-03-12 04:03:47 +00:00
Niklas Claesson dd2c44cdf6 Add static as keyword to find_library 2019-03-11 20:56:52 +02:00
Ignacio Casal Quinteiro c6f84a223c Add unit test for pkgconfig relative paths 2019-03-11 17:38:22 +00:00
Antoine Jacoutot c1c699eda4 Fix unit test: test_find_library_patterns 2019-03-11 06:02:17 +00:00
Jussi Pakkanen 7589471978 Condense directory numbering for release. 2019-03-10 18:39:03 +02:00
Daniel Mensinger 91918262e7
rewriter: Fixed unit tests 2019-03-04 13:14:48 +01:00
Daniel Mensinger 594bf678c7
rewriter: Require '/' for the project ID 2019-03-04 13:00:30 +01:00
Daniel Mensinger 609a21ff9f
rewriter: Abort on error by default 2019-03-04 13:00:30 +01:00
Daniel Mensinger 5d2f14fce7
rewriter: Quiet logging by default 2019-03-04 13:00:30 +01:00
Daniel Mensinger e724fd5438
rewriter: Handle duplicate target 2019-03-04 13:00:29 +01:00
Daniel Mensinger b55dbf0fae
rewriter: Dump JSON to stderr instead of stdout 2019-03-04 13:00:07 +01:00
Daniel Mensinger 740f6b8f06
rewriter: Implemented a CLI 2019-03-04 13:00:05 +01:00
Daniel Mensinger 2582f311b0
rewriter: Make sure target sources are relative 2019-03-04 13:00:05 +01:00
Daniel Mensinger 760d1bff9c rewriter: Sort source files (#5010)
* rewriter: Sort source files

* rewriter: Natural sorting

* rewriter: Fix flake8

* rewriter: Fixed sorting

* rewriter: Make sorting key more readable

* rewriter: Even simpler key
2019-03-04 13:58:35 +02:00
Daniel Mensinger 7074f12644
mintro: Renamed --dependencies --> --scan-dependencies 2019-03-03 23:19:04 +01:00
Daniel Mensinger 9e659b3130
Added test cases 2019-03-03 23:19:03 +01:00
Daniel Mensinger bd5d54513c rewriter: Handle Arithmetic node 2019-03-03 20:25:07 +02:00
Paolo Bonzini 91f847d308 mtest: implement TAP parsing
This provides an initial support for parsing TAP output.  It detects failures
and skipped tests without relying on exit code, as well as early termination
of the test due to an error or a crash.

For now, subtests are not recorded in the TestRun object.  However, because the
TAP output goes on stdout, it is printed by --print-errorlogs when a test does
not behave as expected.  Handling subtests as TestRuns, and serializing them
to JSON, can be added later.

The parser was written specifically for Meson, and comes with its own
test suite.

Fixes #2923.
2019-03-02 09:07:54 +01:00
Daniel Schulte f0b0bcf86d mintro: Add subproject_dir to --projectinfo 2019-03-01 23:40:33 +02:00
Daniel Schulte 924cf5e622 mintro: Add name of subproject the target is contained in to --target output 2019-03-01 22:29:52 +02:00
Jussi Pakkanen 97555cf6d9
Merge pull request #4939 from mensinda/rwDefOpts
rewriter: Set and delete project default options
2019-02-26 22:34:33 +02:00
John Ericson 9cf0f31ec0 unit tests: Use unittest.skipUnless to simplify main()
This makes the testsuite work better with other test runners, like
pytest. This is important because better test runners are very useful to
development (e.g. avoiding running succeeding tests again and again),
even if we want to still support 0 dependency testing of Meson though
keeping the default test runnner working.
2019-02-26 15:42:17 +00:00
Daniel Mensinger 16b6b2d411
Use c++14 instead of c++17 in the tests 2019-02-26 09:34:58 +01:00
Daniel Mensinger 9e247cb52e
rewriter: Set and delete default options 2019-02-26 09:34:58 +01:00
Daniel Mensinger 74bb79e26e
rewriter: Remove matching regex from list 2019-02-26 09:34:57 +01:00
Jussi Pakkanen 5d751a2506 Pick target exactly rather than relying on dict order. 2019-02-26 01:26:54 +02:00
Raphael Salamon c23ac0b3dc Allow custom targets with same name in project and subprojects
closes #4377
2019-02-19 19:41:57 +02:00
Jussi Pakkanen 6e15bcc504
Merge pull request #4929 from mensinda/rwAddRmTgt
rewriter: Add and remove targets
2019-02-19 00:08:58 +02:00
jml1795 a9e63568fe Add warning level zero 2019-02-19 00:06:27 +02:00
Daniel Mensinger 5184465280
rewriter: Added support for adding targets 2019-02-16 14:17:01 +01:00
Daniel Mensinger 056c533ede
rewriter: Added support for removing targets 2019-02-16 14:14:16 +01:00
Jussi Pakkanen 939b011114
Merge pull request #4858 from mensinda/rwKWARGS
rewriter: Add support for kwargs modification
2019-02-16 14:17:49 +02:00
Dylan Baker b5d847e38c allow paths to be set in the cross file
Just like the previous patch, but for cross files

Fixes #1433
2019-02-11 12:50:32 -08:00
Dylan Baker 5b896ed70b allow setting directory locations in a native file
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-02-11 12:50:32 -08:00
Jussi Pakkanen 902aaf2ce6
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
2019-02-04 23:06:46 +01:00
Daniel Mensinger 69cb314718 Fix introspection test case for solaris (fixes #4866) 2019-02-04 20:25:03 +01:00
John Ericson 19f81d3e33 Never access environment.properties downstream
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-02-02 13:59:14 -05:00
Daniel Mensinger da7b9df16c Ensure that func dicts provide the same set of functions 2019-02-01 11:49:52 +00:00
Nirbheek Chauhan 50b863032e find_library: Check arch of libraries on Darwin
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-01-31 20:36:49 +00:00
Nirbheek Chauhan c0166355ce Rewrite appleframework and extraframework dependency classes
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-02-01 00:14:09 +05:30
Daniel Mensinger 8c364952af
Added dependecy kwargs support 2019-01-31 15:57:02 +01:00
Daniel Mensinger 5655865246
Added test case 2019-01-31 15:43:04 +01:00
Daniel Mensinger 8bb942ef25
Rewriter infodump modifications 2019-01-31 15:43:04 +01:00
Daniel Mensinger 8224ecfbe6
Some fixes and assignment based target find 2019-01-31 15:43:04 +01:00
Nirbheek Chauhan 00b59c9ad6 pkg-config: Fix another case where we were throwing a traceback
Also add a test for it. In the process, also remove an overly-zealous
try..except statement that was catching *all* exceptions, not just
expected ones, which was masking programming errors.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 4268e156a3 unit tests: darwin tests must never require pkg-config 2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 3997e8762e unit tests: Fix sdl2 failure test on macOS
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-31 20:12:21 +05:30
Nirbheek Chauhan 58852e6290 unit tests: Simplify get_fake_env()
Almost every test already uses '' for the srcdir/builddir/etc.
Make it official.
2019-01-31 20:12:21 +05:30
Nirbheek Chauhan 36779c0500 unit tests: Run native file tests on the CI
The native file tests were never run on the CI since they were skipped
on Windows and also skipped on Linux and macOS since CC/CXX/etc are
always set by the CI.

Also fix test failure on macOS. The test was assuming that because
/usr/bin/gcc and /usr/bin/clang exist on macOS, they must be different
compilers. They're not. gcc is just a wrapper around clang, and we
correctly detect it as such.
2019-01-30 23:21:59 +02:00
Michael Hirsch, Ph.D da34bea893 pep8 py37 2019-01-29 22:06:11 +02:00
Michael Hirsch, Ph.D 8636f31d9c BUGFIX: broken/missing Fortran code/unit tests 2019-01-27 20:57:21 +02:00
Jussi Pakkanen 733f9a7765
Merge pull request #4814 from mensinda/astVisitor
rewriter: Rewrote the meson rewriter - now works with AST modification
2019-01-27 20:46:29 +02:00
Christoph Reiter 8df5afc98a configure_file: preserve newlines of the input file. Fixes #4817
In some cases (see #4817) it's helpful if the output file uses the
same newlines as the input file without translating them to the
platform defaults.

open() by default recognizes all newline styles and translates them
to "\n" and then to the platform default when writing.
Passing "" to "newline" disables the translation and lets us pass through
the original newline characters.
2019-01-24 21:02:34 +02:00
Nirbheek Chauhan d02ec7111e coredata: Only reject a load if major version differs
Our builddir ABI is stable across minor (stable) releases, so there is
no need to force a wipe. We already release pretty often, no need to
force people to wipe twice as often.
2019-01-23 19:50:50 +05:30
Daniel Mensinger 4b3e21b894
Fixed test case and setup.py 2019-01-22 17:47:51 +01:00
Daniel Mensinger 6fe2c2b209
Fixed flake8 issues 2019-01-22 17:31:15 +01:00
Daniel Mensinger 027c3c9ac7
Added subdir test 2019-01-22 17:04:43 +01:00
Daniel Mensinger b7c6f3ec72
Can now rewrite files 2019-01-22 16:41:25 +01:00
Daniel Mensinger 8dd9b44831
Added support for removing sources from a target 2019-01-22 16:41:25 +01:00
Daniel Mensinger 0ce6632393
Added suport for adding sources to a target 2019-01-22 16:41:25 +01:00
Daniel Mensinger 86d5799bc4
First rewriter test case 2019-01-22 16:41:06 +01:00
Daniel Mensinger 277dc10a5d
AST post processing 2019-01-22 16:09:34 +01:00
Simon McVittie 65192af2ff run_unittests: Use Python 3.5-compatible subprocess invocation
subprocess.run() didn't get the encoding parameter until 3.6.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2019-01-17 23:09:17 +02:00
Daniel Mensinger af38722f89 mintro: Introspection interpreter refactoring (#4733)
* 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-16 23:42:54 +02:00
Daniel Mensinger 2bb69ad50b Renamed unit test directories 2019-01-16 19:10:47 +02:00
Xavier Claessens 66ac6f6b3d find_external_dependency: Return NotFoundDependency()
The returned not-found object can be from any type because we were
returning the first of the failed attempts. It also can happen that we
don't have any dependency object in which case we should just return
NotFoundDependency() object as well instead of raising an exception.
That exception was happening before, but dependency_impl() was
calling find_external_dependency() in a try block so it was hidden.
2019-01-16 11:16:46 -05:00
Xavier Claessens 815f1205a8 do_subproject: Improve log messages and formatting 2019-01-16 11:16:46 -05:00
Daniel Mensinger 609ecba37f mintro: Added `defined_in` key in the targets introspection 2019-01-15 20:28:12 +02:00
Daniel Mensinger 5c139032b8
Deprecated --target-files API 2019-01-07 22:35:56 +01:00
Daniel Mensinger 29dd57dcbf
Fixed flake8 2019-01-07 22:26:09 +01:00
Daniel Mensinger e67ba0fd64
Also made buildsystem files absolute 2019-01-07 22:26:09 +01:00
Daniel Mensinger a1d8c1d3e9
Changed introspection target format 2019-01-07 22:24:49 +01:00
Daniel Mensinger ab32f1fe00 Added meson-info.json 2019-01-06 22:03:29 +01:00
Daniel Mensinger bd8bad46c3
Code cleanup and renamed variables 2019-01-06 12:19:33 +01:00
Daniel Mensinger 8ac5b36c70
Fixed mac unit test 2019-01-06 12:19:32 +01:00
Daniel Mensinger 02734cc5c3
Better documentation 2019-01-06 12:19:31 +01:00
Daniel Mensinger 2e81631d0c
Keep 'filename' and 'install_filename' as strings 2019-01-06 12:19:31 +01:00
textshell 7eb8621ea6
Update run_unittests.py
Co-Authored-By: mensinda <daniel@mensinger-ka.de>
2019-01-06 12:19:30 +01:00
Daniel Mensinger 7691b0460c
Ninja backend target introspection 2019-01-06 12:19:30 +01:00
Daniel Mensinger d4ac832bf6
Split the monolithic introspection file into chunks 2019-01-06 12:19:29 +01:00
Daniel Mensinger e4e0e89ea8
Fixed mac build 2019-01-06 12:19:29 +01:00
Daniel Mensinger a9ade54707
Should fix azure 2019-01-06 12:19:29 +01:00
Daniel Mensinger c326ae2e75
Fixed flake8 2019-01-06 12:19:29 +01:00
Daniel Mensinger b11df88395
Documentation and unit test update 2019-01-06 12:19:29 +01:00
Daniel Mensinger b034f52656
Filenames are now lists 2019-01-06 12:19:29 +01:00
Daniel Mensinger b91c5aad85
Update intro dump on meson configure 2019-01-06 12:19:29 +01:00
Daniel Mensinger c4eb5c79fe
Added unit test 2019-01-06 12:19:28 +01:00
Daniel Mensinger 24d668bea0
Removed determine_installed_path since it is no longer needed 2019-01-06 12:19:28 +01:00
Daniel Mensinger 98eb7a48ab
Added unit test 2019-01-06 12:19:27 +01:00
Xavier Claessens 83964f64fa pkgconfig: Fix flag deduplication
This is a regression introduced by 2cbf7caf5, generated pkg-config files
have many duplicated '-pthread' flags.
2019-01-05 21:44:53 +02:00