Commit Graph

564 Commits

Author SHA1 Message Date
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