Commit Graph

3354 Commits

Author SHA1 Message Date
Jussi Pakkanen 02da0a02a6 Merge pull request #1463 from centricular/test-has-include-fallback
tests/37 has header: Also test the fallback include check
2017-03-14 05:47:38 -04:00
Nirbheek Chauhan f427603aa2 tests/37 has header: Disable fallback test on macOS 2017-03-14 12:33:17 +05:30
Nirbheek Chauhan 665dd78ffe project tests: Print meson log instead of stdout for configure failures 2017-03-14 12:30:06 +05:30
Nirbheek Chauhan 50e0543cd7 unittests: Print output for failing commands
Because we are using check_output, if the command fails no output will
be printed at all. So, we use subprocess.run instead.

Also, on configure failures, print the meson-log.txt instead of stdout.
2017-03-13 03:25:57 +05:30
Nirbheek Chauhan b8b05497af tests/37 has header: Also test the fallback include check
Also forcibly undefine __has_include and test that the fallback include
check in cc.has_header() works.

This is important because all the latest compilers support it now
and we might have no test coverage at all by accident. GCC 5, ICC 17,
Clang 3.8, and VS2015 Update 2 already support it.
2017-03-12 19:11:42 +05:30
Nirbheek Chauhan 1612dbd719 has_header: Use "foo.h" syntax instead of <foo.h>
This is broken on GCC due to a GCC bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005

It doesn't matter whether we use <> or "" in our checks because we run
them from an empty temporary directory anyway.

Includes a test for all this.

Closes https://github.com/mesonbuild/meson/issues/1458
2017-03-12 08:37:14 -04:00
Nirbheek Chauhan 853634a48d Add UNIX large file support via compiler always-args
On 32-bit Linux and BSD, all libcs support this. Musl always enables it,
and UClibc behaves like Glibc unless it's built without large file
support (which is a terrible idea).

http://wiki.musl-libc.org/wiki/FAQ#Q:_do_i_need_to_define_LARGEFILE64_SOURCE_to_get_64bit_off_t_.3F
https://git.uclibc.org/uClibc/tree/include/features.h#n326

macOS now only ships 64-bit, so this is irrelevant there.

32-bit Windows and older versions of Bionic do not have transparent
large file support and you must use lseek64, etc there, so this won't
affect those. Newer Bionic versions behave like Glibc in theory.

https://msdn.microsoft.com/en-us/library/1yee101t.aspx
http://code.google.com/p/android/issues/detail?id=64613

Includes a linuxlike test for this.

Closes https://github.com/mesonbuild/meson/issues/1032
2017-03-10 11:33:26 -05:00
Michal Sojka 1713aef364 Do not colorize output on dumb terminals
Dumb terminal is provided e.g. by Emacs for programs run within it.
2017-03-08 06:37:42 -05:00
Jussi Pakkanen 48d371bd19 Bump version number for new development. 2017-03-05 23:46:21 +02:00
Jussi Pakkanen b63cdc8395 Increment version number for release. 2017-03-05 23:09:33 +02:00
Nirbheek Chauhan 0543a378ca tests: Minor fixes to the library-usage tests
Actually use the myFunc() symbol from the library, and actually run the
built executable on macOS.
2017-03-05 05:48:33 -05:00
Nirbheek Chauhan 16c27bef0b Add a cmake file for manual comparison
We differ from cmake in the following manner:

* We only set the major version (SOVERSION) in the dylib
* If SOVERSION is not specified, we deduce it from version (VERSION)

See installed_files.txt for a list of output dylib names.
2017-03-04 09:12:51 -05:00
Nirbheek Chauhan 9ccbe72509 Add manual-linking tests to Linux and Windows
In this test, we try to manually link against the generated library to
create an executable and then run it to verify that it works.

Also test for all possible library versioning in the versioning tests on
Windows. Even though they yield the same dll naming, we should still
test it.
2017-03-04 09:12:51 -05:00
Nirbheek Chauhan a24651f33a darwin: Also add the major version in the dylib
And symlink to the unversioned library for build-time linking.

https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html#//apple_ref/doc/uid/TP40002013-SW2

