Skip to content

Commit 3f40b1b

Browse files
committed
Add new test cases for various project samples and update project options structure
1 parent adef05b commit 3f40b1b

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

test/Ionide.ProjInfo.Tests/ProjectLoader2Tests.fs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,32 @@ module ProjectLoader2Tests =
267267
yield! applyTests "sample9-NetSdk-library" ``sample9-NetSdk-library-2``
268268
yield! applyTests "sample10-NetSdk-custom-targets" ``sample10-NetSdk-library-with-custom-targets-2``
269269

270+
yield! applyTests "sample-referenced-csharp-project" ``sample-referenced-csharp-project``
271+
// yield! applyTests "sample-workload" ``sample-workload``
272+
yield! applyTests "traversal-project" ``traversal-project``
273+
yield! applyTests "sample11-solution-with-other-projects" ``sample11-solution-with-other-projects``
274+
// yield! applyTests "sample12-solution-filter-with-one-project" ``sample12-solution-filter-with-one-project``
275+
yield! applyTests "sample13-solution-with-solution-files" ``sample13-solution-with-solution-files``
276+
// yield! applyTests "sample-14-slnx-solution" ``sample-14-slnx-solution``
277+
yield! applyTests "sample15-nuget-analyzers" ``sample15-nuget-analyzers``
278+
yield! applyTests "sample16-solution-with-solution-folders" ``sample16-solution-with-solution-folders``
279+
yield! applyTests "sample-netsdk-prodref" ``sample-netsdk-prodref``
280+
yield! applyTests "sample-netsdk-bad-cache" ``sample-netsdk-bad-cache-2``
281+
282+
testCaseTask
283+
|> testWithEnv2
284+
SkipRestore
285+
"missing-import"
286+
``missing-import``
287+
(fun env ->
288+
task {
289+
let! result, projectsAfterBuild = parseWithProjectWalker env
290+
291+
do! env.Data.ExpectsProjectResult result
292+
do! env.Data.ExpectsProjectOptions projectsAfterBuild
293+
}
294+
)
295+
270296

271297
testCaseTask
272298
|> testWithEnv

test/Ionide.ProjInfo.Tests/TestAssets.fs

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,3 +612,107 @@ let ``sample10-NetSdk-library-with-custom-targets-2`` = {
612612
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
613613
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
614614
}
615+
616+
617+
let ``sample-referenced-csharp-project`` = {
618+
ProjDir = "sample-referenced-csharp-project"
619+
EntryPoints = [
620+
"fsharp-exe"
621+
/ "fsharp-exe.fsproj"
622+
]
623+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
624+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
625+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
626+
}
627+
628+
let ``sample-workload`` = {
629+
ProjDir = "sample-workload"
630+
EntryPoints = [ "sample-workload.fsproj" ]
631+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
632+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
633+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
634+
}
635+
636+
let ``traversal-project`` = {
637+
ProjDir = "traversal-project"
638+
EntryPoints = [ "dirs.proj" ]
639+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
640+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
641+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
642+
}
643+
644+
let ``sample11-solution-with-other-projects`` = {
645+
ProjDir = "sample11-solution-with-other-projects"
646+
EntryPoints = [ "sample11-solution-with-other-projects.sln" ]
647+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
648+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
649+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
650+
}
651+
652+
let ``sample12-solution-filter-with-one-project`` = {
653+
ProjDir = "sample12-solution-filter-with-one-project"
654+
EntryPoints = [ "sample12-solution-filter-with-one-project.slnf" ]
655+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
656+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
657+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
658+
}
659+
660+
let ``sample13-solution-with-solution-files`` = {
661+
ProjDir = "sample13-solution-with-solution-files"
662+
EntryPoints = [ "sample13-solution-with-solution-files.sln" ]
663+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
664+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
665+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
666+
}
667+
668+
let ``sample-14-slnx-solution`` = {
669+
ProjDir = "sample-14-slnx-solution"
670+
EntryPoints = [ "sample-14-slnx-solution.slnx" ]
671+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
672+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
673+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
674+
}
675+
676+
let ``sample15-nuget-analyzers`` = {
677+
ProjDir = "sample15-nuget-analyzers"
678+
EntryPoints = [ "sample15-nuget-analyzers.fsproj" ]
679+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
680+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
681+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
682+
}
683+
684+
let ``sample16-solution-with-solution-folders`` = {
685+
ProjDir = "sample16-solution-with-solution-folders"
686+
EntryPoints = [ "sample16-solution-with-solution-folders.sln" ]
687+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
688+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
689+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
690+
}
691+
692+
let ``missing-import`` = {
693+
ProjDir = "missing-import"
694+
EntryPoints = [ "missing-import.fsproj" ]
695+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
696+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
697+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
698+
}
699+
700+
let ``sample-netsdk-prodref`` = {
701+
ProjDir = "sample-netsdk-prodref"
702+
EntryPoints = [
703+
"l2"
704+
/ "l2.fsproj"
705+
]
706+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
707+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
708+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
709+
}
710+
711+
let ``sample-netsdk-bad-cache-2`` = {
712+
ProjDir = ``sample NetSdk library with a bad FSAC cache``.ProjDir
713+
EntryPoints = [ ``sample NetSdk library with a bad FSAC cache``.ProjectFile ]
714+
715+
ExpectsProjectOptions = fun _ -> ValueTask.CompletedTask
716+
ExpectsGraphResult = fun _ -> ValueTask.CompletedTask
717+
ExpectsProjectResult = fun _ -> ValueTask.CompletedTask
718+
}

test/Ionide.ProjInfo.Tests/Tests.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,7 @@ let testFCSmapManyProjCheckCaching =
14571457
Analyzers = []
14581458
AllProperties = Map.empty
14591459
AllItems = Map.empty
1460+
Imports = []
14601461
}
14611462

14621463
let makeReference (options: ProjectOptions) = {

0 commit comments

Comments
 (0)