Re: Named unittests

2015-04-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-02 22:31, Dicebot wrote: I don't think anyone is going to put those in a same inline style as unittest blocks, so this is not truly relevant. At least I hope so. You mean inline with the code it tests? No, I hope so too. I put my unit tests in separate files as well, but that's

Re: Named unittests

2015-04-02 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-01 21:16, Dicebot wrote: This is fixed by having smaller modules. If test for a single module takes more than few blinks of an eye, something is wrong already. For unit tests, yes. But there are other kinds of tests as well. Integration, functional, user acceptance test and so on.

Re: Named unittests

2015-04-02 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-01 20:49, Idan Arye wrote: So now we just need a way to keep a line number unmodified when you add lines above it... I'm not sure what kind of tools you have in mind. * Print a link which points back to a failing test, requires file and line information * Running a specific

Re: Named unittests

2015-04-02 Thread krzaq via Digitalmars-d
On Tuesday, 31 March 2015 at 21:24:20 UTC, Dicebot wrote: I see no value in test names limited to valid identifiers. It is only tiny bit more informative than `unittestXXX` we have already. If we add names, please, let them be proper names that are easy to read. I'd rather have the name obey

Re: Named unittests

2015-04-02 Thread Dicebot via Digitalmars-d
On Thursday, 2 April 2015 at 06:21:53 UTC, Jacob Carlborg wrote: On 2015-04-01 21:16, Dicebot wrote: This is fixed by having smaller modules. If test for a single module takes more than few blinks of an eye, something is wrong already. For unit tests, yes. But there are other kinds of tests

Re: Named unittests

2015-04-01 Thread Atila Neves via Digitalmars-d
On Tuesday, 31 March 2015 at 23:53:29 UTC, Andrei Alexandrescu wrote: On 3/31/15 4:38 PM, Martin Nowak wrote: On 04/01/2015 01:11 AM, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want to work on that? -- Andrei In any

Re: Named unittests

2015-04-01 Thread Idan Arye via Digitalmars-d
On Wednesday, 1 April 2015 at 04:42:33 UTC, Shammah Chancellor wrote: I can possibly help with a DIP, but it seems like a very straightforward request? -Shammah Considering the heated debate going on here, I'd say it's not as straightforward as it seems...

Re: Named unittests

2015-04-01 Thread Robert burner Schadek via Digitalmars-d
I have PR https://github.com/D-Programming-Language/phobos/pull/2995 open since October 2014. it includes: * extensible haskell like quickcheck * benchmarking with names and record keeping to see progress * offline tool to plot benchmark results with gnuplot * most std.string functions already

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 23:08, Idan Arye wrote: Limiting unittest names to legal identifiers will save a lot of headache when we set our tools to actually use these names. Matching a legal identifier in a text stream is much easier than matching an arbitrary unicode string, even if that string is

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 11:08, Johannes Pfau wrote: But here's the problem: 1) The compile time approach requires some kind of explicit registration of the unittests. At least one mixin per module. 2) This mixin will usually provide a module constructor. But using module constructors will

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 23:14, Idan Arye wrote: Building by unittest name! Imagine - instead of placing temporary code in `main` to develop a new feature or fix a bug, you put in a named unittest and tell your IDE/build-system to only build that unittest(and whatever code needed for it to run). You

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-01 00:02, Idan Arye wrote: I think you and I work under different assumptions of the goals for this feature. If we only want unittest names to be something that can be printed when the unittest runner runs the unittests, than a UDA with a string is indeed preferable. If we want

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 15:31, Dicebot wrote: Most powerful solution would be to simply put attributes for unittest blocks in runtime information for tests (using RTTI it should be possible to define such variadic structure in similar manner as D-style variadic function arguments). I think the most

Re: Named unittests

2015-04-01 Thread Andrei Alexandrescu via Digitalmars-d
On 4/1/15 12:46 AM, Atila Neves wrote: On Tuesday, 31 March 2015 at 23:53:29 UTC, Andrei Alexandrescu wrote: On 3/31/15 4:38 PM, Martin Nowak wrote: On 04/01/2015 01:11 AM, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want

Re: Named unittests

2015-04-01 Thread Idan Arye via Digitalmars-d
On Wednesday, 1 April 2015 at 14:05:46 UTC, Jacob Carlborg wrote: On 2015-03-31 23:14, Idan Arye wrote: Building by unittest name! Imagine - instead of placing temporary code in `main` to develop a new feature or fix a bug, you put in a named unittest and tell your IDE/build-system to only

Re: Named unittests

