Stuck with DMD, and Unit-Threaded

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 17 01:08:49 PDT 2017


On Sun, 2017-04-16 at 12:04 +0300, drug via Digitalmars-d-learn wrote:
> 
[…]
> Try to add version for `integrationtest` to exclude `main` from
> building 
> like you did with unittests version. In dub.sdl add versions 
> "integrationtests" for correspondence configuration and in 
> `source\main.d` add something like that:

I believe that dub test will set unittest, that integrationtests is not
set as a version symbol. Indeed experiments with ldc2 seem to indicate
that "else version(…)" doesn't seem to work.
  
> ```
> ...
> unittest {
> 		 auto item = getValue!(Tuple!(string, string));
> 		 assert(debianPackageNumberLessThan(item[0], item[1]),
> format("[%s, 
> %s]", item[0], item[1]));
> 	 }
> 
> }
> else version(integrationtests){
> 	// do something here
> }
> else {
> 	int main(string[] args) {
> ...
> ```
> It works for me. But frankly I failed to reproduce your error - I
> have 
> other one like
> ```
> ut_main.d(5,5): Error: only one main allowed. Previously found main
> at 
> source/main.d(161,6)
> dmd failed with exit code 1.
> ```
> so very probably I fix wrong problem

Are you on a different platform/compiler combination and so just
getting different views on the same problem. I am on Fedora Rawhide
with ldc2 from packaging. D 2.071 I think.

I'll try Debian where I have dmd (oh that doesn't work for other
reasons as yet uninvestigated), ldc2 (same version as Fedora I believe,
so should not be different), and gdc (but I think I am using D features
not supported yet there, but I will check).

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20170417/726bcb03/attachment.sig>


More information about the Digitalmars-d-learn mailing list