digitalmars.D.learn - cant run unittests
- dom (22/22) Jul 13 2016 how can i run my unittests for a dynamic library? some weird
- ethgeh (5/9) Jul 13 2016 try to put this before the main of your application:
- dom (2/12) Jul 14 2016 as i said my project doesnt contain a main() function
- Seb (4/19) Jul 16 2016 Are you sure? The error message states exactly this. Could you
- Andrew Pennebaker (5/25) Dec 08 2018 I am getting the same error for my projects. I tried prefacing my
- Andre Pany (9/35) Dec 09 2018 It is a quite old thread but the issue is still relevant. In the
how can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. i really love D, but problems like this make me wanna switch :/ using: dub test --arch=x86 lucy ~master: building configuration "__test__library__"... ../../tmp/dub_test_root-0ce1acbf-ecb9-4abf-8199-e7a23bd783dc.d(21,12): Error: function D main conflicts with static import dub_test_root.main at ../../tmp/dub_test_root-0ce1acbf-ecb9-4abf-8199-e7a23bd783dc.d(11,15) dmd failed with exit code 1. dub.json { "name": "lucy", "description": "A minimal D application.", "copyright": "Copyright © 2015, dom", "authors": ["dom"], "targetType": "dynamicLibrary", "dflags": ["-fPIC"], "dependencies": { "msgpack-d": "~>1.0.0-beta.2", "poodinis": "~>6.3.0" } }
Jul 13 2016
On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:how can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...]try to put this before the main of your application: "version(unittest){} else" it looks like the default unittest config implies the switch "-main".
Jul 13 2016
On Thursday, 14 July 2016 at 00:33:50 UTC, ethgeh wrote:On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:as i said my project doesnt contain a main() functionhow can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...]try to put this before the main of your application: "version(unittest){} else" it looks like the default unittest config implies the switch "-main".
Jul 14 2016
On Thursday, 14 July 2016 at 10:13:38 UTC, dom wrote:On Thursday, 14 July 2016 at 00:33:50 UTC, ethgeh wrote:Are you sure? The error message states exactly this. Could you reduce the project to a single file and upload it somewhere (e. g. github).On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:as i said my project doesnt contain a main() functionhow can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...]try to put this before the main of your application: "version(unittest){} else" it looks like the default unittest config implies the switch "-main".
Jul 16 2016
On Saturday, 16 July 2016 at 20:22:15 UTC, Seb wrote:On Thursday, 14 July 2016 at 10:13:38 UTC, dom wrote:I am getting the same error for my projects. I tried prefacing my main functions with the version(unittest) {} else snippet (which we really shouldn't have to do!!!) but anyway that didn't change the behavior of dub test at all.On Thursday, 14 July 2016 at 00:33:50 UTC, ethgeh wrote:Are you sure? The error message states exactly this. Could you reduce the project to a single file and upload it somewhere (e. g. github).On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:as i said my project doesnt contain a main() functionhow can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...]try to put this before the main of your application: "version(unittest){} else" it looks like the default unittest config implies the switch "-main".
Dec 08 2018
On Saturday, 8 December 2018 at 19:25:41 UTC, Andrew Pennebaker wrote:On Saturday, 16 July 2016 at 20:22:15 UTC, Seb wrote:It is a quite old thread but the issue is still relevant. In the first post, there is a dependency to poodinis which defines in the test package a void main function. Maybe main functions in dependencies causing this issue. Which dependencies do you have? Kind regards AndreOn Thursday, 14 July 2016 at 10:13:38 UTC, dom wrote:I am getting the same error for my projects. I tried prefacing my main functions with the version(unittest) {} else snippet (which we really shouldn't have to do!!!) but anyway that didn't change the behavior of dub test at all.On Thursday, 14 July 2016 at 00:33:50 UTC, ethgeh wrote:Are you sure? The error message states exactly this. Could you reduce the project to a single file and upload it somewhere (e. g. github).On Wednesday, 13 July 2016 at 19:41:53 UTC, dom wrote:as i said my project doesnt contain a main() functionhow can i run my unittests for a dynamic library? some weird conflict is reported between main functions, my project doesnt contain any main function. [...]try to put this before the main of your application: "version(unittest){} else" it looks like the default unittest config implies the switch "-main".
Dec 09 2018