Repository: numpy/numpy

Issue:
TST: gcov missing a few files in report
@pv correctly [notes](https://github.com/numpy/numpy/pull/11610#issuecomment-414165114) that a few C source files are missing from our coverage report.

Digging through a recent [master branch build log](https://travis-ci.org/numpy/numpy/jobs/418332536), I can see some "warning" style output for `gcov` of this nature:

```
./_configtest.gcda:stamp mismatch with notes file
./build/temp.linux-x86_64-3.6/numpy/core/src/dummymodule.gcda:cannot open data file, assuming not executed
./build/temp.linux-x86_64-3.6/numpy/core/src/private/mem_overlap.gcda:stamp mismatch with notes file
./build/temp.linux-x86_64-3.6/numpy/core/src/private/npy_longdouble.gcda:stamp mismatch with notes file
./build/temp.linux-x86_64-3.6/numpy/core/src/private/ufunc_override.gcda:stamp mismatch with notes file
./empty/_configtest.gcda:cannot open data file, assuming not executed
```

Possible solutions to this issue [have been discussed elsewhere](https://stackoverflow.com/a/30031809/2942522) & appear related to build / machine time stamps relative to tests.

When I test locally, this is not reproduced; my current idea is to first open a PR that tries one of the simpler solutions -- i.e., using `find` to recursively touch the generated `*.gcda` files. I'll first see if I can reproduce the issue locally by touching the `*.c` and `*.gcno` files before running `gcov` recursively so that the timestamps are messed up. It looks like one user reports that [`touch` may not suffice](https://stackoverflow.com/questions/27276155/gcov-generates-empty-coverage-for-c#comment53743033_30031809) because the timestamp is actually embedded in the `gcda` files -- I'll have to check this.


Discussion:
Maybe it's related to the fact that some files are compiled twice (included both in umath and multiarray).
If so, gh-10915 should fix it.
The issue for `npy_longdouble` and `ufunc_override` is apparently resolved by that PR, but `mem_overlap` problem persists even after that refactor.
Redundant include / compilations does seem likely given the partial resolution above though, so that's a hint I can perhaps use to track this down.
`mem_overlap.c` appears in two places in `numpy/core/setup.py`, in the merged `_multiarray_umath` and in `_multiarray_tests`
Yeah, I noticed that
Ok, proposed a fix that works locally in that PR for `mem_overlap`

Resolving patch:
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -709,6 +709,17 @@ def get_mathlib_info(*args):
                        sources=npysort_sources,
                        include_dirs=[])
 
+    #######################################################################
+    #                     multiarray_tests module                         #
+    #######################################################################
+
+    config.add_extension('_multiarray_tests',
+                    sources=[join('src', 'multiarray', '_multiarray_tests.c.src'),
+                             join('src', 'common', 'mem_overlap.c')],
+                    depends=[join('src', 'common', 'mem_overlap.h'),
+                             join('src', 'common', 'npy_extint128.h')],
+                    libraries=['npymath'])
+
     #######################################################################
     #             _multiarray_umath module - common part                  #
     #######################################################################
@@ -933,16 +944,6 @@ def generate_umath_c(ext, build_dir):
     config.add_extension('_struct_ufunc_tests',
                     sources=[join('src', 'umath', '_struct_ufunc_tests.c.src')])
 
-    #######################################################################
-    #                     multiarray_tests module                         #
-    #######################################################################
-
-    config.add_extension('_multiarray_tests',
-                    sources=[join('src', 'multiarray', '_multiarray_tests.c.src'),
-                             join('src', 'common', 'mem_overlap.c')],
-                    depends=[join('src', 'common', 'mem_overlap.h'),
-                             join('src', 'common', 'npy_extint128.h')],
-                    libraries=['npymath'])
 
     #######################################################################
     #                        operand_flag_tests module                    #


Test patch: