diff options
author | Steve MacLean <Steve.MacLean@microsoft.com> | 2018-10-23 15:35:36 -0400 |
---|---|---|
committer | Steve MacLean <stmaclea@microsoft.com> | 2018-10-25 13:21:48 -0400 |
commit | ae97eec9ba8206e3895e76dba1616f742e0631b2 (patch) | |
tree | 78a5df64bbe568b09de57c79a2e0ebaf882be477 /tests | |
parent | 172506218ef056caf787f0ef4846c93c7f6ff53e (diff) | |
download | coreclr-ae97eec9ba8206e3895e76dba1616f742e0631b2.tar.gz coreclr-ae97eec9ba8206e3895e76dba1616f742e0631b2.tar.bz2 coreclr-ae97eec9ba8206e3895e76dba1616f742e0631b2.zip |
ExecInDefAppDom add InjectCode test
Diffstat (limited to 'tests')
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index fe094fb686..23bdbf5fbe 100644 --- a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -62,6 +62,7 @@ public class Program { int result = 100; String myPath = System.Reflection.Assembly.GetExecutingAssembly().Location; + String injectedPath = System.IO.Path.GetDirectoryName(myPath) + "/InjectedCode.dll"; String bogusPath = myPath + "random"; const int S_OK = unchecked((int)0); @@ -83,6 +84,7 @@ public class Program result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "0", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "200", S_OK, 200); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "None", COR_E_FORMAT, 0); + result += TestExecuteInAppDomain(injectedPath, "InjectedCode", "ParseArgument", "300", S_OK, 300); return result; } diff --git a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj index edbf53ddf7..5f170492fb 100644 --- a/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj +++ b/tests/src/Interop/ExecInDefAppDom/ExecInDefAppDom.csproj @@ -29,6 +29,10 @@ <Compile Include="ExecInDefAppDom.cs" /> </ItemGroup> <ItemGroup> + <ProjectReference Include="InjectedCode\InjectedCode.csproj"> + <Project>{FD322A4C-EBCD-4322-90B7-35333EF2FE92}</Project> + <Name>InjectedCode</Name> + </ProjectReference> <!-- This is needed to make sure native binary gets installed in the right location --> <ProjectReference Include="CMakeLists.txt" /> </ItemGroup> diff --git a/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs new file mode 100644 index 0000000000..3870985ba5 --- /dev/null +++ b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.cs @@ -0,0 +1,9 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +using System; + +public class InjectedCode +{ + static int ParseArgument(String argument) { return int.Parse(argument);} +}
\ No newline at end of file diff --git a/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj new file mode 100644 index 0000000000..22e94985a7 --- /dev/null +++ b/tests/src/Interop/ExecInDefAppDom/InjectedCode/InjectedCode.csproj @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <AssemblyName>InjectedCode</AssemblyName> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{FD322A4C-EBCD-4322-90B7-35333EF2FE92}</ProjectGuid> + <OutputType>Library</OutputType> + <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> + <CLRTestKind>BuildOnly</CLRTestKind> + <DefineConstants>$(DefineConstants);$([System.String]::Copy('$(BuildArch)').ToUpper())</DefineConstants> + <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <GenerateRunScript>false</GenerateRunScript> + </PropertyGroup> + <!-- Default configurations to help VS understand the configurations --> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> + </PropertyGroup> + <ItemGroup> + <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> + <Visible>False</Visible> + </CodeAnalysisDependentAssemblyPaths> + </ItemGroup> + <ItemGroup> + <Compile Include="InjectedCode.cs" /> + </ItemGroup> + <ItemGroup> + <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> + </ItemGroup> + <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> +</Project> |