Skip to content

Commit

Permalink
Starting to work!
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Jul 18, 2024
1 parent e35607f commit 120e865
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions AltCover.Async/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ namespace AltCover.Recorder;

public static class Instance
{
//internal static IEnumerable<string> Modules
//{
// get { return new string[] { "a", "b", "c", "d" }; }
//}

public static class I
{
internal static class CallTrack
Expand Down
4 changes: 3 additions & 1 deletion AltCover.Engine/Instrument.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ module internal Instrument =
[ worker.Create(OpCodes.Dup)
worker.Create(OpCodes.Ldc_I4, i)
worker.Create(OpCodes.Ldstr, k)
worker.Create(OpCodes.Stelem_Any, stringtype) ]
worker.Create(OpCodes.Stelem_Ref) ]

bulkInsertBefore worker head addElement true
|> ignore)
Expand All @@ -1372,6 +1372,8 @@ module internal Instrument =
[ worker.Create(OpCodes.Stsfld, head.Operand :?> FieldReference) ]

bulkInsertBefore worker head store true |> ignore
let re = [ worker.Create OpCodes.Ret ]
bulkInsertBefore worker head re true |> ignore

let recorderFileName =
(extractName state.RecordingAssembly) + ".dll"
Expand Down
7 changes: 5 additions & 2 deletions AltCover.Recorder/Recorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ internal static string Token
/// Gets the indexed module tokens
/// This property's IL code is modified to store instrumentation results
/// </summary>
private static IEnumerable<string> __modules = new string[] { string.Empty };
private static string[] __modules = new string[] { string.Empty };

internal static IEnumerable<string> Modules
[SuppressMessage("Gendarme.Rules.Performance",
"AvoidReturningArraysOnPropertiesRule",
Justification = "Controlled use")]
internal static string[] Modules
{
#if DEBUG
[SuppressMessage("Gendarme.Rules.Performance",
Expand Down
8 changes: 4 additions & 4 deletions AltCover.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3346,8 +3346,8 @@ module AltCoverTests =
"set_CoverageFormat"
"get_Sample"
"set_Sample"
"get_modules"
"set_modules"
"get_Modules"
"set_Modules"
"ToList"
"#ctor"
"#ctor"
Expand Down Expand Up @@ -3401,8 +3401,8 @@ module AltCoverTests =
"System.Void AltCover.Sample3.Class3+Class4.set_CoverageFormat(System.Int32)"
"System.Int32 AltCover.Sample3.Class3+Class4.get_Sample()"
"System.Void AltCover.Sample3.Class3+Class4.set_Sample(System.Int32)"
"System.String[] AltCover.Sample3.Class3+Class4.get_modules()"
"System.Void AltCover.Sample3.Class3+Class4.set_modules(System.String[])"
"System.String[] AltCover.Sample3.Class3+Class4.get_Modules()"
"System.Void AltCover.Sample3.Class3+Class4.set_Modules(System.String[])"
"System.Collections.Generic.List`1<T> AltCover.Sample3.Class3+Class4.ToList<T>(T)"
"System.Void AltCover.Sample3.Class3+Class4.#ctor()"
"System.String AltCover.Recorder.InstrumentationAttribute.get_Assembly()"
Expand Down

0 comments on commit 120e865

Please sign in to comment.