[Bug 199] New: unittests not linked unless module is imported

via D.gnu d.gnu at puremagic.com
Mon Sep 21 03:29:04 PDT 2015


            Bug ID: 199
           Summary: unittests not linked unless module is imported
           Product: GDC
           Version: 4.9.x
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw at gdcproject.org
          Reporter: alex at sunopti.com

I have a build system that makes a static library with a bunch of code, and
then links it into several executables.

If I add a new module with unittest{ } section and compile it into the static
library, the unittests are not run by any of the executables unless the module
is referenced somewhere.

All compiled with -funittest switch.

I suspect this is behaviour gdc has inherited from the linker.

gdc should probably force all modules with unittests to be linked in.

This should be a supported development path: write code, test it, integrate it.
Because the code is compiled etc, it can take some time to figure out that the
tests are not being run, and it is not obvious why.

You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150921/6876d155/attachment.html>

More information about the D.gnu mailing list