Skip to content

Commit df4b2b7

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

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/embed_tests/GlobalTestsSetup.cs

+19-1
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,7 +61,24 @@ static void UploadDump()
6061
throw new Win32Exception();
6162
}
6263

63-
Process.Start("appveyor", arguments: $"PushArtifact -Path \"{dumpPath}\"").WaitForExit();
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();
70+
Process.Start("appveyor", arguments: $"PushArtifact -Path \"{archivePath}\"").WaitForExit();
71+
}
72+
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;
6482
}
6583

6684
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]

0 commit comments

Comments
 (0)