Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added comments on failing tests #3

Open
wants to merge 1 commit into
base: fordev16_withtests
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Python/Tests/ProfilingTests/ProfilingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ public void Overall()
string dwjsonPath = Path.Combine(tmpPath, timeStamp + "_Sample.dwjson");
string counterPath = Path.Combine(tmpPath, timeStamp + "_Session.counters");

//// this fails here because VTuneToDWJSON.CSReportTODWJson is different ! ////

// LCR this fails here because VTuneToDWJSON.CSReportTODWJson is different ! //
// double runtime = VTuneToDWJSON.CSReportToDWJson(repspec.ReportOutputFile, dwjsonPath);
// VTuneToDWJSON.CPUReportToDWJson(reptimespec.ReportOutputFile, counterPath, runtime);

Expand Down Expand Up @@ -226,7 +225,7 @@ public void SequenceBaseSizeSequence()
int expected_size = 10;
var sbs = new SequenceBaseSize();
Assert.AreEqual(expected_size, 10);
/// SequenceBaseSize is different
/// LCR SequenceBaseSize is different, no Size property
// Assert.AreEqual(sbs.Size, expected_size);
}

Expand Down
34 changes: 17 additions & 17 deletions Python/Tests/ProfilingTests/ProfilingTestsDeployment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ public static void DoDeployment(TestContext context) {
AssertListener.Initialize();
}

#if false
[TestMethod]
//[DeploymentItem("zlib_example.csv")]
public void TestParsing()
{
string filename = "zlib_example.csv";
int expected_sample_count = 5;
string filename = TestData.GetPath(@"TestData\ExternalProfilerDriverData\zlib_example.csv");
Assert.IsTrue(File.Exists(filename));
int expected_sample_count = 5;

var samples = VTuneToDWJSON.ParseFromFile(filename).ToList();
Assert.AreEqual(samples.Count, expected_sample_count);

Assert.IsInstanceOfType(samples[0], typeof(SampleWithTrace));

string known_module = "libz.so.1";

// LCR this throws an exception, works on VSCode test
var dict = VTuneToDWJSON.ModuleFuncDictFromSamples(samples);
Assert.IsTrue(dict.ContainsKey(known_module));

Expand All @@ -69,12 +69,14 @@ public void TestParsing()
Trace.WriteLine($"Key: {vkk.Key}, Value: [{vkk.Value.FunctionName}, {vkk.Value.SourceFile}, {vkk.Value.LineNumber}]");
}
}
// Works but this isnt used anywhere?
// This assert doesnt work?
// Assert.Throws<ArgumentException>(() => VTuneToDWJSON.AddLineNumbers(ref dict, "/etc/test"));
int initial_count = dict.Count;
//VTuneToDWJSON.AddLineNumbers(ref dict, "C:\\Users\\clairiky\\Documents\\zlib-1.2.11");
Assert.AreEqual(initial_count, dict.Count);

// LCR this assert doesnt work ? This works in my VScode test.
// Assert.ThrowsException<ArgumentException>(() => VTuneToDWJSON.AddLineNumbers(ref dict, "/etc/test"));
// int initial_count = dict.Count;

// LCR havent tested this one which will read windows pdbs.
// VTuneToDWJSON.AddLineNumbers(ref dict, "C:\\Users\\clairiky\\Documents\\zlib-1.2.11");
// Assert.AreEqual(initial_count, dict.Count);


foreach (var m in dict)
Expand All @@ -86,23 +88,21 @@ public void TestParsing()
Trace.WriteLine($"Key: {vkk.Key}, Value: [{vkk.Value.FunctionName}, {vkk.Value.SourceFile}, {vkk.Value.LineNumber}]");
}
}

}
#endif

[TestMethod]
//[DeploymentItem("r_stacks_0004.csv")]
//[DeploymentItem("zlib_example.csv")]
public void TestParseFromFile()
{
string filename = TestData.GetPath(@"TestData\ExternalProfilerDriverData\zlib_example.csv");
string filename = TestData.GetPath(@"TestData\ExternalProfilerDriverData\r_stacks_0000.csv");
Assert.IsTrue(File.Exists(filename));
//int expected_sample_count = 5;
// This function doesnt exists
// var samples = VTuneStackParser.ParseFromFile(filename).ToList();
//LCR This function doesnt exists in the PTVS version of VTuneStackParser. If we dont need it we can remove this test.
//var samples = VTuneStackParser.ParseFromFile(filename).ToList();
//Assert.AreEqual(samples.Count, expected_sample_count);
}

#if false
#if false // LCR this will be the tests that we need for SymbolReader.
[TestMethod]
[DeploymentItem("something.pdb")]
public void LoadTest()
Expand Down
85 changes: 85 additions & 0 deletions Python/Tests/TestData/ExternalProfilerDriverData/r_stacks_0000.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Function,Function Stack,CPU Time,Module,Function (Full),Source File,Start Address
main,,3.021422,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,3.021422,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
RtlRestoreLastWin32Error,,1.204899,ntdll.dll,RtlRestoreLastWin32Error,[Unknown],0x4b2dbd30
,_acrt_getptd,1.204899,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
FlsGetValue,,1.134291,KernelBase.dll,FlsGetValue,[Unknown],0x100f1ae0
,_acrt_FlsGetValue,1.134291,main.exe,_acrt_FlsGetValue,winapi_thunks.cpp,0x47a14b
,_acrt_getptd,0,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
try_get_function,,1.106130,main.exe,try_get_function,winapi_thunks.cpp,0x479cb5
,_acrt_FlsGetValue,1.106130,main.exe,_acrt_FlsGetValue,winapi_thunks.cpp,0x47a14b
,_acrt_getptd,0,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
_acrt_getptd,,1.065911,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,1.065911,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
_acrt_FlsGetValue,,0.921029,main.exe,_acrt_FlsGetValue,winapi_thunks.cpp,0x47a14b
,_acrt_getptd,0.921029,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
rand,,0.865909,main.exe,rand,rand.cpp,0x44abec
,main,0.865909,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
guard_check_icall_nop,,0.224991,main.exe,guard_check_icall_nop,guard_support.c,0x43c073
,_acrt_FlsGetValue,0.224991,main.exe,_acrt_FlsGetValue,winapi_thunks.cpp,0x47a14b
,_acrt_getptd,0,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
GetLastError,,0.173156,KernelBase.dll,GetLastError,[Unknown],0x100f4790
,_acrt_getptd,0.173156,main.exe,_acrt_getptd,per_thread_data.cpp,0x478250
,rand,0,main.exe,rand,rand.cpp,0x44abec
,main,0,main.exe,main,main.cpp,0x40f230
,_scrt_common_main_seh,0,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
SetLastError,,0.148079,kernel32.dll,SetLastError,[Unknown],0x6b814c30
,_scrt_common_main_seh,0.148079,main.exe,_scrt_common_main_seh,exe_common.inl,0x43b7da
,BaseThreadInitThunk,0,kernel32.dll,BaseThreadInitThunk,[Unknown],0x6b818460
,func@0x4b2e4199,0,ntdll.dll,func@0x4b2e4199,[Unknown],0x4b2e4199
,func@0x4b2e417d,0,ntdll.dll,func@0x4b2e417d,[Unknown],0x4b2e417d
,,,,,,
Loading