Re: DUB test and strings that look like D code

2023-03-04 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
The analysis is pretty brain dead. https://github.com/dlang/dub/blob/master/source/dub/internal/utils.d#L611

DUB test and strings that look like D code

2023-03-04 Thread 0xEAB via Digitalmars-d-learn
Is it just me, or does this happen for someone else, too? Init a fresh DUB project and create a file (e.g. `lib.d`) with the following content: ```d unittest { string x = "module oh.dear.dub.what.are.you.doing;"; } ``` Then run `dub test`: ``` .dub/code/foo-test-librar

Re: dub: standard project: how to build the unittest (the thing `dub test` runs)

2020-12-12 Thread Andre Pany via Digitalmars-d-learn
build test` or `dub build --test` for it. What do you think? As far as I remember someone else also requested the feature: building a test build without executing it. About the actual command I am not sure, maybe also `dub test --build` could be an option. Actually I add the configurations

Re: dub: standard project: how to build the unittest (the thing `dub test` runs)

2020-12-12 Thread Tobias Pankrath via Digitalmars-d-learn
On Saturday, 12 December 2020 at 12:18:47 UTC, Andre Pany wrote: In any case you should have configurations in your dub json. Thank you for your detailed reply and I am sure I can make it work in the way you described. But I don't think my use case is invalid and dub should improve its

Re: dub: standard project: how to build the unittest (the thing `dub test` runs)

2020-12-12 Thread Andre Pany via Digitalmars-d-learn
"dub" or "dub build", here you set targetType library. The second configuration you name unittest, you set targetType executable and you also have to set attribute mainSourceFile. This configuration is used automatically by command "dub test". Kind regards A

Re: dub: standard project: how to build the unittest (the thing `dub test` runs)

2020-12-12 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 12 December 2020 at 11:13:45 UTC, Tobias Pankrath wrote: Whenever I come back to some D, I seem to be stumbling over dub. Somehow dub and I don't align: $ dub init dubtest && cd dubtest $ dub test -> creates executable `dubtest` (saying Falling back to "

dub: standard project: how to build the unittest (the thing `dub test` runs)

2020-12-12 Thread Tobias Pankrath via Digitalmars-d-learn
Whenever I come back to some D, I seem to be stumbling over dub. Somehow dub and I don't align: $ dub init dubtest && cd dubtest $ dub test -> creates executable `dubtest` (saying Falling back to "dub -b unittest".) $ touch source/lib.d dub test -> creates executa

Re: Link error triggered by `dub test` but not by `dub build --unittest`

2020-06-17 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 17 June 2020 at 12:12:24 UTC, Per Nordlöw wrote: On Tuesday, 16 June 2020 at 12:21:26 UTC, Per Nordlöw wrote: when dub test doesn't? I'm trying to reduce it through dustmite phobos-next "dub test 2>&1 | grep -F '_D6object10_xopEqualsFMxPvMxQeZb'"

Re: Link error triggered by `dub test` but not by `dub build --unittest`

2020-06-17 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 16 June 2020 at 12:21:26 UTC, Per Nordlöw wrote: when dub test doesn't? I'm trying to reduce it through dustmite phobos-next "dub test 2>&1 | grep -F '_D6object10_xopEqualsFMxPvMxQeZb'" Is this the best way to use dustmite in this case?

Re: Link error triggered by `dub test` but not by `dub build --unittest`

2020-06-17 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 16 June 2020 at 12:21:26 UTC, Per Nordlöw wrote: All the linker errors originate from zio.d but zio.d has its unittests disabled so how come this fails to link? zio.d is not the source of the problem. Something else is. The common denominator seems to be that the builtins

Link error triggered by `dub test` but not by `dub build --unittest`

2020-06-16 Thread Per Nordlöw via Digitalmars-d-learn
Inside https://github.com/nordlow/phobos-next/ doing dub build --compiler=dmd --build=unittest works but dub test --compiler=dmd fails as Generating test runner configuration 'phobos-next-test-library' for 'library' (library). Performing "unittest" build using /u

Re: A `dub test` problem...

2018-11-08 Thread duge via Digitalmars-d-learn
On Thursday, 8 November 2018 at 15:01:04 UTC, duge wrote: WTF, why i got a this modal messagebox when i trying `dub test --build=unittest` ?? i just captured messagebox and using OCR, and that's it. here: core.exceptionAssertError@source\dub\internal

A `dub test` problem...

2018-11-08 Thread duge via Digitalmars-d-learn
WTF, why i got a this modal messagebox when i trying `dub test --build=unittest` ?? i just captured messagebox and using OCR, and that's it. here: core.exceptionAssertError@source\dub\internal\vibecompat\core\log.d(85): Enforcement failed (No error

Re: dub test

2018-02-02 Thread Joel via Digitalmars-d-learn
On Friday, 2 February 2018 at 09:00:38 UTC, carblue wrote: On Friday, 2 February 2018 at 07:23:54 UTC, Joel wrote: [snip] Import module base from file ... source/jmisc/base.d by: import jmisc.base; and recommended read: https://code.dlang.org/package-format?lang=json Thanks carblue. I had

