Commit Graph

74 Commits

Author SHA1 Message Date
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Elliot Haisley 063b74ebba fix msvc not recognising b_ndebug
fixes #7404
2020-07-19 15:26:30 +03:00
Daniel Mensinger 8e60b8c146
test: merge installed_files.txt into test.json 2020-02-25 21:47:42 +01:00
Nirbheek Chauhan c5c0c467fe tests/windows/16: Use pefile module instead of objdump/dumpbin
The pefile module is a CI dependency now, so we can use that instead
of objdump/dumpbin which greatly simplifies the test. Of course, this
module is also cross-platform so it will work if we add cross-win32 CI
at some point.
2020-01-22 19:34:05 +05:30
Sebastien Bacher 82f6790d5c Use python3 in some tests which were still using python
The unversioned command is deprecated and removed from some distributions
2020-01-21 04:26:50 +10:00
Michael Hirsch, Ph.D acee448fb9 ci/test: unused args for Windows 2019-12-04 10:59:40 +02:00
Michael Hirsch, Ph.D 83b4e981c4 Use strict function prototypes 2019-11-18 22:21:36 +02:00
Michael Hirsch, Ph.D 1baa1c9222 use '-Werror=unused-parameter' for gcc/clang on project tests and -fimplicit-none on fortran
Fortran: check for undeclared variables by forcing implicit none everywhere
C/C++: check for unused parameters and return types

removed unused variables from test cases

ci: do missing return and unused arg check with Github Actions
2019-11-17 13:24:42 +02:00
Jakub Adam 9c456e2baf tests: Don't expect any *.pdb files installed in 'lib'
Static libraries don't have PDB files. A PDB that would previously end
up installed alongside a static library belonged in fact to the dynamic
version of the same library built at the same time.

This was because the former minstall.Installer implementation, when
installing a file target, also blindly copied any *.pdb file it found
whose filename was matching the target. So, for example installing
foo.dll and foo.a would also install two copies of foo.pdb into both
bin/ and lib/, which doesn't seem like the right thing to do - foo.pdb
should only get installed with foo.dll.
2019-10-09 15:50:20 +02:00
Marc-André Lureau 341d245e68 Accept vs_module_defs for modules
Like shared libraries, modules may have vs_module_defs.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-07-17 19:19:56 +03:00
ePirat b347f00dc0 Fix windres module argument flattening 2019-07-05 22:20:16 +03:00
Jon Turney 818c1619cc
Testcase for library where the first object is an arch-neutral .res file 2019-01-05 19:39:14 +00:00
Jon Turney 54c680c4ba
Apply work-around for windres bug with msys2 clang also
The windres bug with paths with spaces appears irrespective of compiler
2018-12-09 20:40:29 +00:00
Jon Turney e116b94833
Install modules in a subdir to fit with platform name mangling
Take advantage of fix_platform_name's new tricks in test '122 shared
module'
2018-11-06 13:19:47 +00:00
Jon Turney 075168d492
Handle only llvm-objdump being available
llvm-objdump currently doesn't appear to output the Windows subsystem, so
that part of the test needs to be skipped.
2018-11-04 15:42:06 +00:00
Jussi Pakkanen c4a9f59dc4 Move VS C++17 test to a unit test since it requires env setup. 2018-10-24 17:19:36 +03:00
Nicole Mazzuca f1546e289c add cpp_std support for MSVC 2018-10-22 19:14:00 +03:00
Marco Trevisan (Treviño) 81e7a0981b run_project_tests: remove pdb workaround, just use filters
And ignore .dll.a files in non cygwin gcc instances
2018-09-14 20:19:35 +02:00
Marco Trevisan (Treviño) b484f2ae22 test cases: add missing files to installed_files.txt
All these are marked as files to be installed, so we need list them.
2018-09-14 08:45:48 +02:00
Jussi Pakkanen 19617f8661
Merge pull request #4036 from jon-turney/fix_issue_3999
Fix compiling multiple Windows resources using pathnames with non-unique basenames
2018-08-21 00:56:10 +03:00
Jussi Pakkanen 972535a6ac Condense test dirs. 2018-08-19 12:39:46 +03:00
Jon Turney 2a3cd335fd
Extend test case to cover issue #3999
Extend test case for issue #3575 for Windows resource files with the same
name to cover the case where duplicate outputs exist due to use of
pathnames.

Also Test using file objects as well as literal filenames
2018-08-16 20:34:37 +01:00
Jon Turney 67c8f532c6 Extend test to check subsystem set by executable(gui_app:) 2018-08-15 06:17:58 -07:00
Jon Turney 399f8553b7 Add a test for Windows console application with main function in a library
Currently, this test fails for ninja/VisualC, as we don't pass
/SUBSYSTEM:CONSOLE to the linker, and it guesses wrongly that this is a GUI
app

https://lists.freedesktop.org/archives/mesa-dev/2018-June/197844.html
2018-08-15 06:17:58 -07:00
Jussi Pakkanen 17bfbb99e5 Condense test dirs. 2018-07-31 19:22:24 +03:00
Jon Turney 09c03a409b Test windows.compile_resource() when depends: is a custom_target
This test covers the case where the resource script references a file which
is created by a custom_target (in this case, an icon).

Put icon in a separate directory to ensure we excercise setting the include
path to the directory which contains it.
2018-06-18 10:52:21 +00:00
Jussi Pakkanen 8014a42f57
Merge pull request #3715 from jon-turney/duplicate-rsrc-script-name
Use a unique name for windows resource compilation custom target
2018-06-17 17:28:09 +03:00
Jon Turney 4bc6b68bae Also test that the resource has the expected contents 2018-06-11 11:49:12 +01:00
Jon Turney 80ce5e0817 Test for Windows resource compilation reusing the same script name
Extended from the test case in #3575.

This exercises File objects and string filenames for the same resource
script filename at different paths.
2018-06-07 22:52:22 +01:00
Jon Turney e9462ce206 Install shared_module implibs
On Windows, if we are going to link with a shared module, we need the
implib.

Use case: The Xorg server builds some X protocol extensions as modules.  The
implibs for these modules need to be shipped as part of the SDK, to enable
building of 3rd party extensions which reference symbols in (and hence on
Windows, need to be linked with) these modules.
2018-06-07 12:57:39 +00:00
Jon Turney ac480c1857 Extend test_rc_depends_files test case
Extend test_rc_depends_files test case to also cover depfile generation for
a resource file generated by a custom_target
2018-06-03 21:06:23 +00:00
Jon Turney 7a15214a69 Have the windows.resource_compiler() preprocesor write a depfile
When using binutils's windres, we can instruct it to invoke the preprocessor
in such a way that it writes a depfile, so that dependencies on #included
files are automatically tracked.

Not implemented for MSVC tools, so skip testing it in that case.
2018-06-03 21:06:23 +00:00
Jon Turney d78fa6ffe3 Install implib where expected if default install_dir: is explicitly given
Install the implib into the default import lib directory if an explicit
install_dir: is given, but the value happens to be the same as the default.
2018-06-03 20:57:03 +00:00
Mathieu Duponchelle 9e7b0dd704 test extra paths: move test to windows 2018-06-02 11:42:48 +00:00
Jon Turney aa27f7cec9 Add a depend_files: keyword to windows.compile_resources()
Expose depend_files: from the custom_target this creates.

This is the change suggested in #2815, with tests and documentation added.

Fixes #2789 (duplicate #2830)
2018-06-01 20:21:09 +00:00
Andrei Alexeyev 46f5d7a31c
Fix test cases/windows/13 resources with custom targets
Analogous to #2851
2018-01-12 23:40:11 +02:00
Andrei Alexeyev f8bd1c5ff2
windows.compile_resources: fix compiling multiple resources within one project 2018-01-12 23:36:48 +02:00
Andrei Alexeyev ef7cb9f280
[windows] make compile_resources use custom targets instead of generators 2018-01-12 23:36:48 +02:00
Jon Turney 500c39cb07 Fix test cases/windows/5 resources
Currently, this test only tries to load a predefined icon, so the resource
compilation and linking can be completely removed from the meson.build and
it still passes.

Change to try to load the icon contained in the resources we compile.
2017-12-31 19:11:34 +02:00
Jon Turney 8f859a5105 Make the name of the executable implib configurable 2017-07-20 21:11:56 +01:00
Jon Turney 3110c209f7 Consolidate windows tests which are divided between mingw and msvc 2017-07-20 21:11:56 +01:00
Jon Turney 3fa3922cea Support implibs for executables on Windows
Add a boolean 'implib' kwarg to executable().  If true, it is permitted to
use the returned build target object in link_with:

On platforms where this makes sense (e.g. Windows), an implib is generated
for the executable and used when linking.  Otherwise, it has no effect.

(Rather than checking if it is a StaticLibrary or SharedLibary, BuildTarget
subclasses gain the is_linkable_target method to test if they can appear in
link_with:)

Also install any executable implib in a similar way to a shared library
implib, i.e. placing the implib in the appropriate place

Add tests of:
- a shared_module containing a reference to a symbol which is known (at link
time) to be provided by the executable
- trying to link with non-implib executables (should fail)
- installing the implib

(This last one needs a little enhancement of the installed file checking as
this is the first install test we have which needs to work with either
MSVC-style or GCC-style implib filenames)
2017-07-20 21:11:56 +01:00
Jon Turney 56efd2211f Consistently use windows.h, not Windows.h
This is significant when compiling using gcc on a case-sensitive filesystem.
2017-06-21 04:39:41 -04:00
Jon Turney 66a6ea984b Allow vs_module_defs to use a custom_target
Allow vs_module_defs to use a custom_target
Add a test and update documentation
2017-05-16 19:56:32 +01:00
Jon Turney e99cfdfbc7 Make vs_module_defs: do something for gcc on Windows as well
Module definition files may be useful when building with gcc on Windows also
(e.g. if the existing build uses them, if exports are aliased, if we were
retro enough to export by ordinal, etc.)

Add the .def file to the link command line when using gcc on Windows

Run the appropriate windows tests irrespective of compiler.
2017-05-12 18:56:43 +03:00
Dylan Baker c49f5aefd8 Allow using generated files to shared_library vs_module_defs. Closes #1605
This detects and allows passing a generated file as a vs_module_def, it
also adds a testcase that tests using configure_file to generate the
.def file.
2017-04-10 15:43:17 -07:00
Nirbheek Chauhan fd030a1efd tests/windows/7: Fix test on Cygwin
Not sure how this was missed.
2017-04-10 05:02:08 +05:30
Jussi Pakkanen 1652dccea2 Merge pull request #1469 from centricular/install-secondary-outputs
Support multiple install dirs for built/custom targets
2017-04-09 21:57:46 +03:00
Jon Turney 6c9260c47f Run test cases/windows/ tests on Cygwin
Also, always run 'test cases/windows/5 resources' on Cygwin since it can
handle args containing spaces correctly.
2017-04-06 22:48:02 +01:00