39 Commits
Author SHA1 Message Date
Rolf Bjarne Kvinge 632bb59b21 [System] Implement a helper function to create unique temporary directories and use it in tests. (#11831)
While working on PR #11829 I stress-tested the tests by running multiple test
runs in parallel, and it turned out that many tests were not parallel-safe,
because they used the same temporary file names and ended up stomping on
eachother.

So I implemented a helper method that creates a guaranteed unique temporary
directory, and I've changed all tests to use this new helper method.
2018-12-04 16:43:23 +01:00
Marcos Henrich 863dc73d19 [bcl] Add NUnitHelper.cs with API not in nunit-lite
NUnitHelper.cs adds CollectionAssert, FileAssert, StringAssert.

Also adds AssertHelper class with methods that are not part of nunitlite
Assert class.
2016-10-29 14:09:33 +02:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Atsushi Eno cb58cc98bb [CodeDom] disable wrong test (see [Ignore] comment). 2015-04-15 03:29:06 +09:00
Alexander Köplinger d4d7374efc [bcl] Remove ONLY_1_1 defines from class libs
This is not used anymore.
2015-01-21 17:18:30 +01:00
Alexander Köplinger 746650d1b9 [bcl] Remove more NET_2_0 checks from class libs 2015-01-17 05:45:39 +01:00
Miguel de Icaza c6ab899595 [System] Fix most warnings on the System test suite 2014-09-24 10:43:46 -04:00
Marek Safar dfae4bf027 Generate CodeSnippetTypeMember with correct separators. Fixes #8927 2012-12-15 12:46:59 +01:00
Ilker Cetinkaya d331ccd21f Fixed space indents to tabs to adhere to Mono coding guidelines. 2012-01-14 17:07:00 +01:00
Ilker Cetinkaya a461bcf735 Better unit test case and cause description. Added references to CSharp generator and tests. 2012-01-13 20:24:49 +01:00
Ilker Cetinkaya fcdbc0df12 Added new test for CodeGenerator.GenerateFromCompileUnit. Verifies that CS1529 rule (imports first) is being obeyed by generator. Test signals, fixup required. 2012-01-12 23:13:47 +01:00
Ilker Cetinkaya dcf5db5021 changed namespace to MonoTests.* in order to be captured by TEST_HARNESS_FLAGS make option. 2012-01-12 22:37:21 +01:00
Jonathan Pryor 3a3269001b * System.CodeDom.Compiler/CodeGenerator.cs: Clear out the current member
when beginning Type generation.  This prevents "invalid" 
	  `#endregion`s; if the CodeGenerator instance is reused for multiple 
	  types, the last member of the first type has an EndDirective, then 
	  the EndDirectvies will be generated before any members of the 2nd 
	  type.  Don't do that.
	* Test/System.CodeDom.Compiler/CodeGeneratorTest.cs: Add some testing 
	  for CodeRegionDirectives.

svn path=/trunk/mcs/; revision=155321
2010-04-13 18:48:04 +00:00
Gert Driesen aff3d9ea90 * CSharpCodeGenerator.cs: On 2.0 profile, add support for params
keyword when System.ParamArrayAttribute custom attribute is added.
Fixes bug #387877.
* CodeGeneratorFromTypeTestBase.cs: Added tests for
System.ParamArrayAttribute custom attribute.
* CodeGeneratorFromTypeTest.cs: Added tests for
System.ParamArrayAttribute custom attribute.

svn path=/trunk/mcs/; revision=102885
2008-05-09 20:49:59 +00:00
Gert Driesen 7bf14cac1d * VBCodeGenerator.cs: Fixed generated code for abstract properties.
* CodeGeneratorFromTypeTest.cs: Added tests for static and abstract
property.
* ComponentConverterTests.cs: Allow test to be compiled using csc 1.x.
* ExecutorTest.cs: Use Assert.Ignore when ping is not available.
Avoid using ExpectedException in ExecWait test, and added link to
MS bug report.

svn path=/trunk/mcs/; revision=102229
2008-04-30 18:41:21 +00:00
Jb Evain cb82378b20 add test for static properties
svn path=/trunk/mcs/; revision=100238
2008-04-09 15:58:53 +00:00
Jb Evain b93255ccb4 in System.CodeDom.Compiler:
2008-04-08  Jb Evain  <[email protected]>

	* CodeGeneratorFromTypeTestBase.cs: add a generator for
	abstract properties.

in Microsoft.CSharp:
2008-04-08  Jb Evain  <[email protected]>

	* CodeGeneratorFromTypeTest.cs: add test for abstract properties.

svn path=/trunk/mcs/; revision=100132
2008-04-08 19:12:41 +00:00
Zoltan Varga 0a4d29f995 2008-01-29 Zoltan Varga <[email protected]>
* ExecutorTest.cs (ExecWait_NullTempFileCollection): Fix the cmdNoFound case.

svn path=/trunk/mcs/; revision=94304
2008-01-29 19:41:01 +00:00
Zoltan Varga 342153b4ef 2008-01-29 Zoltan Varga <[email protected]>
* ExecutorTest.cs: Handle cases when ping is not in the PATH, or when it
	returns a non standard error code.

svn path=/trunk/mcs/; revision=94211
2008-01-29 00:55:13 +00:00
Rolf Bjarne Kvinge 4c1053be1e * Test/Microsoft.CSharp/CodeGeneratorFromTypeTest.cs,
Test/System.CodeDom.Compiler/CodeGeneratorFromTypeTestBase.cs,
  Test/Microsoft.VisualBasic/CodeGeneratorFromTypeTest.cs: Added
  PartialTypeTest.
* Microsoft.VisualBasic/VBCodeGenerator.cs: Split array of keywords in
  two, one for 1.1 and one for 2.0. Add some 2.0 specific keywords.
  When writing a type, escape the name of the type if necessary.
  Output "Partial" if a type is partial.

svn path=/trunk/mcs/; revision=91780
2007-12-21 18:45:39 +00:00
Miguel de Icaza 56f425ec1e 2007-03-05 Peter Dettman <[email protected]>
* Codegenerator.cs: I noticed an `unreachable code' warning while
	building Mono:

	System.CodeDom.Compiler/CodeGenerator.cs(1229,42): warning CS0162:
	Unreachable code detected

	This turned out to be in the method
	CodeGenerator.IsValidLanguageIndependentIdentifier, which was
	broken.

	The following patch contains a unit test to demonstrate the
	problem (checked against MS.NET), and a fix to CodeGenerator.cs.

svn path=/trunk/mcs/; revision=73782
2007-03-06 04:59:30 +00:00
Atsushi Eno 62a6678fad 2007-01-18 Atsushi Enomoto <[email protected]>
* CodeTypeReference.cs :
	  Support generic type definition in .ctor(Type)
	  Handle generic type in straightforward way in .ctor(Type), no need
	  to do ToString() and Parse().
	  Supply "`n" in .ctor(string,params CodeTypeReference[]).

	* CSharpCodeGenerator.cs : for GenericTypeParameter, GetTypeOutput()
	  should just print its name.
	  For generic type definition, print "<>". OutputTypeArguments() was
	  also causing IndexOutOfRangeException.

	* CodeGeneratorFromTypeTestBase.cs :
	  added GenerateGenericCodeTypeReferences() for generic type test.

	* CodeGeneratorFromTypeTest.cs :
	  Added test for generic type references output.

	* CodeTypeReferenceTest.cs :
	  Fixed generic type tests and let them involved in the actual tests.
	  Added some more generic type tests, including generic type
	  definition.


svn path=/trunk/mcs/; revision=71244
2007-01-18 10:23:33 +00:00
Gert Driesen e4e516d410 * CodeGeneratorFromStatementTest.cs: Added tests for
CodeAssignStatement, CodeAttachEventStatement,
CodeConditionStatement, CodeExpressionStatement,
CodeIterationStatement, CodeLabeledStatement,
CodeMethodReturnStatement, CodeRemoveEventStatement,
CodeSnippetStatement, CodeStatement, CodeVariableDeclarationStatement.
* CodeRemoveEventStatementTest.cs: Added tests for ctors.
* IndentedTextWriterTest.cs: Added tests for Indent property.
* CodeGeneratorFromStatementTest.cs: Added tests for
CodeAssignStatement, CodeAttachEventStatement, CodeConditionStatement,
CodeExpressionStatement, CodeIterationStatement,
CodeLabeledStatement, CodeMethodReturnStatement,
CodeRemoveEventStatement and CodeSnippetStatement.
* CSharpCodeGenerator.cs: No longer output semicolon and newline for
CodeVariableDeclarationStatement in for statement, fixes #75292.
Fixed NRE in GenerateEventReferenceExpression. Cosmetic changes to
code generated for iteration to match MS.NET. Temporary reduce
indentation for label and no longer escape label if its a keyword.
* CodeRemoveEventStatement.cs: Event returns new CodeEventReference
if underlying value is null.
* System_test.dll.sources: Added CodeRemoveEventStatementTest.cs from
System.CodeDom.
* CodeGenerator.cs: Corrected line endings. Set eol-style to native.
* IndentedTextWriter.cs: Indent can no longer become negative.
* VBCodeGenerator.cs: Fixed NRE in GenerateEventReferenceExpression,
and escape event name. Indent statements for iteration. Avoid
ArgumentNullException if expression is not set for CodeReturnStatement.
Temporary reduce indentation for label, and fixed ArgumentNullException
if no statement is set. Cosmetic changes to code generated for
condition to match MS.NET. In OutputTypeNamePair, escape name.

svn path=/trunk/mcs/; revision=53703
2005-11-30 18:54:17 +00:00
Sebastien Pouliot 3ddf81911b 2005-11-30 Sebastien Pouliot <[email protected]>
* CodeCompilerCas.cs: MS doesn't demand EnvironmentPermission under 
	1.x.


svn path=/trunk/mcs/; revision=53688
2005-11-30 15:27:48 +00:00
Gert Driesen fe32d6af83 * CodeGeneratorFromExpressionTest.cs: Added test for
CodeParameterDeclarationExpression.
* CodeGeneratorFromTypeTest.cs: Modified tests to check result
for zero-length event, field and parameter name.
* CodeGeneratorFromStatementTest.cs: Added CodeCommentStatement,
CodeThrowExceptionStatement, CodeGotoStatement and
CodeTryCatchFinallyStatement tests.
* CodeGeneratorFromTypeTestBase.cs: Modified GetMethodMembersType3 to
add parameter with no name.
* CodeGeneratorTestBase.cs: Removed Code property, added Generate
overload taking CodeGeneratorOptions, added NewLine property.
* CodeGeneratorCompileUnitTest.cs: Use Generate method instead of
Code property.
* CodeGeneratorFromExpressionTest.cs: Added test for
CodeParameterDeclarationExpression.
* CodeGeneratorFromTypeTest.cs: Added tests for __exception name that
is output for zero-length field, event and parameter name in 2.0
profile.
* CodeGeneratorFromStatementTest.cs: Added.
* CSharpCodeGenerator.cs: Fixed GenerateComment to also write
comment chars for carriage-return (and skip linefeed, if its the
next character). Fixed output for TryCatchFinallyStatement. Fixed
GotoStatement to end with newline.
* VBCodeGenerator.cs: Fixed NullReferenceException if no ToThrow
expression is set for CodeThrowExceptionStatement. Fixed
GenerateComment to output comment chars for carriage-returns and
linefeed characters. Modified code generated for
CodeTryCatchFinallyStatement to match MS.NET. Fixed code generated
for CodeGotoStatement to match MS.NET. On 2.0 profile, output
"__exception" if name is zero-length string in OutputTypeNamePair.

svn path=/trunk/mcs/; revision=53506
2005-11-26 16:23:45 +00:00
Sebastien Pouliot dd1baedb00 2005-11-02 Sebastien Pouliot <[email protected]>
* CodeCompilerCas.cs: New. CAS unit tests.
	* ExecutorCas.cs: New. CAS unit tests.
	* ExecutorTest.cs: New. Unit tests for Executor.


svn path=/trunk/mcs/; revision=52476
2005-11-02 16:15:19 +00:00
Sebastien Pouliot f5ca0afc55 2005-11-01 Sebastien Pouliot <[email protected]>
* CodeGeneratorCas.cs: New. CAS unit tests.


svn path=/trunk/mcs/; revision=52456
2005-11-01 20:05:52 +00:00
Sebastien Pouliot 2cf82ed16d 2005-11-01 Sebastien Pouliot <[email protected]>
* CodeDomProviderCas.cs: New. CAS unit tests.


svn path=/trunk/mcs/; revision=52445
2005-11-01 15:27:07 +00:00
Gert Driesen 4a813ed0db * CodeGeneratorFromTypeTest.cs: Added tests for CodeEntryPointMethod
and bug #76580.
* CodeGeneratorTestBase.cs: Set eol-style to native.
* CodeGeneratorTest.cs: Set eol-style to native.
* CodeGeneratorFromTypeTestBase.cs: Added tests for
CodeEntryPointMethod and bug #76580. Set eol-style to native.
* IndentedTextWriterTest.cs: Set eol-style to native.
* CodeGeneratorFromTypeTest.cs: Added tests for CodeEntryPointMethod
and bug #76580.
* CSharpCodeGenerator.cs: Use fixed signature for entrypoint method
on 1.0 profile. On 2.0 profile output custom attributes, and return
type. On 1.0 profile, also replace + with dot (for nested types).
Fixes bug #76580. Set eol-style to native.
* CSharpCodeCompiler.cs: Set eol-style to native.
* CSharpCodeProvider.cs: Set eol-style to native.
* VBCodeGenerator.cs: Use fixed signature for entrypoint method.
Only output attributes on 2.0 profile. Replace + with dot in type
name (for nested types). Fixes bug #76580.


svn path=/trunk/mcs/; revision=52344
2005-10-28 18:05:39 +00:00
Sebastien Pouliot 67c4e7affa 2005-10-25 Sebastien Pouliot <[email protected]>
* CompilerErrorCas.cs: Under 1.x CompilerError is protected by a 
	LinkDemand for Unrestricted.
	* CompilerErrorCollectionCas.cs: Under 1.x CompilerError is protected
	by a LinkDemand for Unrestricted.
	* TempFileCollectionCas.cs: Moved precompiler directive to the right
	method (to ignore a test under MS 1.x).


svn path=/trunk/mcs/; revision=52193
2005-10-25 18:04:38 +00:00
Sebastien Pouliot c1354454c0 2005-10-25 Sebastien Pouliot <[email protected]>
* TempFileCollectionCas.cs: New. CAS unit tests.
	* TempFileCollectionTest.cs: New. Very basic tests to check the 
	behaviour of the TempDir property.


svn path=/trunk/mcs/; revision=52180
2005-10-25 14:27:48 +00:00
Sebastien Pouliot e29f5de63c 2005-10-24 Sebastien Pouliot <[email protected]>
* CodeGeneratorOptionsCas.cs: New. CAS unit tests.
	* CodeGeneratorOptionsTest.cs: New. Unit tests.
	* CodeParserCas.cs: New. CAS unit tests.
	* CompilerErrorCas.cs: New. CAS unit tests.
	* CompilerErrorCollectionCas.cs: New. CAS unit tests.
	* CompilerInfoCas.cs: New. CAS unit tests.
	* CompilerParametersCas.cs: New. CAS unit tests.
	* CompilerResultsCas.cs: New. CAS unit tests.
	* GeneratedCodeAttributeCas.cs: New. CAS unit tests.
	* GeneratedCodeAttributeTest.cs: New. Unit tests.
	* IndentedTextWriterCas.cs: New. CAS unit tests.


svn path=/trunk/mcs/; revision=52160
2005-10-25 01:04:26 +00:00
Gert Driesen ad78342af9 * CodeGeneratorTestBase.cs: Generate now returns code that was output,
and takes CodeGeneratorOptions instance in order to support testing
bracing style.
* CodeGeneratorFromCompileUnitTest.cs: Added tests for C bracing style.
* CodeGeneratorFromNamespaceTest.cs: Added tests for C bracing style.
* CodeGeneratorFromExpressionTest.cs: Clean up.
* CodeGeneratorFromTypeTest.cs: Added tests for C bracing style.
* CodeGeneratorTestBase.cs: No longer keep instance of StringWriter to
allow GenerateCodeFromType to be executed multiple times with relying
on user to reset writer. Allow CodeGeneratorOptions to be passed in,
in order to support bracing style tests.
* CodeGeneratorFromTypeTestBase.cs: Modify Generate* methods to take
CodeGeneratorOptions instance and pass it on to GenerateCodeFromType.
* CodeGeneratorFromTypeTest.cs: Reworked tests to pass
CodeGeneratorOptions to Generate* methods.
* CodeGeneratorTestBase.cs: Generate now returns code that was output,
and take CodeGeneratorOptions instance in order to support testing
bracing style.
* CodeGeneratorFromCompileUnitTest.cs: Added tests for C bracing style.
* CodeGeneratorFromNamespaceTest.cs: Added tests for C bracing style.
* CodeGeneratorFromExpressionTest.cs: Clean up.
* CodeGeneratorFromTypeTest.cs: Added tests for C bracing style.
* CSharpCodeGenerator.cs: Support C bracing style. Fixes bug #76286.

svn path=/trunk/mcs/; revision=51753
2005-10-15 16:41:32 +00:00
Gert Driesen 2ae96ccc57 * CodeGeneratorFromTypeTest.cs: Added NewSlot tests.
* CSharpCodeGenerator.cs: Fixed code generated for NewSlot members.
* CodeGeneratorFromTypeTestBase.cs: Added NewSlot tests.
* CodeGenerator.cs: In OutputMemberScopeModifier, only output "new" modifier 
in 2.0 profile.
* VBCodeGenerator.cs: Fixed code generated for NewSlot members.

svn path=/trunk/mcs/; revision=47859
2005-07-30 16:27:36 +00:00
Gert Driesen cafc6003d6 * CodeGeneratorFromTypeTest.cs: Added BaseTypes and TypeConstructor
tests. Added enum, interface and delegate tests.
* CodeTypeDelegateTest.cs: Added tests for BaseTypes and ReturnType.
* CodeGeneratorTest.cs: Removed duplicate import of NUNit.Framework namespace.
* CodeGeneratorFromTypeTestBase.cs: Added BaseTypes and TypeConstructor tests.
* CodeGeneratorFromTypeTest.cs: Added BaseTypes and TypeConstructor
tests. Enabled enum, interface and delegate tests.
* CSharpCodeGenerator.cs: Fixed generated code for enums, interfaces
and delegates to match MS.NET.
* CodeTypeReference.cs: Added internal IsInterface property.
* CodeTypeDelegate.cs: System.Delegate is base type, and make sure
ReturnType is initialized.
* System_test.dll.sources: Added CodeTypeDelegateTest.cs from System.CodeDom.
* CodeGenerator.cs: Threat delegates like any other type.
* VBCodeGenerator.cs: Fixed generated code for enums, interfaces and
delegates to match MS.NET.

svn path=/trunk/mcs/; revision=47604
2005-07-24 12:19:26 +00:00
Gert Driesen 16b04eb9a6 * CodeGeneratorTest.cs: Added unit tests for CodeGenerator.IsCurrent*.
* System_test.dll.sources: Added CodeGeneratorTest.cs from 
System.CodeDom.Compiler.
* CodeGenerator.cs: Fixed IsCurrentClass to return false for delegate.

svn path=/trunk/mcs/; revision=47500
2005-07-21 09:33:05 +00:00
Gert Driesen 7f51e83be6 * CodeGeneratorFromTypeTestBase.cs: Base class for unit tests for
CodeGenerator.GenerateCodeFromType.
* CodeGeneratorTestBase.cs: Base class for CodeGenerator unit tests.
* CodeGeneratorFromTypeTest.cs: Inherit from 
System.CodeDom.CodeGeneratorFromTypeTestBase. Added testfixture
for testing enum, interface and delegate, but for now these are
marked NotWorking.
* System_test.dll.sources: Added CodeGeneratorFromTypeTestBase.cs
and CodeGeneratorTestBase.cs from System.CodeDom.Compiler.

svn path=/trunk/mcs/; revision=47496
2005-07-21 07:56:42 +00:00
Gert Driesen 6a39faee00 * IndentedTextWriterTest.cs: added test for IndentedTextWriter
svn path=/trunk/mcs/; revision=29460
2004-06-13 19:04:46 +00:00
Gert Driesen b7a26d1c96 *** empty log message ***
svn path=/trunk/mcs/; revision=29459
2004-06-13 19:04:27 +00:00