Skip to content

Commit

Permalink
Some cleanup/simplification related to Tests namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilk committed Dec 19, 2012
1 parent 7767ce0 commit 220b5c8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
9 changes: 0 additions & 9 deletions src/Core/App/Application.cs
Expand Up @@ -162,15 +162,6 @@ compile code.


CompilerOptions compilerOptions = CreateCompilerOptions(commandLine); CompilerOptions compilerOptions = CreateCompilerOptions(commandLine);


#if DEBUG
if (compilerOptions.InternalTestMode) {
// HACK: Our tests are currently in the Tests subnamespace, which is now
// used as a pattern for writing unit tests. This hack allows postponing
// modifying all tests and baselines.
compilerOptions.TestsSubnamespace = "UnitTests";
}
#endif // DEBUG

string errorMessage; string errorMessage;
if (compilerOptions.Validate(out errorMessage) == false) { if (compilerOptions.Validate(out errorMessage) == false) {
ShowUsage(errorMessage); ShowUsage(errorMessage);
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Compiler/Compiler/MetadataBuilder.cs
Expand Up @@ -812,8 +812,8 @@ internal sealed class MetadataBuilder {


BuildType(typeSymbol, typeNode); BuildType(typeSymbol, typeNode);


if (namespaceSymbol.Name.EndsWith("." + _options.TestsSubnamespace, StringComparison.Ordinal) || if (namespaceSymbol.Name.EndsWith(".Tests", StringComparison.Ordinal) ||
(namespaceSymbol.Name.IndexOf("." + _options.TestsSubnamespace + ".", StringComparison.Ordinal) > 0)) { (namespaceSymbol.Name.IndexOf(".Tests.", StringComparison.Ordinal) > 0)) {
typeSymbol.SetTestType(); typeSymbol.SetTestType();
} }
} }
Expand Down
12 changes: 0 additions & 12 deletions src/Core/Compiler/CompilerOptions.cs
Expand Up @@ -26,8 +26,6 @@ public sealed class CompilerOptions {
private bool _minimize; private bool _minimize;
private ScriptInfo _scriptInfo; private ScriptInfo _scriptInfo;


private string _testsSubnamespace;

private bool _hasTestTypes; private bool _hasTestTypes;


// TODO: Get rid of internal test mode/type... // TODO: Get rid of internal test mode/type...
Expand All @@ -36,7 +34,6 @@ public sealed class CompilerOptions {


public CompilerOptions() { public CompilerOptions() {
_scriptInfo = new ScriptInfo(); _scriptInfo = new ScriptInfo();
_testsSubnamespace = "Tests";
} }


public ICollection<string> Defines { public ICollection<string> Defines {
Expand Down Expand Up @@ -150,15 +147,6 @@ public sealed class CompilerOptions {
} }
} }


public string TestsSubnamespace {
get {
return _testsSubnamespace;
}
set {
_testsSubnamespace = value;
}
}

public bool Validate(out string errorMessage) { public bool Validate(out string errorMessage) {
errorMessage = String.Empty; errorMessage = String.Empty;


Expand Down

0 comments on commit 220b5c8

Please sign in to comment.