2015-04-01 Thread Idan Arye via Digitalmars-d
On Wednesday, 1 April 2015 at 14:07:14 UTC, Jacob Carlborg wrote: On 2015-04-01 00:02, Idan Arye wrote: I think you and I work under different assumptions of the goals for this feature. If we only want unittest names to be something that can be printed when the unittest runner runs the

Re: Named unittests

2015-04-01 Thread Dicebot via Digitalmars-d
On Wednesday, 1 April 2015 at 18:35:14 UTC, Idan Arye wrote: The problem is not with running the tests, it's with building them. In heavily templated libraries(like, for example Phobos), building without unittests takes seconds and building with unitetests takes minutes - mainly because the

Re: Named unittests

2015-04-01 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-01 20:35, Idan Arye wrote: If we could tell the compiler to only build a single, specific test the development cycle can become orders of magnitude faster. There should be a lot of option to run tests: * Base on a file * Line number * Name * Tag And so on. -- /Jacob Carlborg

Re: Named unittests

2015-03-31 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-30 23:52, Andrei Alexandrescu wrote: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given unittest fails several times

Re: Named unittests

2015-03-31 Thread tcak via Digitalmars-d
On Monday, 30 March 2015 at 21:57:33 UTC, Andrei Alexandrescu wrote: On 3/30/15 2:55 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? With attributes? That might be palatable but only as a standard solution.

Re: Named unittests

2015-03-31 Thread ezneh via Digitalmars-d
On Monday, 30 March 2015 at 21:52:35 UTC, Andrei Alexandrescu wrote: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given

Re: Named unittests

2015-03-31 Thread Johannes Pfau via Digitalmars-d
Am Mon, 30 Mar 2015 14:52:36 -0700 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: We're having a strong need for named unittests at Facebook for multiple reasons. As there have already been suggestions to use UDAs I think we should discuss the fundamental difficulty

Re: Named unittests

2015-03-31 Thread Idan Arye via Digitalmars-d
I understand the preference to librarize as much as possible, but I don't think the desire to sacrifice every possible bit of convenience to avoid the tiniest changes to the language is always beneficial. I don't say that implementing everything inside the compiler is good either though, but

Re: Named unittests

2015-03-31 Thread w0rp via Digitalmars-d
On Tuesday, 31 March 2015 at 12:33:31 UTC, Steven Schveighoffer wrote: On 3/30/15 5:58 PM, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` Yes, this is one of the benefits I touted 2 years ago when I asked for

Re: Named unittests

2015-03-31 Thread w0rp via Digitalmars-d
On Tuesday, 31 March 2015 at 11:39:02 UTC, tcak wrote: On Monday, 30 March 2015 at 21:57:33 UTC, Andrei Alexandrescu wrote: On 3/30/15 2:55 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? With attributes? That

Re: Named unittests

2015-03-31 Thread tcak via Digitalmars-d
On Tuesday, 31 March 2015 at 12:10:15 UTC, w0rp wrote: On Tuesday, 31 March 2015 at 11:39:02 UTC, tcak wrote: On Monday, 30 March 2015 at 21:57:33 UTC, Andrei Alexandrescu wrote: On 3/30/15 2:55 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you

Re: Named unittests

2015-03-31 Thread Steven Schveighoffer via Digitalmars-d
On 3/30/15 5:58 PM, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` Yes, this is one of the benefits I touted 2 years ago when I asked for module RTInfo -- we can use this information in the runtime to

Re: Named unittests

2015-03-31 Thread Shammah Chancellor via Digitalmars-d
On 2015-03-30 21:52:36 +, Andrei Alexandrescu said: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given unittest fails

Re: Named unittests

2015-03-31 Thread deadalnix via Digitalmars-d
On Tuesday, 31 March 2015 at 23:11:46 UTC, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want to work on that? -- Andrei If nobody picks it up, I can, but I have very little bandwidth right now with the work involved on

Re: Named unittests

