Skip to content

Commit 7cb8e7d

Browse files
author
Omar Tawfik
committed
Merge pull request #1 from Microsoft/master
Tweaks for internal build
2 parents d1f13d3 + 82eac8b commit 7cb8e7d

File tree

5 files changed

+48
-18
lines changed

5 files changed

+48
-18
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
4+
<supportedRuntime version="v4.5"/>
5+
<supportedRuntime version="v4.0"/>
56
</startup>
67
</configuration>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
4+
<supportedRuntime version="v4.5"/>
5+
<supportedRuntime version="v4.0"/>
56
</startup>
67
</configuration>

vsintegration/src/unittests/TestLib.LanguageService.fs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,13 @@ type LanguageServiceBaseTests() =
354354
GlobalFunctions.AddAssemblyReference(proj, ref)
355355

356356
/// Called per test run
357+
#if NUNIT_V2
358+
[<TestFixtureSetUp>]
359+
member this.TestFixtureSetUp() =
360+
#else
357361
[<OneTimeSetUp>]
358362
member this.Init() =
363+
#endif
359364
match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler with
360365
| Some(folder) ->
361366
let fscPath = Path.Combine(folder,"fsc.exe")
@@ -389,8 +394,13 @@ type LanguageServiceBaseTests() =
389394
defaultSolution <- GlobalFunctions.CreateSolution(defaultVS)
390395
cache.Clear()
391396

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

vsintegration/src/unittests/Tests.LanguageService.IncrementalBuild.fs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ namespace UnitTests.Tests.LanguageService
55
open System
66
open System.IO
77
open NUnit.Framework
8+
#if NUNIT_V2
9+
#else
810
open NUnit.Framework.Constraints
11+
#endif
912
open Salsa.Salsa
1013
open Salsa.VsOpsUtils
1114
open Microsoft.FSharp.Compiler
@@ -507,6 +510,12 @@ type IncrementalBuild() =
507510

508511
()
509512

513+
#if NUNIT_V2
514+
[<Test;ExpectedException(typeof<Exception>)>]
515+
member public rb.DuplicateExpressionNamesNotAllowed() =
516+
let DoIt s = s
517+
()
518+
#else
510519
[<Test>]
511520
member public rb.DuplicateExpressionNamesNotAllowed() =
512521
Assert.That((fun () -> let DoIt s = s
@@ -519,6 +528,7 @@ type IncrementalBuild() =
519528

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

523533
[<Test>]
524534
member public rb.OneToOneWorks() =

vsintegration/src/unittests/Tests.ProjectSystem.Miscellaneous.fs

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -329,24 +329,32 @@ type Miscellaneous() =
329329
let errors = List.filter (fun (s:string) -> s.Contains(expectedError)) !outputWindowPaneErrors
330330
AssertEqual 1 (List.length errors)
331331
)
332-
333-
332+
333+
334+
#if NUNIT_V2
335+
336+
member public this.``DebuggingDLLFailsFunc``() =
337+
this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(["foo.fs"], [],
338+
this.MSBuildProjectBoilerplate "Library",
339+
(fun project ccn projFileName ->
340+
ccn((project :> IVsHierarchy), "Debug|Any CPU")
341+
let fooPath = Path.Combine(project.ProjectFolder, "foo.fs")
342+
File.AppendAllText(fooPath, "#light")
343+
let mutable configurationInterface : IVsCfg = null
344+
let hr = project.ConfigProvider.GetCfgOfName("Debug", "Any CPU", &configurationInterface)
345+
AssertEqual VSConstants.S_OK hr
346+
let config = configurationInterface :?> ProjectConfig
347+
config.DebugLaunch(0ul) |> ignore
348+
()
349+
))
350+
351+
[<Test>][<ExpectedException (typeof<ClassLibraryCannotBeStartedDirectlyException>)>]
352+
member public this.``DebuggingDLLFails``() = this.``DebuggingDLLFailsFunc``()
353+
#else
334354
[<Test>]
335355
member public this.``DebuggingDLLFails``() =
336-
Assert.That((fun () -> this.MakeProjectAndDoWithProjectFileAndConfigChangeNotifier(["foo.fs"], [],
337-
this.MSBuildProjectBoilerplate "Library",
338-
(fun project ccn projFileName ->
339-
ccn((project :> IVsHierarchy), "Debug|Any CPU")
340-
let fooPath = Path.Combine(project.ProjectFolder, "foo.fs")
341-
File.AppendAllText(fooPath, "#light")
342-
let mutable configurationInterface : IVsCfg = null
343-
let hr = project.ConfigProvider.GetCfgOfName("Debug", "Any CPU", &configurationInterface)
344-
AssertEqual VSConstants.S_OK hr
345-
let config = configurationInterface :?> ProjectConfig
346-
config.DebugLaunch(0ul) |> ignore
347-
()
348-
))
349-
), NUnit.Framework.Throws.TypeOf(typeof<ClassLibraryCannotBeStartedDirectlyException>))
356+
Assert.That((fun () -> this.``DebuggingDLLFailsFunc``()), NUnit.Framework.Throws.TypeOf(typeof<ClassLibraryCannotBeStartedDirectlyException>))
357+
#endif
350358

351359
[<Test>]
352360
member public this.``DebuggingEXESucceeds``() =

0 commit comments

Comments
 (0)