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

Isolate unit tests #3836

Merged
merged 8 commits into from
Aug 21, 2018

Conversation

telephon
Copy link
Member

@telephon telephon commented Jul 2, 2018

This cleans up the UnitTest class and isolates the test methods by making an instance each (replaces #3626) .

This fixes #3572.

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor points. Also, the documentation for UnitTest should be updated to reflect that tests are now run on independent class instances.

@@ -1,56 +1,37 @@

TestUnitTest : UnitTest {

var someVar,toreDown,count = 0;
var someVar, setUp = false, toreDown = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that we're not testing toreDown, it and tearDown can both be removed from this class

method = class.findMethod(method.asSymbol);
if(method.isNil) { Error("Test method not found "+methodName).throw };
class.new.runTestMethod(method);
*runAllTestMethods { |report = true|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a private method? I can't think of a case where using this method directly would be beneficial; it's more or less the same as run(false, report).

@telephon
Copy link
Member Author

@brianlheim fixed the issues - thanks for your comments!

@telephon telephon added this to the 3.10.1 milestone Jul 28, 2018
Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought this is well-known, but when we deprecate methods/classes they should be moved to the /deprecated folder in SCClassLibrary. I will add something to DEVELOPING.md to that effect :)

nil
};

this.deprecated(thisMethod, this.class.findRespondingMethodFor(\run))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be moved to the deprecations folder

Copy link
Member Author

@telephon telephon Jul 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thanks!

@mossheim mossheim merged commit ee63db9 into supercollider:develop Aug 21, 2018
@aspiers
Copy link
Contributor

aspiers commented Aug 22, 2018

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UnitTest doesn't provide isolation between test cases
3 participants