adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.

Home Page:http://arsd-official.dpldocs.info/arsd.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cgi.d dual context issue with -unittest

quickfur opened this issue · comments

Due to current D compilers not allowing you to specify which modules -unittest should apply to, I'm forced to compile cgi.d with -unittest. But this leads to this error:

arsd/cgi.d(3886): Deprecation: function `arsd.cgi.__unittest_L499_C1.serve!(handler, Cgi, 5000000L).serve` function requires a dual-context, which is deprecated
arsd/cgi.d(4439):        instantiated from here: `serve!(handler, Cgi, 5000000L)`
arsd/cgi.d(3661):        instantiated from here: `cgiMainImpl!(handler, Cgi, 5000000L)`
arsd/cgi.d(3886): Deprecation: function `arsd.cgi.__unittest_L510_C1.serve!(requestHandler, Cgi, 5000000L).serve` function requires a dual-context, which is deprecated
arsd/cgi.d(543):        instantiated from here: `serve!(requestHandler, Cgi, 5000000L)`
arsd/cgi.d(3886): Error: function `arsd.cgi.__unittest_L510_C1.serve!(requestHandler, Cgi, 5000000L).serve` requires a dual-context, which is not yet supported by LDC

Even though this is currently only a deprecation in the front end, LDC doesn't actually support it: it aborts at codegen. This sux, since I'm forced to use DMD to do unittest builds, and given that dual context is deprecated, I'm not sure how much longer I can rely on this.

the line numbers don't match up anymore, what test is this one?

Around line 510, with the heading:

/++
        Same as the previous example, but written out long-form without the use of [DispatcherMain] nor [GenericMain].
+/
unittest {

The offending line is here:

                // and serve the request(s) according to the compile configuration
                server.serve!(requestHandler)();

oooooh ok, just my newer demos that are never intended to even be run, just syntax checked!

lol...

is there a way to make -unittest skip those? it's just annoying that I have to deal with 3rd party unittest issues when all I want is to unittest my own code. One of these days we should write up a DIP to make -unittest less bogonous...

i use version(Demo) in a lot of places i might do that here

Thanks, man, that would save me lots of headaches.

there that version is up now

Everything works beautifully now, thanks man!!