Skip to content

Commit

Permalink
Merge pull request #1 from Microsoft/master
Browse files Browse the repository at this point in the history
Tweaks for internal build
  • Loading branch information
Omar Tawfik committed Nov 24, 2015
2 parents d1f13d3 + 82eac8b commit 7cb8e7d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 18 deletions.
3 changes: 2 additions & 1 deletion lkg/FSharp-4.0.30319.1/bin/FsLex.exe.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
<supportedRuntime version="v4.5"/>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
3 changes: 2 additions & 1 deletion lkg/FSharp-4.0.30319.1/bin/FsYacc.exe.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
<supportedRuntime version="v4.5"/>
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
10 changes: 10 additions & 0 deletions vsintegration/src/unittests/TestLib.LanguageService.fs
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,13 @@ type LanguageServiceBaseTests() =
GlobalFunctions.AddAssemblyReference(proj, ref)

/// Called per test run
#if NUNIT_V2
[<TestFixtureSetUp>]
member this.TestFixtureSetUp() =
#else
[<OneTimeSetUp>]
member this.Init() =
#endif
match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler with
| Some(folder) ->
let fscPath = Path.Combine(folder,"fsc.exe")
Expand Down Expand Up @@ -389,8 +394,13 @@ type LanguageServiceBaseTests() =
defaultSolution <- GlobalFunctions.CreateSolution(defaultVS)
cache.Clear()

#if NUNIT_V2
[<TestFixtureTearDown>]
member this.Shutdown() =
#else
[<OneTimeTearDown>]
member this.Cleanup() =
#endif
if box currentVS <> box defaultVS then
failwith "LanguageServiceBaseTests.Shutdown was called when 'active' instance of VS is not 'default' one - this may denote that tests contains errors"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ namespace UnitTests.Tests.LanguageService
open System
open System.IO
open NUnit.Framework
#if NUNIT_V2
#else
open NUnit.Framework.Constraints
#endif
open Salsa.Salsa
open Salsa.VsOpsUtils
open Microsoft.FSharp.Compiler
Expand Down Expand Up @@ -507,6 +510,12 @@ type IncrementalBuild() =

()

#if NUNIT_V2
[<Test;ExpectedException(typeof<Exception>)>]
member public rb.DuplicateExpressionNamesNotAllowed() =
let DoIt s = s
()
#else
[<Test>]
member public rb.DuplicateExpressionNamesNotAllowed() =
Assert.That((fun () -> let DoIt s = s
Expand All @@ -519,6 +528,7 @@ type IncrementalBuild() =

let e = Eval "Output" b
()), NUnit.Framework.Throws.TypeOf(typeof<Exception>))
#endif

[<Test>]
member public rb.OneToOneWorks() =
Expand Down
40 changes: 24 additions & 16 deletions vsintegration/src/unittests/Tests.ProjectSystem.Miscellaneous.fs
Original file line number Diff line number Diff line change
Expand Up @@ -329,24 +329,32 @@ type Miscellaneous() =
let errors = List.filter (fun (s:string) -> s.Contains(expectedError)) !outputWindowPaneErrors
AssertEqual 1 (List.length errors)
)




#if NUNIT_V2

member public this.``DebuggingDLLFailsFunc``() =
this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(["foo.fs"], [],
this.MSBuildProjectBoilerplate "Library",
(fun project ccn projFileName ->
ccn((project :> IVsHierarchy), "Debug|Any CPU")
let fooPath = Path.Combine(project.ProjectFolder, "foo.fs")
File.AppendAllText(fooPath, "#light")
let mutable configurationInterface : IVsCfg = null
let hr = project.ConfigProvider.GetCfgOfName("Debug", "Any CPU", &configurationInterface)
AssertEqual VSConstants.S_OK hr
let config = configurationInterface :?> ProjectConfig
config.DebugLaunch(0ul) |> ignore
()
))

[<Test>][<ExpectedException (typeof<ClassLibraryCannotBeStartedDirectlyException>)>]
member public this.``DebuggingDLLFails``() = this.``DebuggingDLLFailsFunc``()
#else
[<Test>]
member public this.``DebuggingDLLFails``() =
Assert.That((fun () -> this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(["foo.fs"], [],
this.MSBuildProjectBoilerplate "Library",
(fun project ccn projFileName ->
ccn((project :> IVsHierarchy), "Debug|Any CPU")
let fooPath = Path.Combine(project.ProjectFolder, "foo.fs")
File.AppendAllText(fooPath, "#light")
let mutable configurationInterface : IVsCfg = null
let hr = project.ConfigProvider.GetCfgOfName("Debug", "Any CPU", &configurationInterface)
AssertEqual VSConstants.S_OK hr
let config = configurationInterface :?> ProjectConfig
config.DebugLaunch(0ul) |> ignore
()
))
), NUnit.Framework.Throws.TypeOf(typeof<ClassLibraryCannotBeStartedDirectlyException>))
Assert.That((fun () -> this.``DebuggingDLLFailsFunc``()), NUnit.Framework.Throws.TypeOf(typeof<ClassLibraryCannotBeStartedDirectlyException>))
#endif

[<Test>]
member public this.``DebuggingEXESucceeds``() =
Expand Down

0 comments on commit 7cb8e7d

Please sign in to comment.