Discussion:
Building nunit from source for the first time
shovavnik
2008-09-05 19:04:23 UTC
Permalink
I downloaded the most recent nunit source code from CVS and am trying to
build it.

I'm running this command on the command line:
nant debug net-2.0 build test

When I run this command, the build fails with the failure at the end
(snipped to the relevant failure). The error itself is "error CS0246: The
type or namespace name 'TestCases' could not be found (are you missing a
using directive or an assembly reference?)".

I opened up the VS2008 solution, which built just fine from within the IDE.
When I ran the tests using ReSharper's integrated unit test runner, a couple
hundred tests failed. The runner even crashed when it got to the
StackOverflowTestFixture.SimpleOverflow test.

So the big question is: what am I doing wrong?

Thanks!


Here's the snipped nant build output I promised :)


==================================================
[nant]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\nunit.framework.tests.build
build
Buildfile:
file:///c:/Projects/NUnit/nunit20/src/NUnitFramework/tests/nunit.framework.tests.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: build


build:

[csc] Compiling 55 files to
'c:\Projects\NUnit\nunit20\build\net\2.0\debug\tests\nunit.framework.tests.dll'.
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints\ConstraintTestBase.cs(16,16):
error CS0246: The type or namespace name 'TestCases' could not be found (are
you missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints\ConstraintTestBase.cs(22,16):
error CS0246: The type or namespace name 'TestCases' could not be found (are
you missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints\ConstraintTestBase.cs(62,16):
error CS0246: The type or namespace name 'TestCases' could not be found (are
you missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints\ConstraintTestBase.cs(76,16):
error CS0246: The type or namespace name 'TestCases' could not be found (are
you missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Syntax\InvalidCodeTests.cs(58,16):
error CS0246: The type or namespace name 'TestCases' could not be found (are
you missing a using directive or an assembly reference?)

BUILD FAILED


c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\nunit.framework.tests.build(69,6):
External Program Failed:
C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe (return code was 1)

Total time: 0.5 seconds.
========================================
Charlie Poole
2008-09-05 21:02:57 UTC
Permalink
Hi,
Post by shovavnik
I downloaded the most recent nunit source code from CVS and
am trying to build it.
nant debug net-2.0 build test
When I run this command, the build fails with the failure at
the end (snipped to the relevant failure). The error itself
is "error CS0246: The type or namespace name 'TestCases'
could not be found (are you missing a using directive or an
assembly reference?)".
A great example of a one error hiding another, and causing it
to build OK on my machine. If you open nunit.framework.build
in the src\NUnitFramework\framework directory and change
"FactoriesAttribute.cs" to "TestCasesAttribute.cs" it should
build correctly.
Post by shovavnik
I opened up the VS2008 solution, which built just fine from
within the IDE. When I ran the tests using ReSharper's
integrated unit test runner, a couple hundred tests failed.
The runner even crashed when it got to the
StackOverflowTestFixture.SimpleOverflow test.
Resharper doesn't use the NUnit test runner to run tests, so
it doesn't recognize many features added since around 2005.
This has tripped up a lot of people. ;-)
Post by shovavnik
So the big question is: what am I doing wrong?
You should be able to run tests after buildinng with either the
NAnt build or VS2008. But you'll have to use one of the
NUnit runners to do it.

Charlie
Post by shovavnik
Thanks!
Here's the snipped nant build output I promised :)
==================================================
[nant]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\nunit.frame
work.tests.build build
file:///c:/Projects/NUnit/nunit20/src/NUnitFramework/tests/nun
it.framework.tests.build
Target framework: Microsoft .NET Framework 2.0
Target(s) specified: build
[csc] Compiling 55 files to
'c:\Projects\NUnit\nunit20\build\net\2.0\debug\tests\nunit.fra
mework.tests.dll'.
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints
\ConstraintTestBase.cs(16,16): error CS0246: The type or
namespace name 'TestCases' could not be found (are you
missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints
\ConstraintTestBase.cs(22,16): error CS0246: The type or
namespace name 'TestCases' could not be found (are you
missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints
\ConstraintTestBase.cs(62,16): error CS0246: The type or
namespace name 'TestCases' could not be found (are you
missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Constraints
\ConstraintTestBase.cs(76,16): error CS0246: The type or
namespace name 'TestCases' could not be found (are you
missing a using directive or an assembly reference?)
[csc]
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\Syntax\Inva
lidCodeTests.cs(58,16): error CS0246: The type or namespace
name 'TestCases' could not be found (are you missing a using
directive or an assembly reference?)
BUILD FAILED
c:\Projects\NUnit\nunit20\src\NUnitFramework\tests\nunit.frame
C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe (return
code was 1)
Total time: 0.5 seconds.
========================================
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Loading...