summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2018-07-20 11:30:37 +0200
committerBenoit Foucher <benoit@zeroc.com>2018-07-20 11:30:37 +0200
commit3a622fc35f91815375cb20965e9a2f78ff3df7ed (patch)
treedd4c5b8f700ed75ed58789ce54d4a307639ec07c
parentFixed tests to target netcoreapp2.1 to ensure latest 2.1 runtime is used (diff)
downloadice-3a622fc35f91815375cb20965e9a2f78ff3df7ed.tar.bz2
ice-3a622fc35f91815375cb20965e9a2f78ff3df7ed.tar.xz
ice-3a622fc35f91815375cb20965e9a2f78ff3df7ed.zip
Fixed test driver to use netcoreapp2.1 for tests
-rw-r--r--csharp/test/IceGrid/simple/application.netcoreapp.xml (renamed from csharp/test/IceGrid/simple/application.netcoreapp2.0.xml)0
-rw-r--r--scripts/Component.py7
-rw-r--r--scripts/IceBoxUtil.py15
-rw-r--r--scripts/IceGridUtil.py4
-rw-r--r--scripts/Util.py50
5 files changed, 37 insertions, 39 deletions
diff --git a/csharp/test/IceGrid/simple/application.netcoreapp2.0.xml b/csharp/test/IceGrid/simple/application.netcoreapp.xml
index 8a655732488..8a655732488 100644
--- a/csharp/test/IceGrid/simple/application.netcoreapp2.0.xml
+++ b/csharp/test/IceGrid/simple/application.netcoreapp.xml
diff --git a/scripts/Component.py b/scripts/Component.py
index 1e7be19c74b..2d677a91565 100644
--- a/scripts/Component.py
+++ b/scripts/Component.py
@@ -135,10 +135,9 @@ class Ice(Component):
elif parent in ["Glacier2"] and testId not in ["Glacier2/application", "Glacier2/sessionHelper"]:
return False
- if isinstance(mapping, CSharpMapping) and current.config.netframework:
- if isinstance(platform, Darwin):
- if parent in ["IceSSL"]:
- return False
+ # IceSSL test doesn't work on macOS/.NET Core
+ if isinstance(mapping, CSharpMapping) and isinstance(platform, Darwin) and parent in ["IceSSL"]:
+ return False
return True
diff --git a/scripts/IceBoxUtil.py b/scripts/IceBoxUtil.py
index 273d48e9128..af43b853727 100644
--- a/scripts/IceBoxUtil.py
+++ b/scripts/IceBoxUtil.py
@@ -25,14 +25,15 @@ class IceBox(ProcessFromBinDir, Server):
# tests
#
if self.configFile:
- if isinstance(mapping, CSharpMapping) and current.config.netframework:
+ if isinstance(mapping, CSharpMapping) and current.config.dotnetcore:
configFile = self.configFile.format(testdir=current.testsuite.getPath())
- netframework ="\\netstandard2.0\\{0}\\".format(current.config.netframework)
with open(configFile, 'r') as source:
- with open(configFile + ".{0}".format(current.config.netframework), 'w') as target:
+ netcoreapp = mapping.getTargetFramework(current)
+ newConfigFile = configFile + ".netcoreapp"
+ with open(newConfigFile, 'w') as target:
for line in source.readlines():
- target.write(line.replace("\\net45\\", netframework))
- current.files.append(configFile + ".{0}".format(current.config.netframework))
+ target.write(line.replace("\\net45\\", "\\netstandard2.0\\{0}\\".format(netcoreapp)))
+ current.files.append(newConfigFile)
def getExe(self, current):
mapping = self.getMapping(current)
@@ -56,8 +57,8 @@ class IceBox(ProcessFromBinDir, Server):
args = Server.getEffectiveArgs(self, current, args)
if self.configFile:
mapping = self.getMapping(current)
- if isinstance(mapping, CSharpMapping) and current.config.netframework:
- args.append("--Ice.Config={0}".format(self.configFile + ".{0}".format(current.config.netframework)))
+ if isinstance(mapping, CSharpMapping) and current.config.dotnetcore:
+ args.append("--Ice.Config={0}".format(self.configFile + ".netcoreapp"))
else:
args.append("--Ice.Config={0}".format(self.configFile))
return args
diff --git a/scripts/IceGridUtil.py b/scripts/IceGridUtil.py
index 1829fad1c91..698519c45e4 100644
--- a/scripts/IceGridUtil.py
+++ b/scripts/IceGridUtil.py
@@ -252,8 +252,8 @@ class IceGridTestCase(TestCase):
varStr = " ".join(["{0}={1}".format(k, val(v, True)) for k,v in variables.items()])
targets = " ".join(self.targets)
application = self.application
- if current.config.netframework == "netcoreapp2.0":
- application = application.replace(".xml", ".{0}.xml".format("netcoreapp2.0"))
+ if isinstance(self.mapping, CSharpMapping) and current.config.dotnetcore:
+ application = application.replace(".xml", ".netcoreapp.xml")
self.runadmin(current, "application add -n {0} {1} {2}".format(application, varStr, targets))
def teardownClientSide(self, current, success):
diff --git a/scripts/Util.py b/scripts/Util.py
index 5ab1ee0a03f..b20902a8cdc 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -372,7 +372,7 @@ class Windows(Platform):
elif isinstance(process, SliceTranslator):
return os.path.join(installDir, "tools")
elif isinstance(mapping, CSharpMapping):
- return os.path.join(installDir, "tools", current.config.netframework or "net45")
+ return os.path.join(installDir, "tools", mapping.getBinTargetFramework(current))
elif process.isReleaseOnly():
# Some services are only available in release mode in the Nuget package
return os.path.join(installDir, "build", "native", "bin", platform, "Release")
@@ -380,7 +380,7 @@ class Windows(Platform):
return os.path.join(installDir, "build", "native", "bin", platform, config)
else:
if isinstance(mapping, CSharpMapping):
- return os.path.join(installDir, "bin", current.config.netframework or "net45")
+ return os.path.join(installDir, "bin", mapping.getBinTargetFramework(current))
elif isinstance(mapping, PhpMapping):
return os.path.join(self.getNugetPackageDir(component, mapping, current),
"build", "native", "bin", platform, config)
@@ -390,7 +390,7 @@ class Windows(Platform):
def _getLibDir(self, component, process, mapping, current):
installDir = component.getInstallDir(mapping, current)
if isinstance(mapping, CSharpMapping):
- return os.path.join(installDir, "lib", "netstandard2.0" if current.config.netframework else "net45")
+ return os.path.join(installDir, "lib", mapping.getLibTargetFramework(current))
else:
platform = current.driver.configs[mapping].buildPlatform
config = "Debug" if current.driver.configs[mapping].buildConfig.find("Debug") >= 0 else "Release"
@@ -416,7 +416,7 @@ class Windows(Platform):
return None # No default installation directory on Windows
def getNugetPackageDir(self, component, mapping, current):
- if isinstance(mapping, CSharpMapping) and current.config.netframework == "netcoreapp2.0":
+ if isinstance(mapping, CSharpMapping) and current.config.dotnetcore:
return Platform.getNugetPackageDir(self, component, mapping, current)
else:
package = "{0}.{1}".format(component.getNugetPackage(mapping, self.getPlatformToolset()),
@@ -545,7 +545,6 @@ class Mapping(object):
self.device = ""
self.avd = ""
self.androidemulator = False
- self.netframework = ""
self.phpVersion = "7.1"
@@ -3140,36 +3139,35 @@ class CSharpMapping(Mapping):
@classmethod
def getSupportedArgs(self):
- return ("", ["netframework="])
+ return ("", ["dotnetcore"])
@classmethod
def usage(self):
print("")
- print("--netframework Run C# tests using Ice netstandard2.0 libraries and tests")
- print(" build with given .NET Framework [netcoreapp2.0|net4.6]")
+ print("--dotnetcore Run C# tests using .NET Core")
def __init__(self, options=[]):
Mapping.Config.__init__(self, options)
- parseOptions(self, options, { "netframework" : "netframework" })
- #
- # For non Windows platforms the default is netcoreapp2.0 for windows empty
- # means to run test agains .NET Framework 4.5 Ice build
- #
- supportedframeworks = ["netcoreapp2.0"]
- if isinstance(platform, Windows):
- supportedframeworks += ["net461", "net462", "net47", "net471"]
- if self.netframework:
- if not self.netframework in supportedframeworks:
- raise RuntimeError("Unssuported .NET Framework `{0}'".format(self.netframework))
- else:
- self.netframework = "" if isinstance(platform, Windows) else "netcoreapp2.0"
+ self.dotnetcore = not isinstance(platform, Windows)
+
+ parseOptions(self, options)
+
+
+ def getBinTargetFramework(self, current):
+ return "netcoreapp2.0" if current.config.dotnetcore else "net45" # Framework version for the bin subdir
+
+ def getLibTargetFramework(self, current):
+ return "netstandard2.0" if current.config.dotnetcore else "net45" # Framework version for the lib subdir
+
+ def getTargetFramework(self, current):
+ return "netcoreapp2.1" if current.config.dotnetcore else "net45" # Framework version for tests
def getBuildDir(self, name, current):
- if current.config.netframework:
- return os.path.join("msbuild", name, "netstandard2.0", current.config.netframework)
+ if current.config.dotnetcore:
+ return os.path.join("msbuild", name, "netstandard2.0", self.getTargetFramework(current))
else:
- return os.path.join("msbuild", name, "net45")
+ return os.path.join("msbuild", name, self.getTargetFramework(current))
def getSSLProps(self, process, current):
props = Mapping.getSSLProps(self, process, current)
@@ -3211,7 +3209,7 @@ class CSharpMapping(Mapping):
env['PATH'] = os.path.join(toplevel, "cpp", "msbuild", "packages",
"bzip2.{0}.1.0.6.10".format(platform.getPlatformToolset()),
"build", "native", "bin", "x64", "Release")
- if not current.config.netframework:
+ if not current.config.dotnetcore:
env['DEVPATH'] = component.getLibDir(process, self, current)
return env
@@ -3232,7 +3230,7 @@ class CSharpMapping(Mapping):
else:
path = os.path.join(current.testcase.getPath(), current.getBuildDir(exe))
- if current.config.netframework == "netcoreapp2.0":
+ if current.config.dotnetcore:
return "dotnet " + os.path.join(path, exe) + ".dll " + args
else:
return os.path.join(path, exe) + ".exe " + args