May 21, 2019
On Saturday, 18 May 2019 at 14:56:16 UTC, Andrei Alexandrescu wrote:
> On 5/18/19 2:20 PM, Adam D. Ruppe wrote:
>> On Saturday, 18 May 2019 at 05:49:00 UTC, H. S. Teoh wrote:
>>> Dmd already has -run, so it's not too much of a stretch to change the behaviour of -unittest into the equivalent of today's:
>>>
>>>     dmd -unittest -run blah.d
>> 
>> Actually, right after I went to bed, I realized the solution to everyone's problem.
>> 
>> We all want `-unittest=package,list` to control which tests are run.
>
> Doesn't that seem a bit much? It seems to me you either want to run unittests or not, why run just a few? Going with the typechecking metaphor - do we want to check some modules but not others?

I frequently only run a few unit tests - usually the ones that are currently failing. To me at least it's a question of screen real estate and attention.

May 21, 2019
On 5/21/19 5:20 AM, Atila Neves wrote:
> On Saturday, 18 May 2019 at 14:56:16 UTC, Andrei Alexandrescu wrote:
>> On 5/18/19 2:20 PM, Adam D. Ruppe wrote:
>>>
>>> We all want `-unittest=package,list` to control which tests are run.
>>
>> Doesn't that seem a bit much? It seems to me you either want to run unittests or not, why run just a few? Going with the typechecking metaphor - do we want to check some modules but not others?
> 
> I frequently only run a few unit tests - usually the ones that are currently failing. To me at least it's a question of screen real estate and attention.
> 

It can also be an issue of quick debug-edit cycles. Mysql-native's tests can easily take a couple minutes or so to run. If I'm debugging a specific failure, I absolutely don't want to waste all that time waiting on all those irrelevant tests, every single time, before the testrunner finally gets around to the test I care about. (Which is why mysql-native's tests now use unit-threaded).
May 21, 2019
Am Sun, 19 May 2019 09:13:21 -0400 schrieb Andrei Alexandrescu:

> On 5/19/19 10:25 AM, Johannes Pfau wrote:
>> Am Sat, 18 May 2019 13:55:39 -0400 schrieb Andrei Alexandrescu:
>> 
>> 
>>> Wait, if you build a program with -unittest will it run some/all of phobos' unittests? That would be indeed undesirable!
>>>
>>> I wonder how often people compile external libraries together with the application within the same command line.
>> 
>> It runs some of the phobos unittests, those which are in templates instantiated in user code:
> 
> That is correct, and seems desirable. Instantiations of library templated types with user types should be tested during unittesting.

Most of the time that's true. However, this can get very annoying if the phobos unit tests fail and you can't run your own tests as the runner aborts after the first failed test. You also can't disable the phobos test, as we don't have a way to disable tests.

So if you have a flaky phobos test (depends on network, datetime (timezone files) or something similar) pulled into your application and it fails, this might prevent you from testing application code. I think this happened to me only once, but it was really, really annoying.

-- 
Johannes
May 21, 2019
On 5/21/19 10:20 AM, Atila Neves wrote:
> On Saturday, 18 May 2019 at 14:56:16 UTC, Andrei Alexandrescu wrote:
>> On 5/18/19 2:20 PM, Adam D. Ruppe wrote:
>>> On Saturday, 18 May 2019 at 05:49:00 UTC, H. S. Teoh wrote:
>>>> Dmd already has -run, so it's not too much of a stretch to change the behaviour of -unittest into the equivalent of today's:
>>>>
>>>>     dmd -unittest -run blah.d
>>>
>>> Actually, right after I went to bed, I realized the solution to everyone's problem.
>>>
>>> We all want `-unittest=package,list` to control which tests are run.
>>
>> Doesn't that seem a bit much? It seems to me you either want to run unittests or not, why run just a few? Going with the typechecking metaphor - do we want to check some modules but not others?
> 
> I frequently only run a few unit tests - usually the ones that are currently failing. To me at least it's a question of screen real estate and attention.

That's a good argument, thanks.

2 3 4 5 6 7 8 9 10 11 12
Next ›   Last »