Remove clearing data after each test run (it allows to examine obfuscated assemblies after tests running), use more clear suffix for temp dir instead of GUID
This commit is contained in:
Родитель
5d9432a84f
Коммит
56e11d1d9b
|
@ -24,6 +24,7 @@ namespace _123_InheritCustomAttr.Test {
|
|||
new[] {"Monday", "43", "1"},
|
||||
new SettingItem<Protection>("rename") {{"mode", renameMode}, {"flatten", flatten ? "True" : "False"}},
|
||||
outputHelper,
|
||||
$"_{renameMode}_{flatten}",
|
||||
l => Assert.False(l.StartsWith("[WARN]"), "Logged line may not start with [WARN]\r\n" + l));
|
||||
|
||||
public static IEnumerable<object[]> InheritCustomAttributeData() {
|
||||
|
|
|
@ -30,7 +30,8 @@ namespace DynamicTypeRename.Test {
|
|||
{ "mode", renameMode },
|
||||
{ "flatten", flatten.ToString() }
|
||||
},
|
||||
outputHelper
|
||||
outputHelper,
|
||||
$"_{renameMode}_{flatten}"
|
||||
);
|
||||
|
||||
public static IEnumerable<object[]> RenameDynamicTypeData() {
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace CompressorWithResx.Test {
|
|||
? new SettingItem<Protection>("resources") {{"mode", resourceProtectionMode}}
|
||||
: null,
|
||||
outputHelper,
|
||||
$"_{compatKey}_{deriverKey}_{resourceProtectionMode}",
|
||||
packer: new SettingItem<Packer>("compressor") {{"compat", compatKey}, {"key", deriverKey}});
|
||||
|
||||
public static IEnumerable<object[]> CompressAndExecuteTestData() {
|
||||
|
|
|
@ -10,21 +10,23 @@ using Xunit.Abstractions;
|
|||
namespace Confuser.UnitTest {
|
||||
public static class TestRunner {
|
||||
public static async Task Run(string inputFileName, string[] expectedOutput, SettingItem<Protection> protection,
|
||||
ITestOutputHelper outputHelper, Action<string> outputAction = null, SettingItem<Packer> packer = null,
|
||||
ITestOutputHelper outputHelper, string outputDirSuffix = "", Action<string> outputAction = null, SettingItem<Packer> packer = null,
|
||||
Action<ProjectModule> projectModuleAction = null) =>
|
||||
|
||||
await Run(new[] {inputFileName}, expectedOutput, protection, outputHelper, outputAction, packer,
|
||||
await Run(new[] {inputFileName}, expectedOutput, protection, outputHelper, outputDirSuffix, outputAction, packer,
|
||||
projectModuleAction);
|
||||
|
||||
public static async Task Run(string[] inputFileNames, string[] expectedOutput, SettingItem<Protection> protection, ITestOutputHelper outputHelper,
|
||||
Action<string> outputAction = null, SettingItem<Packer> packer = null,
|
||||
string outputDirSuffix = "", Action<string> outputAction = null, SettingItem<Packer> packer = null,
|
||||
Action<ProjectModule> projectModuleAction = null) {
|
||||
|
||||
var baseDir = Environment.CurrentDirectory;
|
||||
var outputDir = Path.Combine(baseDir, "obfuscated_" + Guid.NewGuid().ToString());
|
||||
var outputDir = Path.Combine(baseDir, "obfuscated" + outputDirSuffix);
|
||||
if (Directory.Exists(outputDir)) {
|
||||
Directory.Delete(outputDir, true);
|
||||
}
|
||||
string entryInputFileName = Path.Combine(baseDir, inputFileNames[0]);
|
||||
var entryOutputFileName = Path.Combine(outputDir, inputFileNames[0]);
|
||||
FileUtilities.ClearOutput(entryOutputFileName);
|
||||
var proj = new ConfuserProject {
|
||||
BaseDirectory = baseDir,
|
||||
OutputDirectory = outputDir,
|
||||
|
@ -84,8 +86,6 @@ namespace Confuser.UnitTest {
|
|||
Assert.Equal(42, process.ExitCode);
|
||||
}
|
||||
}
|
||||
|
||||
FileUtilities.ClearOutput(entryOutputFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче