Re: Phobos Unittest

2021-09-07 Thread Per Nordlöw via Digitalmars-d-learn
On Friday, 3 September 2021 at 23:39:44 UTC, Per Nordlöw wrote: When is a phobos unittest supposed to be qualified with version `(StdUnittest)`? Ideally, always? I don't see that their current use is consistenly following a rule. If so, is the purpose of its presence to reduce the burden

Re: Phobos Unittest

2021-09-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/4/21 4:05 PM, Per Nordlöw wrote: On Saturday, 4 September 2021 at 13:12:49 UTC, Steven Schveighoffer wrote: Note that lexing and parsing is extremely quick, and I wouldn't focus on trying to trim this out, you won't get much performance out of that. -Steve For the record, a D file

Re: Phobos Unittest

2021-09-04 Thread jfondren via Digitalmars-d-learn
On Saturday, 4 September 2021 at 20:06:27 UTC, Per Nordlöw wrote: On Saturday, 4 September 2021 at 20:05:17 UTC, Per Nordlöw wrote: ```sh time dmd import_std.d -o- ``` should be ```sh time dmd -unittest import_std.d -o- ``` When you generate the object files, I get 13K vs. 75K from a file

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 20:05:17 UTC, Per Nordlöw wrote: ```sh time dmd import_std.d -o- ``` should be ```sh time dmd -unittest import_std.d -o- ```

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 13:12:49 UTC, Steven Schveighoffer wrote: Note that lexing and parsing is extremely quick, and I wouldn't focus on trying to trim this out, you won't get much performance out of that. -Steve For the record, a D file containing only `import std;` type checks

Re: Phobos Unittest

2021-09-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/4/21 7:43 AM, Johan wrote: On Saturday, 4 September 2021 at 03:18:01 UTC, Paul Backus wrote: On Saturday, 4 September 2021 at 00:09:37 UTC, H. S. Teoh wrote: This is related to the bogonity of the current behaviour of -unittest, which compiles *all* unittests of *all* imported modules,

Re: Phobos Unittest

2021-09-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/4/21 5:42 AM, Per Nordlöw wrote: On Saturday, 4 September 2021 at 03:18:01 UTC, Paul Backus wrote: As Steven Schveighoffer [pointed out][1], Phobos unittests are never included in user code, regardless of whether `StdUnittest` is used. Yes, but they are lexed and parsed, right? Yes,

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 12:40:02 UTC, Per Nordlöw wrote: Omg. It really seems like it's motivated to do a benchmark with phobos unittests prefixed with Should have been a reply to The "never" is false, https://d.godbolt.org/z/c4oeYM7rG

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 12:40:02 UTC, Per Nordlöw wrote: then. I can make that refactoring in my favorite choice of editor and see the result differ. In terms of binary size, and speed and memory usage of check, build and link time. Automated that is. If we want this, shall we

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 12:31:33 UTC, Dennis wrote: On Saturday, 4 September 2021 at 09:42:46 UTC, Per Nordlöw wrote: Yes, but they are lexed and parsed, right? Right, but that's the case regardless of `version(StdUnittest)`. Omg. It really seems like it's motivated to do a

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 12:31:33 UTC, Dennis wrote: Right, but that's the case regardless of `version(StdUnittest)`. I don't think so. My guess is that `version(StdUnittest)` does maximum parsing, maybe only lexing. How can one easily determine if this is the fact? Behaviour of

Re: Phobos Unittest

2021-09-04 Thread Dennis via Digitalmars-d-learn
On Saturday, 4 September 2021 at 09:42:46 UTC, Per Nordlöw wrote: Yes, but they are lexed and parsed, right? Right, but that's the case regardless of `version(StdUnittest)`.

Re: Phobos Unittest

2021-09-04 Thread Johan via Digitalmars-d-learn
On Saturday, 4 September 2021 at 03:18:01 UTC, Paul Backus wrote: On Saturday, 4 September 2021 at 00:09:37 UTC, H. S. Teoh wrote: This is related to the bogonity of the current behaviour of -unittest, which compiles *all* unittests of *all* imported modules, even when you're compiling user

Re: Phobos Unittest

2021-09-04 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 4 September 2021 at 03:18:01 UTC, Paul Backus wrote: As Steven Schveighoffer [pointed out][1], Phobos unittests are never included in user code, regardless of whether `StdUnittest` is used. Yes, but they are lexed and parsed, right?

Re: Phobos Unittest

2021-09-03 Thread Paul Backus via Digitalmars-d-learn
On Friday, 3 September 2021 at 23:39:44 UTC, Per Nordlöw wrote: When is a phobos unittest supposed to be qualified with version `(StdUnittest)`? Almost never. `version (StdUnittest)` should be used in Phobos wherever you would normally use a `version (unittest)` block

Re: Phobos Unittest

2021-09-03 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 4 September 2021 at 00:09:37 UTC, H. S. Teoh wrote: This is related to the bogonity of the current behaviour of -unittest, which compiles *all* unittests of *all* imported modules, even when you're compiling user code that has no interest in Phobos unittests. Well, no; it

Re: Phobos Unittest

2021-09-03 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Sep 03, 2021 at 11:39:44PM +, Per Nordlöw via Digitalmars-d-learn wrote: > When is a phobos unittest supposed to be qualified with version > `(StdUnittest)`? Ideally, always? I don't see that their current use > is consistenly following a rule. If so, is the purpose of its

Phobos Unittest

2021-09-03 Thread Per Nordlöw via Digitalmars-d-learn
When is a phobos unittest supposed to be qualified with version `(StdUnittest)`? Ideally, always? I don't see that their current use is consistenly following a rule. If so, is the purpose of its presence to reduce the burden of the compiler when the application using phobos is compiled