2015-03-31 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, March 31, 2015 14:45:49 Idan Arye via Digitalmars-d wrote: But unittests already have names(http://dpaste.dzfl.pl/b15e94000f15), so the only required change is to allow the user to specify that name. This should be much simpler than adding entirely new fields. Exactly what I was

Re: Named unittests

2015-03-31 Thread deadalnix via Digitalmars-d
On Tuesday, 31 March 2015 at 23:29:28 UTC, Martin Nowak wrote: On 04/01/2015 12:58 AM, deadalnix wrote: So now we are going to change the language for this ? There is a natural name for unitests, the name of the module. We have way to break module into pieces in a backward compatible manner

Re: Named unittests

2015-03-31 Thread Panke via Digitalmars-d
We need template to use compile time reflection. Please don't make it all compile time. It is useful to register tests at runtime as well. Like one tests per SAT instance in a given SAT benchmark. Practically only thing we need is a standard way to register a test function as a unittest

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 5:58 PM, deadalnix wrote: On Tuesday, 31 March 2015 at 23:11:46 UTC, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want to work on that? -- Andrei If nobody picks it up, I can, but I have very little bandwidth

Re: Named unittests

2015-03-31 Thread Meta via Digitalmars-d
On Monday, 30 March 2015 at 21:58:13 UTC, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` Aren't unittest blocks just special functions? If that's the case, there should be no problem being able to give them

Re: Named unittests

2015-03-31 Thread Johannes Pfau via Digitalmars-d
Am Tue, 31 Mar 2015 13:31:58 + schrieb Dicebot pub...@dicebot.lv: But here's the problem: 1) The compile time approach requires some kind of explicit registration of the unittests. At least one mixin per module. 2) This mixin will usually provide a module constructor. But

Re: Named unittests

2015-03-31 Thread Johannes Pfau via Digitalmars-d
Am Tue, 31 Mar 2015 13:31:58 + schrieb Dicebot pub...@dicebot.lv: On Tuesday, 31 March 2015 at 09:08:47 UTC, Johannes Pfau wrote: Am Mon, 30 Mar 2015 14:52:36 -0700 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: We're having a strong need for named unittests at Facebook

Re: Named unittests

2015-03-31 Thread Dicebot via Digitalmars-d
: We're having a strong need for named unittests at Facebook for multiple reasons. Right now the default implementation works by putting pointers to a test function into ModuleInfo. We could instead add arrays of some 'unittest information' struct to ModuleInfo to support names etc

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 7:55 AM, Meta wrote: On Monday, 30 March 2015 at 21:58:13 UTC, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` Aren't unittest blocks just special functions? If that's the case, there should be no

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 7:45 AM, Idan Arye wrote: On Tuesday, 31 March 2015 at 13:34:24 UTC, Dicebot wrote: On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote: I understand the preference to librarize as much as possible, but I don't think the desire to sacrifice every possible bit of convenience

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 1:04 PM, Jacob Carlborg wrote: On 2015-03-31 16:55, Meta wrote: Aren't unittest blocks just special functions? If that's the case, there should be no problem being able to give them names. It seems to me that it would entail the lifting of a restriction rather than a real language

Re: Named unittests

2015-03-31 Thread Idan Arye via Digitalmars-d
On Tuesday, 31 March 2015 at 13:34:24 UTC, Dicebot wrote: On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote: I understand the preference to librarize as much as possible, but I don't think the desire to sacrifice every possible bit of convenience to avoid the tiniest changes to the

Re: Named unittests

2015-03-31 Thread Idan Arye via Digitalmars-d
On Tuesday, 31 March 2015 at 20:04:01 UTC, Jacob Carlborg wrote: On 2015-03-31 16:55, Meta wrote: Aren't unittest blocks just special functions? If that's the case, there should be no problem being able to give them names. It seems to me that it would entail the lifting of a restriction

Re: Named unittests

2015-03-31 Thread Xavier Bigand via Digitalmars-d
Le 31/03/2015 20:21, Andrei Alexandrescu a écrit : On 3/31/15 7:45 AM, Idan Arye wrote: On Tuesday, 31 March 2015 at 13:34:24 UTC, Dicebot wrote: On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote: I understand the preference to librarize as much as possible, but I don't think the

Re: Named unittests

2015-03-31 Thread Idan Arye via Digitalmars-d
On Tuesday, 31 March 2015 at 21:05:40 UTC, Xavier Bigand wrote: Le 31/03/2015 20:21, Andrei Alexandrescu a écrit : On 3/31/15 7:45 AM, Idan Arye wrote: On Tuesday, 31 March 2015 at 13:34:24 UTC, Dicebot wrote: On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote: I understand the

Re: Named unittests

2015-03-31 Thread Atila Neves via Digitalmars-d
UTC, Andrei Alexandrescu wrote: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given unittest fails several times across several

Re: Named unittests

2015-03-31 Thread Steven Schveighoffer via Digitalmars-d
On 3/31/15 9:05 AM, w0rp wrote: On Tuesday, 31 March 2015 at 12:33:31 UTC, Steven Schveighoffer wrote: On 3/30/15 5:58 PM, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` Yes, this is one of the benefits I

Re: Named unittests

2015-03-31 Thread Dicebot via Digitalmars-d
On Tuesday, 31 March 2015 at 09:08:47 UTC, Johannes Pfau wrote: Am Mon, 30 Mar 2015 14:52:36 -0700 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: We're having a strong need for named unittests at Facebook for multiple reasons. Right now the default implementation works by putting

Re: Named unittests

2015-03-31 Thread Dicebot via Digitalmars-d
On Tuesday, 31 March 2015 at 10:25:57 UTC, Idan Arye wrote: I understand the preference to librarize as much as possible, but I don't think the desire to sacrifice every possible bit of convenience to avoid the tiniest changes to the language is always beneficial. I don't say that implementing

Re: Named unittests

2015-03-31 Thread Steven Schveighoffer via Digitalmars-d
On 3/31/15 9:28 AM, Steven Schveighoffer wrote: On 3/31/15 9:05 AM, w0rp wrote: On Tuesday, 31 March 2015 at 12:33:31 UTC, Steven Schveighoffer wrote: On 3/30/15 5:58 PM, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something)

Re: Named unittests

2015-03-31 Thread Martin Nowak via Digitalmars-d
On 03/31/2015 04:45 PM, Idan Arye wrote: But unittests already have names(http://dpaste.dzfl.pl/b15e94000f15), so the only required change is to allow the user to specify that name. This should be much simpler than adding entirely new fields. That's the line number, which can't be used as

Re: Named unittests

2015-03-31 Thread Martin Nowak via Digitalmars-d
On 04/01/2015 12:58 AM, deadalnix wrote: So now we are going to change the language for this ? There is a natural name for unitests, the name of the module. We have way to break module into pieces in a backward compatible manner now, so it's all good. Are you saying one should split off

Re: Named unittests

2015-03-31 Thread Martin Nowak via Digitalmars-d
On 04/01/2015 01:11 AM, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want to work on that? -- Andrei In any case you should talk to Atila Neves who wrote a really good unittest library.

Re: Named unittests

2015-03-31 Thread Martin Nowak via Digitalmars-d
On 03/31/2015 11:01 PM, Atila Neves wrote: This is true, but importing modules by name can be code that is generated. Which is exactly what I do with dtest [1] and unit-threaded [2]. It's not that big of a deal when it's part of the build system. Dub does it as well (dub test), because if you

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 4:38 PM, Martin Nowak wrote: On 04/01/2015 01:11 AM, Andrei Alexandrescu wrote: The reasonable course is to see how far we can get with a library-only solution. Amaury, want to work on that? -- Andrei In any case you should talk to Atila Neves who wrote a really good unittest

Re: Named unittests

2015-03-31 Thread Idan Arye via Digitalmars-d
On Tuesday, 31 March 2015 at 21:22:09 UTC, Dicebot wrote: On Tuesday, 31 March 2015 at 14:45:50 UTC, Idan Arye wrote: But unittests already have names(http://dpaste.dzfl.pl/b15e94000f15), so the only required change is to allow the user to specify that name. This should be much simpler than

Re: Named unittests

2015-03-31 Thread Dicebot via Digitalmars-d
On Tuesday, 31 March 2015 at 20:18:41 UTC, Andrei Alexandrescu wrote: On 3/31/15 1:04 PM, Jacob Carlborg wrote: On 2015-03-31 16:55, Meta wrote: Aren't unittest blocks just special functions? If that's the case, there should be no problem being able to give them names. It seems to me that it

Re: Named unittests

2015-03-31 Thread Dicebot via Digitalmars-d
On Tuesday, 31 March 2015 at 14:45:50 UTC, Idan Arye wrote: But unittests already have names(http://dpaste.dzfl.pl/b15e94000f15), so the only required change is to allow the user to specify that name. This should be much simpler than adding entirely new fields. And does not really help. Of

Re: Named unittests

2015-03-31 Thread Martin Nowak via Digitalmars-d
On 03/30/2015 11:52 PM, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Why a DIP, isn't the only question what syntax to use. unittest (myname) vs. unittest (mynameexpression) Andrei There is an ER and an half of an implementation. https

Re: Named unittests

2015-03-31 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 16:55, Meta wrote: Aren't unittest blocks just special functions? If that's the case, there should be no problem being able to give them names. It seems to me that it would entail the lifting of a restriction rather than a real language change. Before: unittest { assert(1 ==

Re: Named unittests

2015-03-31 Thread Atila Neves via Digitalmars-d
On Tuesday, 31 March 2015 at 14:13:29 UTC, Johannes Pfau wrote: Am Tue, 31 Mar 2015 13:31:58 + schrieb Dicebot pub...@dicebot.lv: But here's the problem: 1) The compile time approach requires some kind of explicit registration of the unittests. At least one mixin per module.

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 2:50 PM, Martin Nowak wrote: On 03/30/2015 11:52 PM, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Why a DIP, isn't the only question what syntax to use. unittest (myname) vs. unittest (mynameexpression) Also unittest myname

Re: Named unittests

2015-03-31 Thread Andrei Alexandrescu via Digitalmars-d
On 3/31/15 3:58 PM, deadalnix wrote: On Tuesday, 31 March 2015 at 21:50:56 UTC, Martin Nowak wrote: On 03/30/2015 11:52 PM, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Why a DIP, isn't the only question what syntax to use. unittest

Re: Named unittests

2015-03-31 Thread David Gileadi via Digitalmars-d
On 3/31/15 3:28 PM, Andrei Alexandrescu wrote: On 3/31/15 2:50 PM, Martin Nowak wrote: On 03/30/2015 11:52 PM, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Why a DIP, isn't the only question what syntax to use. unittest (myname) vs

Re: Named unittests

2015-03-31 Thread deadalnix via Digitalmars-d
On Tuesday, 31 March 2015 at 21:50:56 UTC, Martin Nowak wrote: On 03/30/2015 11:52 PM, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Why a DIP, isn't the only question what syntax to use. unittest (myname) vs. unittest (mynameexpression

Re: Named unittests

2015-03-30 Thread deadalnix via Digitalmars-d
Sounds like something that should be added as a library rather than the core language.

Re: Named unittests

2015-03-30 Thread Andrei Alexandrescu via Digitalmars-d
On 3/30/15 2:59 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? Basic principle: --- unittest { testCase(a testcase, { // actual test code here }); } --- Looks a bit too much work.

Re: Named unittests

2015-03-30 Thread Panke via Digitalmars-d
On Monday, 30 March 2015 at 21:57:33 UTC, Andrei Alexandrescu wrote: On 3/30/15 2:55 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? With attributes? That might be palatable but only as a standard solution.

Re: Named unittests

2015-03-30 Thread Brian Schott via Digitalmars-d
On Monday, 30 March 2015 at 21:58:13 UTC, Dicebot wrote: I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }` I agree that an annotation (Probably defined in object.d) is the best way to handle this. Here's something I don't think

Re: Named unittests

2015-03-30 Thread Panke via Digitalmars-d
Backward compatibility is not an issue seeing this is a pure addition. Andrei I mean that it lives peacefully alongside normal unittest blocks.

Re: Named unittests

2015-03-30 Thread Dicebot via Digitalmars-d
On Monday, 30 March 2015 at 23:02:51 UTC, Mathias Lang wrote: We do have an `@name` as UDA in Vibe.d, so that'll be a breaking change (But `@NamedUnittest(name)` will do). I also think it should be a library solution. I can't afford to care about used names for attributes, same as we still

Re: Named unittests

2015-03-30 Thread Panke via Digitalmars-d
I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? Basic principle: --- unittest { testCase(a testcase, { // actual test code here }); } --- Testcase registers the structure and the runtime just runs the

Re: Named unittests

2015-03-30 Thread Panke via Digitalmars-d
On Monday, 30 March 2015 at 21:52:35 UTC, Andrei Alexandrescu wrote: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given

Re: Named unittests

2015-03-30 Thread Dicebot via Digitalmars-d
I'd prefer putting alternative test runner into Phobos instead which will support `@name(Something) unittest { }`

Re: Named unittests

2015-03-30 Thread Andrei Alexandrescu via Digitalmars-d
On 3/30/15 2:55 PM, Panke wrote: I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution? With attributes? That might be palatable but only as a standard solution. I'd want to add that to Phobos. -- Andrei

Re: Named unittests

2015-03-30 Thread Mathias Lang via Digitalmars-d
Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Andrei I agree that using library-defined annotations would be a better approach than language changes. Currently things like tested use the form @name(AddPeer) unittest { /* ... */ } Which is nice, because

Named unittests

2015-03-30 Thread Andrei Alexandrescu via Digitalmars-d
We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given unittest fails several times across several commits. Unittests

Re: Named unittests

2015-03-30 Thread Kapps via Digitalmars-d
On Monday, 30 March 2015 at 21:52:35 UTC, Andrei Alexandrescu wrote: I'd like to make a DIP for named unittests. Who can help me with that? Andrei I agree that using library-defined annotations would be a better approach than language changes. Currently things like tested use the form

Re: Named unittests

2015-03-30 Thread Rikki Cattermole via Digitalmars-d
On 31/03/2015 10:52 a.m., Andrei Alexandrescu wrote: We're having a strong need for named unittests at Facebook for multiple reasons. 1. We have sophisticated tooling that verifies whether unittests are flaky. The automated monitor (for e.g. C++) figures whether a given unittest fails several