Thread overview
How do I run DMD unittests on win32?
Oct 03, 2012
Andrej Mitrovic
Oct 03, 2012
Jacob Carlborg
Oct 03, 2012
Daniel Murphy
Oct 03, 2012
Piotr Szturmaj
Oct 03, 2012
Andrej Mitrovic
Oct 03, 2012
Piotr Szturmaj
Oct 03, 2012
Andrej Mitrovic
October 03, 2012
I'm starting to contribute to DMD by fixing some bugs, but I need to run the test-suite. Anyone know how this is done on win32? There's a makefile in the test dir but what I don't know is if I need to set up my directory structure in any special way?

Is it simpler to just make the pull request and wait for the autotester to finish, or should I try to do this locally first? Thanks.
October 03, 2012
On 2012-10-03 03:04, Andrej Mitrovic wrote:
> I'm starting to contribute to DMD by fixing some bugs, but I need to
> run the test-suite. Anyone know how this is done on win32? There's a
> makefile in the test dir but what I don't know is if I need to set up
> my directory structure in any special way?
>
> Is it simpler to just make the pull request and wait for the
> autotester to finish, or should I try to do this locally first?
> Thanks.

I think you at least need to have the DMD, Phobos and druntime repositories in the same folder.

-- 
/Jacob Carlborg
October 03, 2012
You run the makefile.  It calls d_do_test.  If your dmd, druntime and phobos repositories are not where it expects you will need to modify the paths in the makefile, or change your directory layout to match that the autotester does.

"Andrej Mitrovic" <andrej.mitrovich@gmail.com> wrote in message news:mailman.516.1349226306.5162.digitalmars-d@puremagic.com...
> I'm starting to contribute to DMD by fixing some bugs, but I need to run the test-suite. Anyone know how this is done on win32? There's a makefile in the test dir but what I don't know is if I need to set up my directory structure in any special way?
>
> Is it simpler to just make the pull request and wait for the autotester to finish, or should I try to do this locally first? Thanks.


October 03, 2012
Andrej Mitrovic wrote:
> I'm starting to contribute to DMD by fixing some bugs, but I need to
> run the test-suite. Anyone know how this is done on win32? There's a
> makefile in the test dir but what I don't know is if I need to set up
> my directory structure in any special way?

It's GNU makefile.

You need:

1. MinGW
2. unzip.exe (I use this one: http://gnuwin32.sourceforge.net/packages/unzip.htm) - it must be in the PATH env. var.

Next:

3. copy your modified dmd.exe to x:\dmd\windows\bin (this is the most straightforward way)
4. run MinGW and cd to /x/dmd/src/dmd/test
5. make DMD=/x/dmd/windows/bin/dmd

where x is your drive letter.

By default make runs all tests, but you can select smaller area with these targets:

run_runnable_tests
run_compilable_tests
run_fail_compilation_tests

for example: make run_compilable_tests DMD=/x/dmd/windows/bin/dmd

After all, use make clean to delete test results.

P.S. I couldn't manage to run the tests without copying the dmd. Without a copy I constantly encountered missing object.d file errors, even if I set correct paths to druntime/import.
October 03, 2012
On 10/3/12, Piotr Szturmaj <bncrbme@jadamspam.pl> wrote:
> 4. run MinGW and cd to /x/dmd/src/dmd/test

What do you mean run MinGW and cd? It's a compiler not a shell..

> 5. make DMD=/x/dmd/windows/bin/dmd

I have a feeling you're talking about using msys, GNU's make won't run this makefile from the command-line, neither would mingw32-make (errors with: ! was unexpected at this time).

Honestly tests shouldn't need any special shells on win32. If the makefile uses d_do_test.d to run the tests then the makefile itself can be a D script.
October 03, 2012
Andrej Mitrovic wrote:
> On 10/3/12, Piotr Szturmaj <bncrbme@jadamspam.pl> wrote:
>> 4. run MinGW and cd to /x/dmd/src/dmd/test
>
> What do you mean run MinGW and cd? It's a compiler not a shell..

Yes, I meant MinGW shell (MSYS). It appears as "MinGW Shell" in my start menu.

>> 5. make DMD=/x/dmd/windows/bin/dmd
>
> I have a feeling you're talking about using msys, GNU's make won't run
> this makefile from the command-line, neither would mingw32-make
> (errors with: ! was unexpected at this time).

I wrote "GNU makefile" because of that: http://web.archiveorange.com/archive/v/GZgCCznbXZWfIrdzVIfB

Anyway my "MinGW Shell" is able to run that makefile and all the tests.

> Honestly tests shouldn't need any special shells on win32. If the
> makefile uses d_do_test.d to run the tests then the makefile itself
> can be a D script.

Agreed. Few days ago I was trying to figure this out too, and found the way described in my prev post. This should be posted somewhere in the wiki, as I figured this out only after reading the above link, after googling for a quite long time...
October 03, 2012
On 10/3/12, Piotr Szturmaj <bncrbme@jadamspam.pl> wrote:
> P.S. I couldn't manage to run the tests without copying the dmd. Without a copy I constantly encountered missing object.d file errors, even if I set correct paths to druntime/import.

Yeah I'm seeing this too. Ah well.. I guess I'll just have to live with msys, the d build script won't run properly without it. It's all one big hardcoded mess..