Re: [Mono-dev] nunit test upgrading task force

2009-06-25 Thread Robert Jordan

Same for corlib/Test/System.IO/*.

Robert

Atsushi Eno wrote:
 Done. Thanks!
 
 Atsushi Eno
 
 Robert Jordan wrote:
 Atsushi,

 Atsushi Eno wrote:
 * list of the files

 I have made an easy list of such old test files on a spreadsheet:
 http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3Aoutput=html

 I've fixed all Test/System.Collections/*.cs in r136771 but
 I'm apparently too dumb to edit the spreadsheet.

 Would you mind to update it accordingly?

 Robert

 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



 
 ___
 Mono-list maillist  -  mono-l...@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-list
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-25 Thread Levi Campbell
Here's my portion of the upgrading, I've included the patches with this
e-mail using the latest sources from SVN.

-- 
Levi Campbell levicc00...@gmail.com
GPG key ID: 7710A5E7


patches.tar.bz2
Description: BZip2 compressed data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-25 Thread Atsushi Eno
Hi,

Those sources are already converted to the new styles and your changes
rather revert them. And most of the files in the bz archive are empty.

Atsushi Eno

Levi Campbell wrote:
 Here's my portion of the upgrading, I've included the patches with this 
 e-mail using the latest sources from SVN.
 
 -- 
 Levi Campbell levicc00...@gmail.com mailto:levicc00...@gmail.com
 GPG key ID: 7710A5E7
 
 
 
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-24 Thread Atsushi Eno

Thanks Charlie. It is good to know that it does not likely
to be much more tasks to do for upgrading. On the other hand
I was under the impression that those obsoleted ones lived in 2.5 -
the conversion work is likely needed more.


BTW for those who join the upgrading, Zoltan has a script
of easy lines that would do large parts of the work. (attached)

Before posting changes, please make sure that

- there is no tests lost in transition.
- no regression is brought.

Some addendum: since reviewing the changes may still become massive
(Miguel did not want to spend our resources too much, and it is
pretty much understandable) I might take a while to do it, or at
worst have to discard the effort (in case changes look too significant
to review history). Sorry if in such case. I hope it goes well.

Atsushi Eno


Charlie Poole wrote:

Hi,

What you described below, plus the later comment about
adding TestFixture and test, should work OK. If there
are other types of asserts, you'll need to translate
them. I'm happy to take any questions (list or direct
email) of the nature What's the best way ...

Also, even though I called 2.4.8 the last 2.4 release,
I'd be glad to to a 2.4.9 for Mono if there should be
any problems that are easy to fix.

Charlie
 
PS: If you find (using NUnit 2.4.x) that anything is 
marked Obsolete, you can pretty much count that it's 
already gone in 2.5.




git checkout $1
dos2unix $1
sed -e 's/ : Assertion//g'  $1  2  mv 2 $1
sed -e 's/AssertEquals (\([^]*\), \(.*\)/Assert.AreEqual (\2, \1);/g'  $1 | 
sed -e 's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/AssertEquals(\([^]*\), \(.*\)/Assert.AreEqual(\2, \1);/g'  $1 | 
sed -e 's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/Assert (\([^]*\), \(.*\)/Assert.IsTrue (\2, \1);/g'  $1 | sed -e 
's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/Assert(\([^]*\), \(.*\)/Assert.IsTrue(\2, \1);/g'  $1 | sed -e 
's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/AssertNull (\([^]*\), \(.*\)/Assert.IsNull (\2, \1);/g'  $1 | sed 
-e 's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/AssertNotNull (\([^]*\), \(.*\)/Assert.IsNotNull (\2, \1);/g'  $1 
| sed -e 's/);,/,/g' | sed -e 's/); ,/ ,/g'  2  mv 2 $1
sed -e 's/Fail (/Assert.Fail (/g'  $1  2  mv 2 $1
sed -e 's/Fail(/Assert.Fail(/g'  $1  2  mv 2 $1
sed -e 's/Assert (\([^]\)/Assert.IsTrue (\1/g'  $1  2  mv 2 $1


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-24 Thread Robert Jordan
Atsushi,

Atsushi Eno wrote:
 
 * list of the files
 
 I have made an easy list of such old test files on a spreadsheet:
 http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3Aoutput=html
 

I've fixed all Test/System.Collections/*.cs in r136771 but
I'm apparently too dumb to edit the spreadsheet.

Would you mind to update it accordingly?

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-24 Thread Charlie Poole
 Thanks Charlie. It is good to know that it does not likely to 
 be much more tasks to do for upgrading. On the other hand I 
 was under the impression that those obsoleted ones lived in 
 2.5 - the conversion work is likely needed more.

From the release notes...

* The following obsolete interfaces, classes and methods have been
removed:
  o The IAsserter interface
  o The AbstractAsserter class
  o The Assertion class
  o The AssertionFailureMessage class
  o The old NUnit.Framework.TestCase class used for inheriting test
classes
  o The Assert.DoAssert() method
  o The ExpectedExceptionAttribute(Type, string) constructor
  o The ExpectedExceptionAttribute(string, string) constructor 

Of these, IAsserter, AbstractAsserter, AssertionFailureMessage and
DoAssert are internal. Assertion you already know about.

If you inherit from NUnit.Framework.TestCase, then you need to convert
to use of attributes for the fixture, tests, setup and teardown.

If you use ExpectedException with an expected message as the second
argument, just replace it with the named parameter ExpectedMessage.

However, all of these will keep working in 2.4 if you miss them, so
it's only a future problem.

Charlie 
 
 BTW for those who join the upgrading, Zoltan has a script of 
 easy lines that would do large parts of the work. (attached)
 
 Before posting changes, please make sure that
 
 - there is no tests lost in transition.
 - no regression is brought.
 
 Some addendum: since reviewing the changes may still become 
 massive (Miguel did not want to spend our resources too much, 
 and it is pretty much understandable) I might take a while to 
 do it, or at worst have to discard the effort (in case 
 changes look too significant to review history). Sorry if in 
 such case. I hope it goes well.
 
 Atsushi Eno
 
 
 Charlie Poole wrote:
  Hi,
  
  What you described below, plus the later comment about adding 
  TestFixture and test, should work OK. If there are other types of 
  asserts, you'll need to translate them. I'm happy to take any 
  questions (list or direct
  email) of the nature What's the best way ...
  
  Also, even though I called 2.4.8 the last 2.4 release, I'd 
 be glad to 
  to a 2.4.9 for Mono if there should be any problems that 
 are easy to 
  fix.
  
  Charlie
   
  PS: If you find (using NUnit 2.4.x) that anything is marked 
 Obsolete, 
  you can pretty much count that it's already gone in 2.5.
  
 
 



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-24 Thread Atsushi Eno
Done. Thanks!

Atsushi Eno

Robert Jordan wrote:
 Atsushi,
 
 Atsushi Eno wrote:
 * list of the files

 I have made an easy list of such old test files on a spreadsheet:
 http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3Aoutput=html

 
 I've fixed all Test/System.Collections/*.cs in r136771 but
 I'm apparently too dumb to edit the spreadsheet.
 
 Would you mind to update it accordingly?
 
 Robert
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] nunit test upgrading task force

2009-06-23 Thread Atsushi Eno
Hi,

I'm thinking if we can upgrade our nunit tests to eliminate derivation
from Assertion (such as eliminating AssertEquals), to make our tests
ready for future versions of NUnit.

The task is very easy: if there is a test class that looks like

 [TestFixture]
 public class FooTest : Assertion
 {
 [Test]
 public void FooBar ()
 {
 AssertEquals (#1, str1, str2);
 }
 }

rewrite it like:

 [TestFixture]
 public class FooTest
 {
 [Test]
 public void FooBar ()
 {
 Assert.AreEqual (str1, str2, #1);
 }
 }

I tried to count it by grep AssertEquals, and there were 8000 lines
in corlib, 1000 lines in System, 1500 lines in Sys.XML, and so on.

So, it is a simple but massive task that I cannot do it by myself.
But if we can hack a volunteer team from here it would be possible.

If you can join the effort, you are welcome :)

* list of the files

I have made an easy list of such old test files on a spreadsheet:
http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3Aoutput=html

* workflow

Basically, removing the base class (Assertion) will give lots of
errors. And when there is no more errors, then you are done with it.

You might want to mark your ownership on the spreadsheet before
you actually start working on them. I'll release the ownership
if some of them are locking.

If you have commit access, let's just check in. Otherwise, post
your changes. (attachment, monoport, etc.)

One sort of concern is that, if you are actively maintaining some code
files and making changes in such old test files, please mark them as
you don't want them changed.
We don't have to do this conversion task perfectly right now. (And
of course you don't have to do upgrade task by yourself because of
marking them.)

* starting

If you are willing to join the task force, please drop me a line
and/or post to the list (here) :)

I'll share the spreadsheet so that you can edit the spreadsheet.
If you don't have Google account, I'll update it instead (with
possible delay).

Atsushi Eno
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Stifu

We could automate the change using a regexp and do a massive replace, no?
Using Notepad++ (http://notepad-plus.sourceforge.net/uk/regExpList.php),
this seems to work fine:

Find:
AssertEquals \((.+[^,]),(.+[^,]), (.+[^,])\);

Replace with:
Assert.AreEqual (\2, \3, \1);

Needs a bit more work to remove the  : Assertion part, but that's the
idea.
What do you think?


Atsushi Eno-3 wrote:
 
 Hi,
 
 I'm thinking if we can upgrade our nunit tests to eliminate derivation
 from Assertion (such as eliminating AssertEquals), to make our tests
 ready for future versions of NUnit.
 
 The task is very easy: if there is a test class that looks like
 
  [TestFixture]
  public class FooTest : Assertion
  {
  [Test]
  public void FooBar ()
  {
  AssertEquals (#1, str1, str2);
  }
  }
 
 rewrite it like:
 
  [TestFixture]
  public class FooTest
  {
  [Test]
  public void FooBar ()
  {
  Assert.AreEqual (str1, str2, #1);
  }
  }
 
 I tried to count it by grep AssertEquals, and there were 8000 lines
 in corlib, 1000 lines in System, 1500 lines in Sys.XML, and so on.
 
 So, it is a simple but massive task that I cannot do it by myself.
 But if we can hack a volunteer team from here it would be possible.
 
 If you can join the effort, you are welcome :)
 
 * list of the files
 
 I have made an easy list of such old test files on a spreadsheet:
 http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3Aoutput=html
 
 * workflow
 
 Basically, removing the base class (Assertion) will give lots of
 errors. And when there is no more errors, then you are done with it.
 
 You might want to mark your ownership on the spreadsheet before
 you actually start working on them. I'll release the ownership
 if some of them are locking.
 
 If you have commit access, let's just check in. Otherwise, post
 your changes. (attachment, monoport, etc.)
 
 One sort of concern is that, if you are actively maintaining some code
 files and making changes in such old test files, please mark them as
 you don't want them changed.
 We don't have to do this conversion task perfectly right now. (And
 of course you don't have to do upgrade task by yourself because of
 marking them.)
 
 * starting
 
 If you are willing to join the task force, please drop me a line
 and/or post to the list (here) :)
 
 I'll share the spreadsheet so that you can edit the spreadsheet.
 If you don't have Google account, I'll update it instead (with
 possible delay).
 
 Atsushi Eno
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 

-- 
View this message in context: 
http://www.nabble.com/nunit-test-upgrading-task-force-tp24160673p24163520.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Robert Jordan
Stifu wrote:
 We could automate the change using a regexp and do a massive replace, no?
 Using Notepad++ (http://notepad-plus.sourceforge.net/uk/regExpList.php),
 this seems to work fine:
 
 Find:
 AssertEquals \((.+[^,]),(.+[^,]), (.+[^,])\);
 
 Replace with:
 Assert.AreEqual (\2, \3, \1);
 
 Needs a bit more work to remove the  : Assertion part, but that's the
 idea.
 What do you think?

I believe Atsushi does not care how this conversion is performed
as long as he doesn't have to do on his own. You may use a regexp
or a farm of typing monkeys as long you just do it (TM) :)

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Stifu

Well, I don't have write access myself, so just giving ideas.


Robert Jordan wrote:
 
 I believe Atsushi does not care how this conversion is performed
 as long as he doesn't have to do on his own. You may use a regexp
 or a farm of typing monkeys as long you just do it (TM) :)
 
 Robert
 

-- 
View this message in context: 
http://www.nabble.com/nunit-test-upgrading-task-force-tp24160673p24164426.html
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Levi Campbell
I'd be more than happy to help with the upgrade, just tell me which ones you
want me to do.

-- 
Levi Campbell levicc00...@gmail.com
GPG key ID: 7710A5E7
Casey Stengelhttp://www.brainyquote.com/quotes/authors/c/casey_stengel.html
- All right everyone, line up alphabetically according to your
height.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Atsushi Eno
Oh, yes Robert is right. I haven't actually tried if it automated
rewrite is possible (and safe). If it is possible just with a script,
that's awesome :) Just put patches and script somewhere (you don't
need write access for that).

Atsushi Eno

Stifu wrote:
 Well, I don't have write access myself, so just giving ideas.
 
 
 Robert Jordan wrote:
 I believe Atsushi does not care how this conversion is performed
 as long as he doesn't have to do on his own. You may use a regexp
 or a farm of typing monkeys as long you just do it (TM) :)

 Robert

 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Atsushi Eno
Thanks! I have added you to the spreadsheet editor. Please pick
blank ones, mark as yours (you are going to change), and start
upgrading.

Atsushi Eno

Levi Campbell wrote:
 I'd be more than happy to help with the upgrade, just tell me which ones 
 you want me to do.
 
 -- 
 Levi Campbell levicc00...@gmail.com mailto:levicc00...@gmail.com
 GPG key ID: 7710A5E7
 Casey Stengel 
 http://www.brainyquote.com/quotes/authors/c/casey_stengel.html  - All 
 right everyone, line up alphabetically according to your height.
 
 
 
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Atsushi Eno
Rodrigo gave another input that we will have to add [Test] and
[TestFixture] in case they are missing.

Atsushi Eno

Atsushi Eno wrote:
 Oh, yes Robert is right. I haven't actually tried if it automated
 rewrite is possible (and safe). If it is possible just with a script,
 that's awesome :) Just put patches and script somewhere (you don't
 need write access for that).
 
 Atsushi Eno
 
 Stifu wrote:
 Well, I don't have write access myself, so just giving ideas.


 Robert Jordan wrote:
 I believe Atsushi does not care how this conversion is performed
 as long as he doesn't have to do on his own. You may use a regexp
 or a farm of typing monkeys as long you just do it (TM) :)

 Robert

 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] nunit test upgrading task force

2009-06-23 Thread Charlie Poole
Hi,

What you described below, plus the later comment about
adding TestFixture and test, should work OK. If there
are other types of asserts, you'll need to translate
them. I'm happy to take any questions (list or direct
email) of the nature What's the best way ...

Also, even though I called 2.4.8 the last 2.4 release,
I'd be glad to to a 2.4.9 for Mono if there should be
any problems that are easy to fix.

Charlie
 
PS: If you find (using NUnit 2.4.x) that anything is 
marked Obsolete, you can pretty much count that it's 
already gone in 2.5.


 -Original Message-
 From: mono-devel-list-boun...@lists.ximian.com 
 [mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf 
 Of Atsushi Eno
 Sent: Monday, June 22, 2009 11:35 PM
 To: mono-devel-list@lists.ximian.com; Mono Mailing List
 Subject: [Mono-dev] nunit test upgrading task force
 
 Hi,
 
 I'm thinking if we can upgrade our nunit tests to eliminate 
 derivation from Assertion (such as eliminating AssertEquals), 
 to make our tests ready for future versions of NUnit.
 
 The task is very easy: if there is a test class that looks like
 
  [TestFixture]
  public class FooTest : Assertion
  {
  [Test]
  public void FooBar ()
  {
  AssertEquals (#1, str1, str2);
  }
  }
 
 rewrite it like:
 
  [TestFixture]
  public class FooTest
  {
  [Test]
  public void FooBar ()
  {
  Assert.AreEqual (str1, str2, #1);
  }
  }
 
 I tried to count it by grep AssertEquals, and there were 
 8000 lines in corlib, 1000 lines in System, 1500 lines in 
 Sys.XML, and so on.
 
 So, it is a simple but massive task that I cannot do it by myself.
 But if we can hack a volunteer team from here it would be possible.
 
 If you can join the effort, you are welcome :)
 
 * list of the files
 
 I have made an easy list of such old test files on a spreadsheet:
 http://spreadsheets.google.com/pub?key=rkWl-ZQHJvcu6tkJOeFFg3A
 output=html
 
 * workflow
 
 Basically, removing the base class (Assertion) will give lots 
 of errors. And when there is no more errors, then you are 
 done with it.
 
 You might want to mark your ownership on the spreadsheet 
 before you actually start working on them. I'll release the 
 ownership if some of them are locking.
 
 If you have commit access, let's just check in. Otherwise, 
 post your changes. (attachment, monoport, etc.)
 
 One sort of concern is that, if you are actively maintaining 
 some code files and making changes in such old test files, 
 please mark them as you don't want them changed.
 We don't have to do this conversion task perfectly right now. 
 (And of course you don't have to do upgrade task by yourself 
 because of marking them.)
 
 * starting
 
 If you are willing to join the task force, please drop me a 
 line and/or post to the list (here) :)
 
 I'll share the spreadsheet so that you can edit the spreadsheet.
 If you don't have Google account, I'll update it instead 
 (with possible delay).
 
 Atsushi Eno
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list