Re: dub test

2018-02-02 Thread carblue via Digitalmars-d-learn
On Friday, 2 February 2018 at 07:23:54 UTC, Joel wrote: When I try 'dub test' I get errors like 'Source file '/Users/joelchristensen/jpro/dpro2/JMiscLib/source/jmisc/base.d' not found in any import path.' Here's the dub.json file I'm using: ``` { "name": "timelog&qu

dub test

2018-02-01 Thread Joel via Digitalmars-d-learn
When I try 'dub test' I get errors like 'Source file '/Users/joelchristensen/jpro/dpro2/JMiscLib/source/jmisc/base.d' not found in any import path.' Here's the dub.json file I'm using: ``` { "name": "timelog", "targetType": "executable",

How to pass --DRT-covopt to dub test?

2018-01-10 Thread Andre Pany via Digitalmars-d-learn
Hi, I have some issues to find out how I can pass --DRT-covopt to dub test. I am pretty sure this should work, but dub doesn't like it: dub test --coverage -- --DRT-covopt "dstpath:./cov" ... Running .\cov-sample.exe dstpath:./cov ... Is there s.th. I miss? Kind regards André

Re: hijack dub test

2017-08-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-08-31 08:41, Nicholas Wilson wrote: My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also

hijack dub test

2017-08-31 Thread Nicholas Wilson via Digitalmars-d-learn
My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also includes files in the `source/test` folder

Re: Does "dub test" run tests?

2017-03-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-03-20 10:07, Russel Winder via Digitalmars-d-learn wrote: And different behaviour with different build options, at least when using dmd, but I think the same is true for ldc2: |> dub test No source files found in configuration 'library'. Falling back to "dub -b unittest"

Re: Does "dub test" run tests?

2017-03-20 Thread Russel Winder via Digitalmars-d-learn
ifferent build options, at least when using dmd, but I think the same is true for ldc2: |> dub test No source files found in configuration 'library'. Falling back to "dub -b unittest". Performing "unittest" build using dmd for x86_64. approxgc ~master: building configuration &q

Re: Does "dub test" run tests?

2017-03-20 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2017-03-20 at 00:58 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > I haven't spent the time to dig in and report it properly, but based > on some > of what I saw recently on a project I have, the module with main in > it > didn't have its tests run, as if dub's didn't

Re: Does "dub test" run tests?

2017-03-20 Thread Jonathan M Davis via Digitalmars-d-learn
inimal Dub file for this project. Using Dub the program > runs as expected. However when I run "dub test" it claims to be running > "dub -b unittest" and then proceeds to run the program not the tests. > > In main.d I have: > > ... some most excellent D code … &

Does "dub test" run tests?

2017-03-20 Thread Russel Winder via Digitalmars-d-learn
I have a Meson build for a D program project with a single main.d file that has some unit tests. Both executable and test executable are created and work as expected. I created a minimal Dub file for this project. Using Dub the program runs as expected. However when I run "dub test"

Re: Is there a way to disable 'dub test' for applications?

2016-04-18 Thread Dicebot via Digitalmars-d-learn
(), and no unit tests. When I run 'dub test', dub builds and runs the executable. This is not really desirable. Is there a way to set up the dub configuration file to disable running the test? configuration "unittest" { excludedSourceFiles "path/to/main.d" } Very nice, thank

Re: Is there a way to disable 'dub test' for applications?

2016-04-18 Thread Jon D via Digitalmars-d-learn
On Monday, 18 April 2016 at 11:47:42 UTC, Dicebot wrote: On Monday, 18 April 2016 at 04:25:25 UTC, Jon D wrote: I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub test', dub builds and runs

Re: Is there a way to disable 'dub test' for applications?

2016-04-18 Thread Dicebot via Digitalmars-d-learn
On Monday, 18 April 2016 at 04:25:25 UTC, Jon D wrote: I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub test', dub builds and runs the executable. This is not really desirable

Re: Is there a way to disable 'dub test' for applications?

2016-04-18 Thread Kagamin via Digitalmars-d-learn
You can write it in code: version(unittest) static assert(false,"unit tests not supported");

Re: Is there a way to disable 'dub test' for applications?

2016-04-17 Thread Jon D via Digitalmars-d-learn
test', dub builds and runs the executable. This is not really desirable. Is there a way to set up the dub configuration file to disable running the test? Note: What I'd really like to do is run a custom shell command when 'dub test' is done, I haven't seen anything suggesting that's an option

Re: Is there a way to disable 'dub test' for applications?

2016-04-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 18, 2016 04:25:25 Jon D via Digitalmars-d-learn wrote: > I have an dub config file specifying a targetType of > 'executable'. There is only one file, the file containing main(), > and no unit tests. > > When I run 'dub test', dub builds and runs

Is there a way to disable 'dub test' for applications?

2016-04-17 Thread Jon D via Digitalmars-d-learn
I have an dub config file specifying a targetType of 'executable'. There is only one file, the file containing main(), and no unit tests. When I run 'dub test', dub builds and runs the executable. This is not really desirable. Is there a way to set up the dub configuration file to disable