You've already forked linux-packaging-mono
Imported Upstream version 5.16.0.100
Former-commit-id: 38faa55fb9669e35e7d8448b15c25dc447f25767
This commit is contained in:
parent
0a9828183b
commit
7d7f676260
@@ -33,7 +33,7 @@ COMMON_SRCS = \
|
||||
AssemblyRef.cs
|
||||
|
||||
DISTFILES = \
|
||||
README.makefiles \
|
||||
README.makefiles.md \
|
||||
README.platforms \
|
||||
README.configury \
|
||||
config-default.make \
|
||||
@@ -41,6 +41,7 @@ DISTFILES = \
|
||||
corcompare-api.xsl \
|
||||
executable.make \
|
||||
gensources.sh \
|
||||
gensources.cs \
|
||||
library.make \
|
||||
rules.make \
|
||||
tests.make \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,11 +34,11 @@ static class Consts
|
||||
// Use these assembly version constants to make code more maintainable.
|
||||
//
|
||||
|
||||
public const string MonoVersion = "5.14.0.177";
|
||||
public const string MonoVersion = "5.16.0.100";
|
||||
public const string MonoCompany = "Mono development team";
|
||||
public const string MonoProduct = "Mono Common Language Infrastructure";
|
||||
public const string MonoCopyright = "(c) Various Mono authors";
|
||||
public const int MonoCorlibVersion = 1051400005;
|
||||
public const int MonoCorlibVersion = 1051600010;
|
||||
|
||||
#if MOBILE
|
||||
// Versions of .NET Framework for Silverlight 4.0
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
|
||||
class X {
|
||||
// Check installed compiler
|
||||
static void Generic<T> ()
|
||||
{
|
||||
// we use 'var' all around in the compiler sources
|
||||
var x = new X ();
|
||||
}
|
||||
|
||||
void DefaultParametersAvailable (int i = 3)
|
||||
interface II
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class X
|
||||
{
|
||||
static void Foo (II a = default (II), II b = default, II c = (II) null)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
420
mcs/build/gensources.cs
Normal file
420
mcs/build/gensources.cs
Normal file
@@ -0,0 +1,420 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
|
||||
public static class Program {
|
||||
public static int Main (string[] _args) {
|
||||
var args = new List<string> (_args);
|
||||
bool useStdout = false, showHelp = false, strictMode = false;
|
||||
|
||||
for (int i = 0; i < args.Count; i++) {
|
||||
var arg = args[i];
|
||||
if (!arg.StartsWith ("-"))
|
||||
continue;
|
||||
|
||||
switch (arg) {
|
||||
case "-?":
|
||||
case "--help":
|
||||
case "-h":
|
||||
showHelp = true;
|
||||
break;
|
||||
case "--trace":
|
||||
case "--trace1":
|
||||
SourcesParser.TraceLevel = 1;
|
||||
break;
|
||||
case "--trace2":
|
||||
SourcesParser.TraceLevel = 2;
|
||||
break;
|
||||
case "--trace3":
|
||||
SourcesParser.TraceLevel = 3;
|
||||
break;
|
||||
case "--trace4":
|
||||
SourcesParser.TraceLevel = 4;
|
||||
break;
|
||||
case "--stdout":
|
||||
useStdout = true;
|
||||
break;
|
||||
case "--strict":
|
||||
strictMode = true;
|
||||
break;
|
||||
default:
|
||||
Console.Error.WriteLine ("Unrecognized switch " + arg);
|
||||
break;
|
||||
}
|
||||
|
||||
args.RemoveAt (i);
|
||||
i--;
|
||||
}
|
||||
|
||||
if (args.Count != 4)
|
||||
showHelp = true;
|
||||
|
||||
if (showHelp) {
|
||||
Console.Error.WriteLine ("Usage: mcs/build/gensources.exe [options] (outputFileName|--stdout) libraryDirectoryAndName platformName profileName");
|
||||
Console.Error.WriteLine ("You can specify * for platformName and profileName to read all sources files");
|
||||
Console.Error.WriteLine ("Available options:");
|
||||
Console.Error.WriteLine ("--help -h -?");
|
||||
Console.Error.WriteLine (" Show command line info");
|
||||
Console.Error.WriteLine ("--trace1 --trace2 --trace3 --trace4");
|
||||
Console.Error.WriteLine (" Enable diagnostic output");
|
||||
Console.Error.WriteLine ("--stdout");
|
||||
Console.Error.WriteLine (" Writes results to standard output (omit outputFileName if you use this)");
|
||||
Console.Error.WriteLine ("--strict");
|
||||
Console.Error.WriteLine (" Produces an error exit code if files or directories are invalid/missing");
|
||||
return 1;
|
||||
}
|
||||
|
||||
var myAssembly = Assembly.GetExecutingAssembly ();
|
||||
var codeBase = new Uri (myAssembly.CodeBase);
|
||||
var executablePath = Path.GetFullPath (codeBase.LocalPath);
|
||||
var executableDirectory = Path.GetDirectoryName (executablePath);
|
||||
|
||||
var outFile = Path.GetFullPath (args[0]);
|
||||
var libraryFullName = Path.GetFullPath (args[1]);
|
||||
var platformName = args[2];
|
||||
var profileName = args[3];
|
||||
var platformsFolder = Path.Combine (executableDirectory, "platforms");
|
||||
var profilesFolder = Path.Combine (executableDirectory, "profiles");
|
||||
|
||||
var libraryDirectory = Path.GetDirectoryName (libraryFullName);
|
||||
var libraryName = Path.GetFileName (libraryFullName);
|
||||
|
||||
var parser = new SourcesParser (platformsFolder, profilesFolder);
|
||||
var result = parser.Parse (libraryDirectory, libraryName, platformName, profileName);
|
||||
|
||||
if (SourcesParser.TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Writing sources for platform {platformName} and profile {profileName}, relative to {libraryDirectory}, to {outFile}.");
|
||||
|
||||
TextWriter output;
|
||||
if (useStdout)
|
||||
output = Console.Out;
|
||||
else
|
||||
output = new StreamWriter (outFile);
|
||||
|
||||
using (output) {
|
||||
foreach (var fileName in result.GetFileNames ().OrderBy (s => s, StringComparer.Ordinal))
|
||||
output.WriteLine (fileName);
|
||||
}
|
||||
|
||||
if (strictMode)
|
||||
return result.ErrorCount;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ParseEntry {
|
||||
public string SourcesFileName;
|
||||
public string Directory;
|
||||
public string Pattern;
|
||||
public string HostPlatform;
|
||||
public string ProfileName;
|
||||
}
|
||||
|
||||
public struct Source {
|
||||
public string FileName;
|
||||
}
|
||||
|
||||
public class ParseResult {
|
||||
public readonly string LibraryDirectory, LibraryName;
|
||||
|
||||
public readonly List<ParseEntry> Sources = new List<ParseEntry> ();
|
||||
public readonly List<ParseEntry> Exclusions = new List<ParseEntry> ();
|
||||
|
||||
// FIXME: This is a bad spot for this value but enumerators don't have outparam support
|
||||
public int ErrorCount = 0;
|
||||
|
||||
public ParseResult (string libraryDirectory, string libraryName) {
|
||||
LibraryDirectory = libraryDirectory;
|
||||
LibraryName = libraryName;
|
||||
}
|
||||
|
||||
private static string GetRelativePath (string fullPath, string relativeToDirectory) {
|
||||
fullPath = fullPath.Replace (SourcesParser.DirectorySeparator, "/");
|
||||
relativeToDirectory = relativeToDirectory.Replace (SourcesParser.DirectorySeparator, "/");
|
||||
|
||||
if (!relativeToDirectory.EndsWith (SourcesParser.DirectorySeparator))
|
||||
relativeToDirectory += SourcesParser.DirectorySeparator;
|
||||
var dirUri = new Uri (relativeToDirectory);
|
||||
var pathUri = new Uri (fullPath);
|
||||
|
||||
var relativeUri = Uri.UnescapeDataString (
|
||||
dirUri.MakeRelativeUri (pathUri).OriginalString
|
||||
).Replace ("/", SourcesParser.DirectorySeparator);
|
||||
|
||||
if (SourcesParser.TraceLevel >= 4)
|
||||
Console.Error.WriteLine ($"// {fullPath} -> {relativeUri}");
|
||||
|
||||
return relativeUri;
|
||||
}
|
||||
|
||||
private IEnumerable<string> EnumerateMatches (
|
||||
IEnumerable<ParseEntry> entries,
|
||||
string hostPlatformName, string profileName
|
||||
) {
|
||||
foreach (var entry in entries) {
|
||||
if (
|
||||
(hostPlatformName != null) &&
|
||||
(entry.HostPlatform ?? hostPlatformName) != hostPlatformName
|
||||
)
|
||||
continue;
|
||||
if (
|
||||
(profileName != null) &&
|
||||
(entry.ProfileName ?? profileName) != profileName
|
||||
)
|
||||
continue;
|
||||
|
||||
var absolutePath = Path.Combine (entry.Directory, entry.Pattern);
|
||||
var absoluteDirectory = Path.GetDirectoryName (absolutePath);
|
||||
var absolutePattern = Path.GetFileName (absolutePath);
|
||||
|
||||
if (SourcesParser.TraceLevel >= 3) {
|
||||
if ((absolutePattern != entry.Pattern) || (absoluteDirectory != entry.Directory))
|
||||
Console.Error.WriteLine ($"// {entry.Directory} / {entry.Pattern} -> {absoluteDirectory} / {absolutePattern}");
|
||||
}
|
||||
|
||||
if (!Directory.Exists (absoluteDirectory)) {
|
||||
Console.Error.WriteLine ($"Directory does not exist: {Path.GetFullPath (absoluteDirectory)}");
|
||||
ErrorCount += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
var matchingFiles = Directory.GetFiles (absoluteDirectory, absolutePattern);
|
||||
foreach (var fileName in matchingFiles) {
|
||||
var relativePath = GetRelativePath (fileName, LibraryDirectory);
|
||||
yield return relativePath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If you loaded sources files for multiple profiles, you can use the arguments here
|
||||
// to filter the results
|
||||
public IEnumerable<string> GetFileNames (
|
||||
string hostPlatformName = null, string profileName = null
|
||||
) {
|
||||
var encounteredFileNames = new HashSet<string> (StringComparer.Ordinal);
|
||||
|
||||
var excludedFiles = new HashSet<string> (
|
||||
EnumerateMatches (Exclusions, hostPlatformName, profileName),
|
||||
StringComparer.Ordinal
|
||||
);
|
||||
|
||||
foreach (var fileName in EnumerateMatches (Sources, hostPlatformName, profileName)) {
|
||||
if (excludedFiles.Contains (fileName)) {
|
||||
if (SourcesParser.TraceLevel >= 3)
|
||||
Console.Error.WriteLine ($"// Excluding {fileName}");
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip duplicates
|
||||
if (encounteredFileNames.Contains (fileName))
|
||||
continue;
|
||||
|
||||
encounteredFileNames.Add (fileName);
|
||||
yield return fileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SourcesParser {
|
||||
public static readonly string DirectorySeparator = new String (Path.DirectorySeparatorChar, 1);
|
||||
public static int TraceLevel = 0;
|
||||
|
||||
private class State {
|
||||
public ParseResult Result;
|
||||
public string HostPlatform;
|
||||
public string ProfileName;
|
||||
|
||||
public int SourcesFilesParsed, ExclusionsFilesParsed;
|
||||
|
||||
public List<ParseEntry> ParsedSources {
|
||||
get {
|
||||
return Result.Sources;
|
||||
}
|
||||
}
|
||||
|
||||
public List<ParseEntry> ParsedExclusions {
|
||||
get {
|
||||
return Result.Exclusions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public readonly string[] AllHostPlatformNames;
|
||||
public readonly string[] AllProfileNames;
|
||||
|
||||
private int ParseDepth = 0;
|
||||
|
||||
public SourcesParser (
|
||||
string platformsFolder, string profilesFolder
|
||||
) {
|
||||
AllHostPlatformNames = Directory.GetFiles (platformsFolder, "*.make")
|
||||
.Select (Path.GetFileNameWithoutExtension)
|
||||
.ToArray ();
|
||||
AllProfileNames = Directory.GetFiles (profilesFolder, "*.make")
|
||||
.Select (Path.GetFileNameWithoutExtension)
|
||||
.ToArray ();
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string libraryName, string hostPlatform, string profile) {
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory, libraryName),
|
||||
ProfileName = profile,
|
||||
HostPlatform = hostPlatform
|
||||
};
|
||||
|
||||
var testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{profile}_{libraryName}");
|
||||
var ok = TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
state.HostPlatform = null;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{profile}_{libraryName}");
|
||||
ok = TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{libraryName}");
|
||||
ok = TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
|
||||
if (ok) {
|
||||
PrintSummary (state);
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
state.ProfileName = null;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, libraryName);
|
||||
TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
|
||||
PrintSummary (state);
|
||||
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
public ParseResult Parse (string libraryDirectory, string libraryName) {
|
||||
var state = new State {
|
||||
Result = new ParseResult (libraryDirectory, libraryName)
|
||||
};
|
||||
|
||||
string testPath = Path.Combine (libraryDirectory, libraryName);
|
||||
TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
|
||||
foreach (var profile in AllProfileNames) {
|
||||
state.ProfileName = profile;
|
||||
|
||||
foreach (var hostPlatform in AllHostPlatformNames) {
|
||||
state.HostPlatform = hostPlatform;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{hostPlatform}_{profile}_{libraryName}");
|
||||
TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
}
|
||||
|
||||
state.HostPlatform = null;
|
||||
|
||||
testPath = Path.Combine (libraryDirectory, $"{profile}_{libraryName}");
|
||||
TryParseSingleFile (state, testPath + ".sources", false);
|
||||
TryParseSingleFile (state, testPath + ".exclude.sources", true);
|
||||
}
|
||||
|
||||
PrintSummary (state);
|
||||
|
||||
return state.Result;
|
||||
}
|
||||
|
||||
private void PrintSummary (State state) {
|
||||
if (TraceLevel > 0)
|
||||
Console.Error.WriteLine ($"// Parsed {state.SourcesFilesParsed} sources file(s) and {state.ExclusionsFilesParsed} exclusions file(s).");
|
||||
}
|
||||
|
||||
private void HandleMetaDirective (State state, string directory, bool asExclusionsList, string directive) {
|
||||
var include = "#include ";
|
||||
if (directive.StartsWith (include))
|
||||
ParseSingleFile (state, Path.Combine (directory, directive.Substring (include.Length)), asExclusionsList);
|
||||
}
|
||||
|
||||
private bool TryParseSingleFile (State state, string fileName, bool asExclusionsList) {
|
||||
if (!File.Exists (fileName))
|
||||
return false;
|
||||
|
||||
ParseSingleFile (state, fileName, asExclusionsList);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void ParseSingleFile (State state, string fileName, bool asExclusionsList) {
|
||||
var nullStr = "<none>";
|
||||
if (TraceLevel >= 1)
|
||||
Console.Error.WriteLine ($"// {new String (' ', ParseDepth * 2)}{fileName} [{state.HostPlatform ?? nullStr}] [{state.ProfileName ?? nullStr}]");
|
||||
ParseDepth += 1;
|
||||
|
||||
var directory = Path.GetDirectoryName (fileName);
|
||||
|
||||
using (var sr = new StreamReader (fileName)) {
|
||||
if (asExclusionsList)
|
||||
state.ExclusionsFilesParsed++;
|
||||
else
|
||||
state.SourcesFilesParsed++;
|
||||
|
||||
string line;
|
||||
while ((line = sr.ReadLine ()) != null) {
|
||||
if (String.IsNullOrWhiteSpace (line))
|
||||
continue;
|
||||
|
||||
if (line.StartsWith ("#")) {
|
||||
HandleMetaDirective (state, directory, asExclusionsList, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
var parts = line.Split (':');
|
||||
|
||||
if (parts.Length > 1) {
|
||||
var explicitExclusions = parts[1].Split (',');
|
||||
|
||||
// gensources.sh implemented these explicit exclusions like so:
|
||||
// ../foo/bar/*.cs:A.cs,B.cs
|
||||
// This would generate exclusions for ../foo/bar/A.cs and ../foo/bar/B.cs,
|
||||
// not ./A.cs and ./B.cs as you might expect
|
||||
|
||||
var mainPatternDirectory = Path.GetDirectoryName (parts[0]);
|
||||
|
||||
foreach (var pattern in explicitExclusions) {
|
||||
state.ParsedExclusions.Add (new ParseEntry {
|
||||
SourcesFileName = fileName,
|
||||
Directory = directory,
|
||||
Pattern = Path.Combine (mainPatternDirectory, pattern),
|
||||
HostPlatform = state.HostPlatform,
|
||||
ProfileName = state.ProfileName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
(asExclusionsList ? state.ParsedExclusions : state.ParsedSources)
|
||||
.Add (new ParseEntry {
|
||||
SourcesFileName = fileName,
|
||||
Directory = directory,
|
||||
Pattern = parts[0],
|
||||
HostPlatform = state.HostPlatform,
|
||||
ProfileName = state.ProfileName
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ParseDepth -= 1;
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ test-local run-test-local run-test-ondotnet-local:
|
||||
ccomma = ,
|
||||
define RESOURCE_template
|
||||
$(1).resources: $(2)
|
||||
$(RESGEN) "$$<" "$$@"
|
||||
$$(RESGEN) "$$<" "$$@"
|
||||
|
||||
GEN_RESOURCE_DEPS += $(1).resources
|
||||
GEN_RESOURCE_FLAGS += -resource:$(1).resources
|
||||
@@ -298,11 +298,19 @@ endif
|
||||
PROFILE_sources := $(firstword $(if $(PROFILE_PLATFORM),$(wildcard $(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY).sources)) $(wildcard $(PROFILE)_$(LIBRARY).sources) $(wildcard $(LIBRARY).sources))
|
||||
PROFILE_excludes = $(firstword $(if $(PROFILE_PLATFORM),$(wildcard $(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY).exclude.sources)) $(wildcard $(PROFILE)_$(LIBRARY).exclude.sources))
|
||||
|
||||
# Note, gensources.sh can create a $(sourcefile).makefrag if it sees any '#include's
|
||||
# We don't include it in the dependencies since it isn't always created
|
||||
gensources = $(topdir)/build/gensources.exe
|
||||
$(gensources): $(topdir)/build/gensources.cs
|
||||
$(BOOTSTRAP_MCS) -noconfig -debug:portable -r:mscorlib.dll -r:System.dll -r:System.Core.dll -out:$(gensources) $(topdir)/build/gensources.cs
|
||||
|
||||
ifdef PROFILE_RUNTIME
|
||||
GENSOURCES_RUNTIME = $(PROFILE_RUNTIME)
|
||||
else
|
||||
GENSOURCES_RUNTIME = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME)
|
||||
endif
|
||||
|
||||
sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY_SUBDIR)_$(LIBRARY).sources
|
||||
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(topdir)/build/gensources.sh $(depsdir)/.stamp
|
||||
$(SHELL) $(topdir)/build/gensources.sh $@ '$(PROFILE_sources)' '$(PROFILE_excludes)'
|
||||
$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(depsdir)/.stamp $(gensources)
|
||||
$(GENSOURCES_RUNTIME) --debug $(gensources) "$@" "$(LIBRARY)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
|
||||
|
||||
library_CLEAN_FILES += $(sourcefile)
|
||||
|
||||
@@ -390,9 +398,9 @@ gen-deps:
|
||||
|
||||
update-corefx-sr-generic:
|
||||
ifneq ($(RESX_STRINGS),)
|
||||
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_STRINGS) >$(SR_OUTPUT)
|
||||
MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resx2sr.exe $(RESX_EXTRA_ARGUMENTS) $(RESX_STRINGS) >$(SR_OUTPUT)
|
||||
endif
|
||||
|
||||
update-corefx-sr: $(RESX_RESOURCE_STRING) $(XTEST_RESX_RESOURCE_STRING)
|
||||
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS="$(RESX_RESOURCE_STRING)" update-corefx-sr-generic \
|
||||
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
|
||||
make SR_OUTPUT=corefx/SR.cs RESX_STRINGS="$(RESX_RESOURCE_STRING)" RESX_EXTRA_ARGUMENTS="$(RESX_EXTRA_ARGUMENTS)" update-corefx-sr-generic \
|
||||
&& make SR_OUTPUT=corefx/SR.tests.cs RESX_STRINGS=$(XTEST_RESX_RESOURCE_STRING) update-corefx-sr-generic
|
||||
|
||||
@@ -115,7 +115,7 @@ endif
|
||||
|
||||
$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
|
||||
$(MAKE) $(MAKE_Q) -C $(topdir)/packages
|
||||
$(BOOTSTRAP_MCS) /warn:0 /noconfig /r:System.dll /r:mscorlib.dll /out:$@ $<
|
||||
$(BOOTSTRAP_MCS) /warn:0 /noconfig /langversion:latest /r:System.dll /r:mscorlib.dll /out:$@ $<
|
||||
|
||||
$(PROFILE_OUT): $(PROFILE_EXE)
|
||||
$(PROFILE_RUNTIME) $< > $@ 2>&1
|
||||
|
||||
@@ -13,7 +13,7 @@ profile-check:
|
||||
@:
|
||||
|
||||
DEFAULT_REFERENCES = mscorlib
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -d:MULTIPLEX_OS -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
|
||||
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib $(PLATFORM_DEBUG_FLAGS)
|
||||
API_BIN_PROFILE = v4.7.1
|
||||
|
||||
FRAMEWORK_VERSION = 4.5
|
||||
|
||||
@@ -161,7 +161,7 @@ gacutil = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gacutil.exe
|
||||
GACUTIL = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
|
||||
endif
|
||||
|
||||
STD_TARGETS = test run-test run-xunit-test run-test-ondotnet clean install uninstall doc-update
|
||||
STD_TARGETS = test xunit-test run-test run-xunit-test run-test-ondotnet clean install uninstall doc-update
|
||||
|
||||
$(STD_TARGETS): %: do-%
|
||||
|
||||
|
||||
@@ -29,7 +29,8 @@ XTEST_REMOTE_EXECUTOR = $(topdir)/class/lib/$(PROFILE)/RemoteExecutorConsoleApp.
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/AdminHelper.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/IO/FileCleanupTestBase.cs \
|
||||
$(topdir)/../external/corefx/src/CoreFx.Private.TestUtilities/src/System/Diagnostics/RemoteExecutorTestBase.cs \
|
||||
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs
|
||||
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.cs \
|
||||
$(topdir)/../external/corefx/src/Common/src/System/PasteArguments.Unix.cs
|
||||
|
||||
ifeq ($(PROFILE),monodroid)
|
||||
xunit_src += $(topdir)/../mcs/class/test-helpers/RemoteExecutorTestBase.Mobile.cs
|
||||
@@ -216,8 +217,8 @@ endif
|
||||
## FIXME: i18n problem in the 'sed' command below
|
||||
run-test-lib: test-local test-local-aot-compile patch-nunitlite-appconfig
|
||||
ok=:; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
|
||||
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS="yes" DBG_RUNTIME_ARGS="$(TEST_RUNTIME_FLAGS)" $(TEST_HARNESS_EXEC) $(test_assemblies) $(NOSHADOW_FLAG) $(TEST_HARNESS_FLAGS) $(LOCAL_TEST_HARNESS_FLAGS) $(TEST_HARNESS_EXCLUDES) $(LABELS_ARG) -format:nunit2 -result:TestResult-$(PROFILE).xml $(FIXTURE_ARG) $(TESTNAME_ARG)|| ok=false; \
|
||||
if [ ! -f "TestResult-$(PROFILE).xml" ]; then echo "<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='$(notdir $(strip $(test_assemblies))).crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-$(PROFILE).xml; fi; \
|
||||
$$ok
|
||||
|
||||
## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible
|
||||
@@ -273,6 +274,11 @@ XTEST_HARNESS_PATH := $(topdir)/../external/xunit-binaries
|
||||
XTEST_HARNESS = $(XTEST_HARNESS_PATH)/xunit.console.exe
|
||||
XTEST_HARNESS_FLAGS := -noappdomain -noshadow -parallel none -nunit TestResult-$(PROFILE)-xunit.xml
|
||||
XTEST_TRAIT := -notrait category=failing -notrait category=nonmonotests -notrait Benchmark=true -notrait category=outerloop
|
||||
# The logic is double inverted so this actually excludes tests not intented for current platform
|
||||
# best to search for `property name="category"` in the xml output to see what's going on
|
||||
# https://github.com/dotnet/buildtools/blob/master/src/xunit.netcore.extensions/Discoverers/PlatformSpecificDiscoverer.cs
|
||||
XTEST_TRAIT_PLATFORM := -notrait category=non$(XTEST_PLATFORM)tests
|
||||
|
||||
TEST_MONO_PATH := $(TEST_MONO_PATH)$(PLATFORM_PATH_SEPARATOR)$(XTEST_HARNESS_PATH)
|
||||
|
||||
ifdef FIXTURE
|
||||
@@ -295,7 +301,7 @@ run-xunit-test-local: run-xunit-test-lib
|
||||
run-xunit-test-lib: xunit-test-local $(XTEST_REMOTE_EXECUTOR)
|
||||
@cp -rf $(XTEST_HARNESS_PATH)/xunit.execution.desktop.dll xunit.execution.desktop.dll
|
||||
ok=:; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) || ok=false; \
|
||||
PATH="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR=$(XTEST_REMOTE_EXECUTOR) $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(XTEST_COVERAGE_FLAGS) $(AOT_RUN_FLAGS) $(XTEST_HARNESS) $(xunit_test_lib) $(XTEST_HARNESS_FLAGS) $(XTEST_TRAIT) $(XTEST_TRAIT_PLATFORM) || ok=false; \
|
||||
$$ok
|
||||
@rm -f xunit.execution.desktop.dll
|
||||
|
||||
|
||||
Reference in New Issue
Block a user