May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Mon, 20 May 2013 22:46:42 -0400, Timothee Cour <thelastmammoth@gmail.com> wrote:
> On Mon, May 20, 2013 at 6:52 PM, Nick Sabalausky <
> SeeWebsiteToContactMe@semitwist.com> wrote:
>
>> Y'know what we need? This compiler flag:
>>
>> -unittest=pagkage.name.*
>>
>
> I would like that as well.
>
> Here's a workaround in the meantime:
> dmd -c -unittest a;
> dmd -c b;
> dmd -oftest -main -unittest *.o
> ./test => will only run unittest of a, not b.
This does not work if b is made of templates.
-Steve
|
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Mon, 20 May 2013 21:52:51 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > So alright...Who's with me?!!! "Yeaaaa......!!!!!" (<-- Belushi running > out the door) > I think we can handle this without compiler help. The runtime is responsible for running unit tests. It actually provides a hook to allow you to override the unit tests. See here: http://dlang.org/phobos/core_runtime.html#.Runtime.moduleUnitTester (set in a shared static ctor). All you have to do is just run the module's unit tests you desire. I would argue the "stock" unit test runner could be configured by an environment variable to be able to run/exclude whatever you want. This is eminently fixable in the library with a small pull request. -Steve |
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 2013-05-21 03:52, Nick Sabalausky wrote: > Y'know what we need? This compiler flag: > > -unittest=pagkage.name.* That exact syntax will probably cause some problems with the shell. -- /Jacob Carlborg |
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Tue, 21 May 2013 19:02:19 +0200
Jacob Carlborg <doob@me.com> wrote:
> On 2013-05-21 03:52, Nick Sabalausky wrote:
> > Y'know what we need? This compiler flag:
> >
> > -unittest=pagkage.name.*
>
> That exact syntax will probably cause some problems with the shell.
>
Ugh, yea, that's right. I love the unix shell, but I'm convinced that having the shell expand globs was a colossal mistake.
|
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Tue, 21 May 2013 12:23:01 -0400 "Steven Schveighoffer" <schveiguy@yahoo.com> wrote: > On Mon, 20 May 2013 21:52:51 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > > > So alright...Who's with me?!!! "Yeaaaa......!!!!!" (<-- Belushi > > running out the door) > > > > I think we can handle this without compiler help. > > The runtime is responsible for running unit tests. > > It actually provides a hook to allow you to override the unit tests. See here: http://dlang.org/phobos/core_runtime.html#.Runtime.moduleUnitTester (set in a shared static ctor). All you have to do is just run the module's unit tests you desire. > Neat, I had no idea. > I would argue the "stock" unit test runner could be configured by an environment variable to be able to run/exclude whatever you want. This is eminently fixable in the library with a small pull request. > I think that definitely sounds like the way to go. |
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 2013-05-21 20:34, Nick Sabalausky wrote: > Ugh, yea, that's right. I love the unix shell, but I'm convinced that > having the shell expand globs was a colossal mistake. I think it's mostly very handy. -- /Jacob Carlborg |
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Tue, 21 May 2013 14:34:37 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > On Tue, 21 May 2013 19:02:19 +0200 > Jacob Carlborg <doob@me.com> wrote: > >> On 2013-05-21 03:52, Nick Sabalausky wrote: >> > Y'know what we need? This compiler flag: >> > >> > -unittest=pagkage.name.* >> >> That exact syntax will probably cause some problems with the shell. >> > > Ugh, yea, that's right. I love the unix shell, but I'm convinced that > having the shell expand globs was a colossal mistake. Fully disagree! For free, every single command line application, including custom ones, handles expansion in exactly the same way. Compare to windows command line... -Steve |
May 21, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 5/21/13, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > Y'know what we need? This compiler flag: > > -unittest=pagkage.name.* FWIW I work around this by implementing the unit test runner function. I've mentioned this here: http://www.reddit.com/r/programming/comments/1edih2/dconf_2013_day_1_talk_4_writing_testable_code_in/c9zg3ry |
May 22, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky Attachments:
| it's only module level granularity. I agree that a library solution is the way to go, however there needs to be a way to have finer granularity, ie being able to call individual unittests. I gave the reasons in the 2nd post in this thread. Syntax would be: unittest(test_fun){...} having a short syntax such as this will make people use it. digressing, I wish there would be a simple non-anonymous way to vote for such features, to see whether most people agree/disagree. It's easier than voting by email, which invariably gets lost in digressions (as I'm doing here). On Tue, May 21, 2013 at 11:36 AM, Nick Sabalausky < SeeWebsiteToContactMe@semitwist.com> wrote: > On Tue, 21 May 2013 12:23:01 -0400 > "Steven Schveighoffer" <schveiguy@yahoo.com> wrote: > > > On Mon, 20 May 2013 21:52:51 -0400, Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > > > > > So alright...Who's with me?!!! "Yeaaaa......!!!!!" (<-- Belushi > > > running out the door) > > > > > > > I think we can handle this without compiler help. > > > > The runtime is responsible for running unit tests. > > > > It actually provides a hook to allow you to override the unit tests. See here: http://dlang.org/phobos/core_runtime.html#.Runtime.moduleUnitTester (set in a shared static ctor). All you have to do is just run the module's unit tests you desire. > > > > Neat, I had no idea. > > > I would argue the "stock" unit test runner could be configured by an environment variable to be able to run/exclude whatever you want. This is eminently fixable in the library with a small pull request. > > > > I think that definitely sounds like the way to go. > > |
May 22, 2013 Re: External lib unittests: they're killin me! | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Wed, 22 May 2013 10:06:46 -0700 Timothee Cour <thelastmammoth@gmail.com> wrote: > it's only module level granularity. > > I agree that a library solution is the way to go, however there needs > to be a way to have finer granularity, ie being able to call > individual unittests. I gave the reasons in the 2nd post in this > thread. Syntax would be: unittest(test_fun){...} > having a short syntax such as this will make people use it. > > digressing, I wish there would be a simple non-anonymous way to vote for such features, to see whether most people agree/disagree. It's easier than voting by email, which invariably gets lost in digressions (as I'm doing here). > Bugzilla has a voting system <http://d.puremagic.com/issues/>. Every user has up to 10 votes to place on whatever tickets they want. |
Copyright © 1999-2021 by the D Language Foundation