Re: DUB "Error: only one `main` allowed."

2021-08-11 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 11:44:42 UTC, Steven Schveighoffer wrote: On 8/11/21 5:31 AM, tastyminerals wrote: [...] `dub -b unittest` should work (you don't need the extra build type stuff) dub test does something funky -- it removes the *whole module* where your main function is (if

Re: DUB "Error: only one `main` allowed."

2021-08-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/11/21 5:31 AM, tastyminerals wrote: I would like to trigger tests in a simple dub project. ``` source/my_script.d dub.json ``` Here is a dub config: ```json {     "targetPath": "build", "targetType": "executable", "sourcePaths": ["source"], "name": "my_script", "buildT

Re: DUB "Error: only one `main` allowed."

2021-08-11 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 09:38:13 UTC, tastyminerals wrote: Hahaha, I fixed it by renaming the `my_script.d` to `app.d`. Oh boy. What you want is the `mainSourceFile` entry. From the dub documentation, [under "Build Settings"][1]: Determines the file that contains the main() functi

Re: DUB "Error: only one `main` allowed."

2021-08-11 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 09:31:46 UTC, tastyminerals wrote: I would like to trigger tests in a simple dub project. ``` source/my_script.d dub.json ``` Here is a dub config: ```json { "targetPath": "build", "targetType": "executable", "sourcePaths": ["source"],

DUB "Error: only one `main` allowed."

2021-08-11 Thread tastyminerals via Digitalmars-d-learn
I would like to trigger tests in a simple dub project. ``` source/my_script.d dub.json ``` Here is a dub config: ```json { "targetPath": "build", "targetType": "executable", "sourcePaths": ["source"], "name": "my_script", "buildTypes": { "relea

Re: DUB "Error: only one `main` allowed."

2021-08-11 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 11 August 2021 at 09:31:46 UTC, tastyminerals wrote: I would like to trigger tests in a simple dub project. ``` source/my_script.d dub.json ``` Here is a dub config: ```json { "targetPath": "build", "targetType": "executable", "sourcePaths": ["source"],