Jump to page: 1 212  
Page
Thread overview
Named unittests
Mar 30, 2015
Panke
Mar 30, 2015
Panke
Mar 31, 2015
tcak
Mar 31, 2015
w0rp
Mar 31, 2015
tcak
Mar 30, 2015
Panke
Mar 30, 2015
Panke
Mar 30, 2015
Dicebot
Mar 30, 2015
Brian Schott
Mar 31, 2015
w0rp
Mar 31, 2015
Meta
Mar 31, 2015
Jacob Carlborg
Mar 31, 2015
Dicebot
Apr 02, 2015
krzaq
Mar 31, 2015
Idan Arye
Apr 01, 2015
Jacob Carlborg
Mar 30, 2015
deadalnix
Mar 30, 2015
Kapps
Mar 30, 2015
Mathias Lang
Mar 30, 2015
Dicebot
Mar 31, 2015
Rikki Cattermole
Mar 31, 2015
Jacob Carlborg
Mar 31, 2015
ezneh
Mar 31, 2015
Johannes Pfau
Mar 31, 2015
Dicebot
Mar 31, 2015
Johannes Pfau
Mar 31, 2015
Atila Neves
Mar 31, 2015
Martin Nowak
Mar 31, 2015
Johannes Pfau
Mar 31, 2015
Dicebot
Apr 01, 2015
Jacob Carlborg
Apr 01, 2015
Jacob Carlborg
Mar 31, 2015
Idan Arye
Mar 31, 2015
Dicebot
Mar 31, 2015
Idan Arye
Mar 31, 2015
Xavier Bigand
Mar 31, 2015
Idan Arye
Apr 01, 2015
Jacob Carlborg
Apr 01, 2015
Idan Arye
Apr 01, 2015
Jacob Carlborg
Apr 01, 2015
Dicebot
Apr 02, 2015
Jacob Carlborg
Apr 02, 2015
Dicebot
Apr 03, 2015
Jacob Carlborg
Mar 31, 2015
Dicebot
Mar 31, 2015
Idan Arye
Apr 01, 2015
Jacob Carlborg
Apr 01, 2015
Idan Arye
Apr 02, 2015
Jacob Carlborg
Mar 31, 2015
Martin Nowak
Apr 01, 2015
Jonathan M Davis
Mar 31, 2015
Atila Neves
Mar 31, 2015
Martin Nowak
Mar 31, 2015
David Gileadi
Mar 31, 2015
deadalnix
Mar 31, 2015
Martin Nowak
Apr 01, 2015
Atila Neves
Apr 01, 2015
deadalnix
Mar 31, 2015
Martin Nowak
Apr 01, 2015
deadalnix
Apr 01, 2015
Panke
Apr 01, 2015
Shammah Chancellor
Apr 01, 2015
Idan Arye
May 17, 2019
KnightMare
May 17, 2019
Andre Pany
May 17, 2019
H. S. Teoh
May 17, 2019
KnightMare
May 19, 2019
Johannes Loher
May 18, 2019
Adam D. Ruppe
May 18, 2019
H. S. Teoh
May 18, 2019
Adam D. Ruppe
May 18, 2019
Nicholas Wilson
May 19, 2019
Johannes Loher
May 19, 2019
Walter Bright
May 19, 2019
Adam D. Ruppe
May 18, 2019
H. S. Teoh
May 19, 2019
Johannes Pfau
May 19, 2019
Walter Bright
May 21, 2019
Johannes Pfau
May 19, 2019
Jacob Carlborg
May 18, 2019
Adam D. Ruppe
May 19, 2019
Johannes Loher
May 20, 2019
Jacob Carlborg
May 20, 2019
Dejan Lekic
May 21, 2019
Atila Neves
May 18, 2019
H. S. Teoh
May 19, 2019
Walter Bright
March 30, 2015
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 are identified by name; relying on file/line is impossible because the line of a failure is not stable across changes.

2. Again for efficient automated testing and flakiness detection, one should be able to run only a subset of unittests by mentioning them by line in the command line. Note that this implies there's no interdependency between distinct unittests, which is fine because the new ability is opt-on; I'd say is pure style anyway.

3. Mentioning unittest names in failure messages helps human communication (e.g. "AddPeer is failing after your change"). This is impossible with file and line numbers.

I'd like to make a DIP for named unittests. Who can help me with that?


Andrei
March 30, 2015
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 unittest fails several times across several commits. Unittests are identified by name; relying on file/line is impossible because the line of a failure is not stable across changes.
>
> 2. Again for efficient automated testing and flakiness detection, one should be able to run only a subset of unittests by mentioning them by line in the command line. Note that this implies there's no interdependency between distinct unittests, which is fine because the new ability is opt-on; I'd say is pure style anyway.
>
> 3. Mentioning unittest names in failure messages helps human communication (e.g. "AddPeer is failing after your change"). This is impossible with file and line numbers.
>
> I'd like to make a DIP for named unittests. Who can help me with that?
>
>
> Andrei

I've implemented this in a library and I'm sure others have as well. Are you sure, you want a language solution?
March 30, 2015
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
March 30, 2015
I'd prefer putting alternative test runner into Phobos instead which will support `@name("Something") unittest { }`
March 30, 2015
>
> 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 unittest as is does today and than calls all closures registered during the unittest. Makes this fully backward compatible.
March 30, 2015
Sounds like something that should be added as a library rather than the core language.
March 30, 2015
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. I'd want to add that to Phobos. -- Andrei

In my case: no. I wrote it before UDA and wanted to be able to generate testcases at runtime. Used this to register a test case for a SAT solver for every instance in a subdirectory etc.
March 30, 2015
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.

> Testcase registers the structure and the runtime just runs the unittest
> as is does today and than calls all closures registered during the
> unittest. Makes this fully backward compatible.

Backward compatibility is not an issue seeing this is a pure addition.


Andrei
March 30, 2015
>
> Backward compatibility is not an issue seeing this is a pure addition.
>
>
> Andrei

I mean that it lives peacefully alongside normal unittest blocks.
March 30, 2015
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 many people know: You can't use `~` in deprecated() attributes. You can only put a string literal in the parenthesis. If you want to break messages over multiple lines you need to rely on implicit string concatenation.
« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11