Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced unittest support #1131

Closed
wants to merge 2 commits into from
Closed

Enhanced unittest support #1131

wants to merge 2 commits into from

Conversation

jpf91
Copy link
Contributor

@jpf91 jpf91 commented Sep 21, 2012

This allows to add additional data to unittests and it allows the runtime to run unittests seperately.

Currently supported information:

ushort version; //UnitTest info version, currently = 1
string filename;
uint line;
void function() testFunc;

Prepared:

string name; //Needs support in the lexer/parser.

The name is passed to the runtime, but currently it's always an empty string.

The old per module unittest function is still supported, but deprecated.

The second commit recognizes if a unittest is marked as @disable and passes this information to the runtime.

This druntime pull request should be pulled first:
dlang/druntime#308

Here's a small example of what can be done with these changes:
Custom test runner: http://dpaste.dzfl.pl/046ed6fb
Sample unittests: http://dpaste.dzfl.pl/517b1088
Output: http://dpaste.dzfl.pl/2780939b

NOTE:
The autotester does not pull in the druntime changes, so it only tests the old unit test method (The new method is disabled if druntime support is not found).
Therefore the druntime request should be pulled first. We should the wait for new autotester results with these druntime changes included. If those results look fine we can merge this pull request.

@jpf91
Copy link
Contributor Author

jpf91 commented Sep 21, 2012

Does anyone know what's necessary to make the pull tester use that druntime pull request?

@nazriel
Copy link
Contributor

nazriel commented Sep 23, 2012

@jpf91 I think you need to add somewhere in description something like:
Requires: dlang/druntime#308

@jpf91
Copy link
Contributor Author

jpf91 commented Sep 23, 2012

@nazriel thanks, let's see if this works...

I also added a warning if the required runtime support isn't available, so enhanced unit test information won't be available without proper runtime support (and when the old methods gets removed, no unit test information at all), but everything else should work fine.

@nazriel
Copy link
Contributor

nazriel commented Sep 23, 2012

@jpf91, it seems to fetch druntime pull now.

But unittest fails on Windows.

@jpf91
Copy link
Contributor Author

jpf91 commented Sep 23, 2012

No, it still doesn't fetch druntime. See http://d.puremagic.com/test-results/pull.ghtml?runid=297747&logid=5
I just adapted the compiler changes so it'll work as it did before if the druntime support is missing. But I have to look at this windows failure, I've got no clue why it's failing.

This allows to add additional data to unittests
and it allows the runtime to run unittests seperately.

Currently supported information:
ushort version; //UnitTest info version, currently = 1
string filename;
uint line;
void function() testFunc;

Prepared:
string name; //Needs support in the lexer/parser.
The name is passed to the runtime, but currently
it's always an empty string.

The old per module unittest function is still supported,
but deprecated.
Tell the runtime if a test is marked @disable. The rest is done
in the runtime.

NOTE: disabling tests does not work if the old unittest function
is used!
@jkm
Copy link

jkm commented Sep 25, 2012

Note that this pull request fixes issue 4747.

@yebblies
Copy link
Member

yebblies commented Oct 7, 2012

@nazriel

@jpf91 I think you need to add somewhere in description something like:
Requires: dlang/druntime#308

The old pull tester had something like this, but the current one doesn't (as far as I know)

@nazriel
Copy link
Contributor

nazriel commented Oct 7, 2012

Awww, bummer. Any reason why it was removed?

@jpf91 sorry for giving false information then.

@yebblies
Copy link
Member

yebblies commented Oct 7, 2012

@nazriel When the old linux 32 only pull tester (which I wrote) was adapted into the current tester by Brad, that feature didn't make the transition, and nobody has gotten around to re-implementing it. It's low priority as not many pull require simultaneous merges.

@jpf91
Copy link
Contributor Author

jpf91 commented Oct 19, 2012

Closed till we have a proper DIP.

@jpf91 jpf91 closed this Oct 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants