Skip to content

Commit c7a4acf

Browse files
authored
Compiler tests cleanup, part 2 (#15724)
1 parent 07babc5 commit c7a4acf

File tree

4 files changed

+42
-50
lines changed

4 files changed

+42
-50
lines changed

eng/Build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ try {
565565
$bgJob = TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true
566566

567567
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
568-
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
568+
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.UnitTests\"
569569
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
570570
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
571571
TestUsingXUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"

tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@
6464
<Compile Include="..\service\CSharpProjectAnalysis.fs">
6565
<Link>CSharpProjectAnalysis.fs</Link>
6666
</Compile>
67-
<Compile Include="..\service\StructureTests.fs">
68-
<Link>StructureTests.fs</Link>
69-
</Compile>
7067
<Compile Include="..\service\ServiceUntypedParseTests.fs">
7168
<Link>ServiceUntypedParseTests.fs</Link>
7269
</Compile>

tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
<Compile Include="..\..\tests\service\CSharpProjectAnalysis.fs">
6666
<Link>CompilerService\CSharpProjectAnalysis.fs</Link>
6767
</Compile>
68-
<Compile Include="..\..\tests\service\StructureTests.fs">
69-
<Link>CompilerService\StructureTests.fs</Link>
70-
</Compile>
68+
<Compile Include="StructureTests.fs" />
7169
<Compile Include="..\..\tests\service\AssemblyContentProviderTests.fs">
7270
<Link>CompilerService\AssemblyContentProviderTests.fs</Link>
7371
</Compile>

tests/service/StructureTests.fs renamed to tests/FSharp.Compiler.UnitTests/StructureTests.fs

Lines changed: 40 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
#if INTERACTIVE
22
#r "../../artifacts/bin/fcs/net461/FSharp.Compiler.Service.dll" // note, build FSharp.Compiler.Service.Tests.fsproj to generate this, this DLL has a public API so can be used from F# Interactive
3-
#r "../../artifacts/bin/fcs/net461/nunit.framework.dll"
4-
#load "FsUnit.fs"
5-
#load "Common.fs"
3+
#r "../../artifacts/bin/fcs/net461/xunit.dll"
64
#else
75
module Tests.Service.StructureTests
86
#endif
97

108
open System.IO
11-
open NUnit.Framework
12-
open FSharp.Compiler.EditorServices
9+
open Xunit
1310
open FSharp.Compiler.EditorServices.Structure
1411
open FSharp.Compiler.Service.Tests.Common
1512
open FSharp.Compiler.Text
@@ -55,10 +52,10 @@ let (=>) (source: string) (expectedRanges: (Range * Range) list) =
5552
printfn "AST:\n%+A" ast
5653
reraise()
5754

58-
[<Test>]
55+
[<Fact>]
5956
let ``empty file``() = "" => []
6057

61-
[<Test>]
58+
[<Fact>]
6259
let ``nested module``() =
6360
"""
6461
module MyModule =
@@ -71,7 +68,7 @@ module Module =
7168
=> [ (2, 0, 3, 6), (2, 15, 3, 6)
7269
(5, 0, 7, 6), (6, 13, 7, 6) ]
7370

74-
[<Test>]
71+
[<Fact>]
7572
let ``module with multiline function``() =
7673
"""
7774
module MyModule =
@@ -82,7 +79,7 @@ module MyModule =
8279
(3, 4, 4, 13), (3, 13, 4, 13)
8380
(3, 8, 4, 13), (3, 13, 4, 13) ]
8481

85-
[<Test>]
82+
[<Fact>]
8683
let ``DU``() =
8784
"""
8885
type Color =
@@ -93,7 +90,7 @@ type Color =
9390
=> [ (2, 5, 5, 10), (2, 11, 5, 10)
9491
(3, 4, 5, 10), (3, 4, 5, 10) ]
9592

96-
[<Test>]
93+
[<Fact>]
9794
let ``DU with interface``() =
9895
"""
9996
type Color =
@@ -111,7 +108,7 @@ type Color =
111108
(8, 8, 9, 55), (8, 27, 9, 55)
112109
(8, 15, 9, 55), (8, 27, 9, 55) ]
113110

114-
[<Test>]
111+
[<Fact>]
115112
let ``record with interface``() =
116113
"""
117114
type Color =
@@ -133,7 +130,7 @@ type Color =
133130
(9, 8, 10, 55), (9, 27, 10, 55)
134131
(9, 15, 10, 55), (9, 27, 10, 55) ]
135132

136-
[<Test>]
133+
[<Fact>]
137134
let ``type with a do block``() =
138135
"""
139136
type Color() = // 2
@@ -148,7 +145,7 @@ type Color() = // 2
148145
(3, 8, 4, 10), (3, 13, 4, 10)
149146
(6, 4, 8, 10), (6, 6, 8, 10) ]
150147

151-
[<Test>]
148+
[<Fact>]
152149
let ``complex outlining test``() =
153150
"""
154151
module MyModule = // 2
@@ -194,7 +191,7 @@ module MyModule = // 2
194191
(26, 23, 27, 63), (26, 35, 27, 63) ]
195192

196193

197-
[<Test>]
194+
[<Fact>]
198195
let ``open statements``() =
199196
"""
200197
open M
@@ -231,7 +228,7 @@ open H
231228
(17, 8, 18, 14), (17, 8, 18, 14)
232229
(21, 0, 26, 6), (21, 0, 26, 6) ]
233230

234-
[<Test>]
231+
[<Fact>]
235232
let ``hash directives``() =
236233
"""
237234
#r @"a"
@@ -260,7 +257,7 @@ let x = 1
260257
=> [ (2, 3, 8, 6), (2, 3, 8, 6)
261258
(11, 3, 23, 6), (11, 3, 23, 6) ]
262259

263-
[<Test>]
260+
[<Fact>]
264261
let ``nested let bindings``() =
265262
"""
266263
let f x = // 2
@@ -275,7 +272,7 @@ let f x = // 2
275272
(3, 8, 6, 10), (3, 11, 6, 10)
276273
(4, 12, 5, 14), (4, 13, 5, 14) ]
277274

278-
[<Test>]
275+
[<Fact>]
279276
let ``match``() =
280277
"""
281278
match None with // 2
@@ -293,7 +290,7 @@ match None with // 2
293290
(6, 4, 10, 10), (6, 19, 10, 10)
294291
(9, 8, 10, 10), (8, 10, 10, 10) ]
295292

296-
[<Test>]
293+
[<Fact>]
297294
let ``matchbang``() =
298295
"""
299296
async { // 2
@@ -314,7 +311,7 @@ async { // 2
314311
(7, 8, 11, 14), (7, 23, 11, 14)
315312
(10, 12, 11, 14), (9, 14, 11, 14) ]
316313

317-
[<Test>]
314+
[<Fact>]
318315
let ``computation expressions``() =
319316
"""
320317
seq { // 2
@@ -330,7 +327,7 @@ seq { // 2
330327
(6, 4, 7, 18), (6, 4, 7, 18)
331328
(6, 11, 7, 18), (6, 16, 7, 17) ]
332329

333-
[<Test>]
330+
[<Fact>]
334331
let ``list``() =
335332
"""
336333
let _ =
@@ -341,7 +338,7 @@ let _ =
341338
(2, 4, 4, 9), (2, 5, 4, 9)
342339
(3, 4, 4, 9), (3, 5, 4, 8) ]
343340

344-
[<Test>]
341+
[<Fact>]
345342
let ``object expressions``() =
346343
"""
347344
let _ =
@@ -352,7 +349,7 @@ let _ =
352349
(2, 4, 4, 34), (2, 5, 4, 34)
353350
(3, 4, 4, 34), (3, 28, 4, 34) ]
354351

355-
[<Test>]
352+
[<Fact>]
356353
let ``try - with``() =
357354
"""
358355
try // 2
@@ -370,7 +367,7 @@ with _ -> // 5
370367
(6, 4, 8, 6), (5, 6, 8, 6)
371368
(6, 8, 7, 10), (6, 11, 7, 10) ]
372369

373-
[<Test>]
370+
[<Fact>]
374371
let ``try - finally``() =
375372
"""
376373
try // 2
@@ -386,7 +383,7 @@ finally // 5
386383
(5, 0, 8, 6), (5, 7, 8, 6)
387384
(6, 8, 7, 10), (6, 11, 7, 10) ]
388385

389-
[<Test>]
386+
[<Fact>]
390387
let ``if - then - else``() =
391388
"""
392389
if true then
@@ -403,7 +400,7 @@ else
403400
(3, 8, 4, 10), (3, 11, 4, 10)
404401
(7, 8, 8, 10), (7, 11, 8, 10) ]
405402

406-
[<Test>]
403+
[<Fact>]
407404
let ``code quotation``() =
408405
"""
409406
<@
@@ -412,7 +409,7 @@ let ``code quotation``() =
412409
"""
413410
=> [ (2, 0, 4, 10), (2, 2, 4, 8) ]
414411

415-
[<Test>]
412+
[<Fact>]
416413
let ``raw code quotation``() =
417414
"""
418415
<@@
@@ -421,7 +418,7 @@ let ``raw code quotation``() =
421418
"""
422419
=> [ (2, 0, 4, 11), (2, 3, 4, 8) ]
423420

424-
[<Test>]
421+
[<Fact>]
425422
let ``match lambda aka function``() =
426423
"""
427424
function
@@ -431,7 +428,7 @@ function
431428
=> [ (2, 0, 4, 10), (2, 8, 4, 10)
432429
(3, 8, 4, 10), (3, 3, 4, 10) ]
433430

434-
[<Test>]
431+
[<Fact>]
435432
let ``match guarded clause``() =
436433
"""
437434
let matchwith num =
@@ -444,7 +441,7 @@ let matchwith num =
444441
(3, 4, 5, 13), (3, 18, 5, 13)
445442
(4, 11, 5, 13), (4, 7, 5, 13) ]
446443

447-
[<Test>]
444+
[<Fact>]
448445
let ``for loop``() =
449446
"""
450447
for x = 100 downto 10 do
@@ -453,7 +450,7 @@ for x = 100 downto 10 do
453450
"""
454451
=> [ (2, 0, 4, 6), (2, 0, 4, 6) ]
455452

456-
[<Test>]
453+
[<Fact>]
457454
let ``for each``() =
458455
"""
459456
for x in 0 .. 100 ->
@@ -463,7 +460,7 @@ for x in 0 .. 100 ->
463460
=> [ (2, 0, 4, 14), (2, 0, 4, 14)
464461
(2, 18, 4, 14), (2, 18, 4, 14) ]
465462

466-
[<Test>]
463+
[<Fact>]
467464
let ``tuple``() =
468465
"""
469466
( 20340
@@ -472,7 +469,7 @@ let ``tuple``() =
472469
"""
473470
=> [ (2, 2, 4, 8), (2, 2, 4, 8) ]
474471

475-
[<Test>]
472+
[<Fact>]
476473
let ``do!``() =
477474
"""
478475
do!
@@ -481,7 +478,7 @@ do!
481478
"""
482479
=> [ (2, 0, 4, 18), (2, 3, 4, 18) ]
483480

484-
[<Test>]
481+
[<Fact>]
485482
let ``cexpr yield yield!``() =
486483
"""
487484
cexpr{
@@ -498,7 +495,7 @@ cexpr{
498495
(4, 8, 8, 17), (4, 14, 8, 16)
499496
(5, 20, 7, 26), (5, 20, 7, 26) ]
500497

501-
[<Test>]
498+
[<Fact>]
502499
let ``XML doc comments``() =
503500
"""
504501
/// Line 1
@@ -523,7 +520,7 @@ module M =
523520
(12, 4, 13, 15), (13, 11, 13, 15)
524521
(12, 4, 13, 15), (13, 11, 13, 15) ]
525522

526-
[<Test>]
523+
[<Fact>]
527524
let ``regular comments``() =
528525
"""
529526
// Line 1
@@ -545,7 +542,7 @@ module M =
545542
(7, 9, 11, 19), (7, 11, 11, 19)
546543
(8, 8, 10, 17), (8, 8, 10, 17) ]
547544

548-
[<Test>]
545+
[<Fact>]
549546
let ``XML doc and regular comments in one block``() =
550547
"""
551548
// Line 1
@@ -562,7 +559,7 @@ let ``XML doc and regular comments in one block``() =
562559
(4, 0, 5, 10), (4, 0, 5, 10)
563560
(7, 0, 10, 10), (7, 0, 10, 10) ]
564561

565-
[<Test>]
562+
[<Fact>]
566563
let ``constructor call``() =
567564
"""
568565
module M =
@@ -577,7 +574,7 @@ module M =
577574
(4, 8, 6, 14), (4, 25, 6, 14)
578575
(5, 12, 6, 13), (5, 12, 6, 13) ]
579576

580-
[<Test>]
577+
[<Fact>]
581578
let ``Top level module`` () =
582579
"""
583580
module TopLevelModule
@@ -588,7 +585,7 @@ module Nested =
588585
=> [ (2, 7, 5, 15), (2, 21, 5, 15)
589586
(4, 0, 5, 15), (4, 13, 5, 15) ]
590587

591-
[<Test>]
588+
[<Fact>]
592589
let ``Top level namespace`` () =
593590
"""
594591
namespace TopLevelNamespace.Another
@@ -598,7 +595,7 @@ module Nested =
598595
"""
599596
=> [ (4, 0, 5, 15), (4, 13, 5, 15) ]
600597

601-
[<Test>]
598+
[<Fact>]
602599
let ``Multiple namespaces`` () =
603600
"""
604601
namespace TopLevelNamespace.Another
@@ -614,7 +611,7 @@ module NestedModule =
614611
=> [ (4, 0, 5, 15), (4, 13, 5, 15)
615612
(9, 0, 10, 15), (9, 19, 10, 15) ]
616613

617-
[<Test>]
614+
[<Fact>]
618615
let ``Member val`` () =
619616
"""
620617
type T() =
@@ -638,7 +635,7 @@ type T() =
638635
(10, 4, 11, 10), (10, 4, 11, 10)
639636
(13, 4, 15, 10), (13, 4, 15, 10) ]
640637

641-
[<Test>]
638+
[<Fact>]
642639
let ``Secondary constructors`` () =
643640
"""
644641
type T() =
@@ -661,7 +658,7 @@ type T() =
661658
(9, 4, 11, 12), (10, 10, 11, 12) ]
662659

663660

664-
[<Test>]
661+
[<Fact>]
665662
let ``Abstract members`` () =
666663
"""
667664
type T() =

0 commit comments

Comments
 (0)