Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9bee1bd

Browse files
committed
pack built binaries and PDBs along with memory dump
1 parent 848e6ba commit 9bee1bd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/embed_tests/GlobalTestsSetup.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.ComponentModel;
33
using System.Diagnostics;
44
using System.IO;
5+
using System.Reflection;
56
using System.Runtime.InteropServices;
67
using System.Threading;
78

@@ -60,9 +61,26 @@ static void UploadDump()
6061
throw new Win32Exception();
6162
}
6263

64+
const string archivePath = "memory.zip";
65+
string filesToPack = '"' + dumpPath + '"';
66+
filesToPack += ' ' + GetFilesToPackFor(Assembly.GetExecutingAssembly());
67+
filesToPack += ' ' + GetFilesToPackFor(typeof(PyObject).Assembly);
68+
69+
Process.Start("7z", $"a {archivePath} {filesToPack}").WaitForExit();
6370
Process.Start("appveyor", arguments: $"PushArtifact -Path \"{dumpPath}\"").WaitForExit();
6471
}
6572

73+
static string GetFilesToPackFor(Assembly assembly)
74+
{
75+
string result = '"' + assembly.Location + '"';
76+
string pdb = Path.ChangeExtension(assembly.Location, ".pdb");
77+
if (File.Exists(pdb))
78+
{
79+
result += $" \"{pdb}\"";
80+
}
81+
return result;
82+
}
83+
6684
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
6785
private static extern SafeFileHandle CreateFile(
6886
string lpFileName,

0 commit comments

Comments
 (0)