Unlike Autotools, we do not add the minor or micro version in the
filename because the Apple documentation says you must embed that inside
the library with -current_version.
2017-03-04 09:12:51 -05:00
Jussi Pakkanen 2ecb26c9ae Merge pull request #1444 from mesonbuild/pdbinstall
Install PDB files. Closes #1442.
2017-03-04 05:52:33 -05:00
Jussi Pakkanen b3aaab3a03 Have all compiler invocations in compdb. Closes #1439. 2017-03-04 05:51:56 -05:00
Patrick Griffis a795ea3cd4 gnome.genmarshal: Use --output when available
This is just cleaner and works around #1417
2017-03-03 14:11:44 -05:00
Nirbheek Chauhan 303b8819ec Nuke dead code which was used for installing PDB files
We check for the existence of PDB files in the install script, so we
don't need to do all this mucking about here. That's more robust too
because we don't need to parse build arguments in buildtype=plain
and decide if the PDB file would be generated.
2017-03-03 15:52:31 +05:30
Nirbheek Chauhan 2340fd3d8a tests/windows: Tests for #1444
Check that pdb files are installed
2017-03-03 15:52:31 +05:30
Jussi Pakkanen 0c957b75c6 Install PDB files. Closes #1442. 2017-03-02 20:31:05 +02:00
Jussi Pakkanen 293520f55f Merge pull request #1379 from mesonbuild/doxygen
Created doxygen sample project.
2017-03-01 13:51:41 -05:00
Jussi Pakkanen a7609e76f6 Graceful fallback when printing messages with characters not understood by stdout. 2017-03-01 07:58:46 -05:00
Jussi Pakkanen b927468137 Use cross stripper when cross compiling and allow overriding native strip executable. Closes #1414. 2017-02-27 16:49:32 -05:00
Marc Becker 92d18b9256 Fix directory context for git wrap check 2017-02-27 13:04:20 -05:00
Jussi Pakkanen a61e41b1d2 Force log file to UTF-8. 2017-02-27 07:33:23 -05:00
Nirbheek Chauhan 0e6045864c tests: Use #!/usr/bin/env python3 for all scripts
We automatically convert that to use sys.executable now which is
always available on all platforms (because we're running with it).

On some platforms like NetBSD, `python` doesn't exist, and you must
use a specific python version. On most other distros, `python` is
Python 2, and we don't want to depend on that.

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

All these scripts were being used as `find_program()`, so we do not
lose any test coverage by doing this.
2017-02-26 07:52:49 -05:00
Nirbheek Chauhan 438f219864 gnome: Pass ExternalProgram objects to CustomTarget
There is no need to do obj.get_command() and in fact it's wrong
because the VS backends need to resolve each object to absolute paths
and get_command() does not do that.

This should fix invocation of GNOME module helpers with the VS backends

For the record, absolute paths for programs are needed because the
same PATH environment won't necessarily be available to Visual Studio
when it builds the generated solution.

Related to https://github.com/mesonbuild/meson/issues/1419
2017-02-26 07:42:47 -05:00
Jussi Pakkanen 792b07c61b Merge pull request #1421 from centricular/mesontest-test-args
mesontest: Support passing extra args to tests at runtime
2017-02-26 07:39:21 -05:00
Elliott Sales de Andrade 7c5de87656 Raise if gobject-introspection is not found.
This used to produce a warning, but then would crash anyway. It's
simpler if we just error out and have the user disable gir generation or
install gobject-introspection.
2017-02-26 07:28:54 -05:00
Nirbheek Chauhan 4f0e204c34 Fix undefined variables in ObjC/C++ detection
Pointed out by Mike Sinkovsky
2017-02-26 07:28:27 -05:00
Fabio Porcedda 7cece438cc ninjabackend: generate "compile_commands.json" even for cross compile
Just add 'c_CROSS_COMPILER' and 'cpp_CROSS_COMPILER' to the
'ninja -t compdb' command.
2017-02-26 07:27:51 -05:00
Nirbheek Chauhan f5b43eef1b mesontest: Support passing test arguments at runtime
This is especially useful with the glib testing framework where you
can select which tests to run within a single test executable by
pasing `-p /some/test/path`
2017-02-23 11:56:46 +05:30
Nirbheek Chauhan 9fffcef290 mesontest: Fix --repeat with --gdb
It would add --args to `wrap` repeatedly for each re-run, resulting in
gdb erroring out with `--args: No such file or directory.`

Also don't make --gdb and --wrapper mutually exclusive. Sometimes people
want to run under a wrapper *and* run it under gdb.
2017-02-23 11:56:46 +05:30
Nirbheek Chauhan 62c7dcf32d mesontest: Use shlex.split for parsing the wrapper
Allows people to pass arguments with spaces in them. Do this using
argparse itself instead of doing an isinstance later.
2017-02-23 11:56:46 +05:30
Jussi Pakkanen 95248f0f26 Merge pull request #1408 from centricular/detectcompilersbetter
More fixes to compiler detection
2017-02-20 16:34:41 -05:00
Nirbheek Chauhan 7a671e21b9 objc tests: Disable nsstring test on Clang + Linux
The GNUstep runtime shipped in Linux distros is GCC-specific and won't
work with clang. You have to build it separately and set the paths
yourself.

In file included from /root/b 05ywf6dg/stringprog@exe/stringprog-unity.m:1:
In file included from /root/b 05ywf6dg/../test cases/objc/2 nsstring/stringprog.m:1:
In file included from /usr/include/GNUstep/Foundation/NSString.h:89:
In file included from /usr/include/GNUstep/Foundation/NSObject.h:30:
In file included from /usr/include/GNUstep/Foundation/NSObjCRuntime.h:213:
/usr/include/GNUstep/GNUstepBase/GSObjCRuntime.h:58:11: fatal error: 'objc/objc.h' file not found
 #include <objc/objc.h>
          ^

On my system, I get the same error and the objc.h path is:

/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/objc/objc.h
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 8e48f23262 Detect GCC type on macOS for ObjC/C++ too
These compilers are available in MinGW and can be built on macOS.

More interestingly, `gcc` is a wrapper around `clang` on macOS, so we
will detect the compiler type incorrectly on macOS without this.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 01f207f347 unit tests: Don't try to test objc/c++ on Windows
MSVC compiler doesn't support it obviously.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 69e83d6aed Support passing of options to compilers and linkers
If you pass options, the last element in the array won't be the
compiler basename, so just check if the basename is in the exelist
somewhere.

Includes a test.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 003e0a0610 Use the same function for detection of C and C++ compilers
The mechanism is identical which means there's a high likelihood of
unintended divergence. In fact, a slight divergence was already there.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 56a8b2a181 Fix static linker exelist in cross-info and environment
https://github.com/mesonbuild/meson/pull/1406 had an incomplete fix
for this. The test case caught it.

Note: this still doesn't test that setting it in the cross-info works,
but it's the same codepath as via the environment so it should be ok.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 798c349e35 Fix compiler exelist in cross-info and the environment
https://github.com/mesonbuild/meson/pull/1406 had an incomplete fix
for this. The test case caught it.

Note: this still doesn't test that setting it in the cross-info works,
but it's the same codepath as via the environment so it should be ok.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan de45535b7d travis: Also set OBJC and OBJCXX to CC/CXX
Else they are only autodetected and we don't test both GCC and Clang.
2017-02-21 01:36:08 +05:30
Nirbheek Chauhan 68eea4818d environment: Use shlex.split() to get AR from the env
That way if the path has spaces, it won't get messed up.
2017-02-21 01:36:08 +05:30
Hase Bastian ff34e6c0b2 Update authors.txt 2017-02-21 01:36:08 +05:30
Hase Bastian 283d5e6233 Detect (non-Apple) clang as objc/c++ compiler
See https://github.com/mesonbuild/meson/pull/1388
2017-02-21 01:35:56 +05:30
Nirbheek Chauhan 238d1a37a0 Factor out common code in compiler detection
This was being duplicated across C/C++/ObjC/ObjC++/Fortran and hence
was behaving slightly differently in each.
2017-02-21 01:35:56 +05:30
Jussi Pakkanen d6614ba811 Merge pull request #1402 from centricular/test-setup-fixes
Various fixes to how mesontest handles test setups.
2017-02-20 14:56:45 -05:00
Jussi Pakkanen 98af711ca6 Merge pull request #1403 from centricular/compile_resources
Make configure_file() great again
2017-02-20 14:27:06 -05:00
Jussi Pakkanen c8042b5574 Merged clang color. 2017-02-20 21:15:59 +02:00