diff options
author | Aaron Robinson <arobins@microsoft.com> | 2022-03-05 06:40:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-05 06:40:27 +0300 |
commit | 6fe1a80959b96fc2fbb7a2a1022a881dbf9f8af7 (patch) | |
tree | 2de478db8b82e81ef9c9f61e4c7207f1a9d5b058 /docs | |
parent | 95770c9198df503d16b5aa9880ebc4e634a970e7 (diff) |
Use CMakeProjectReference instead of ProjectReference (#66202)
* Use CMakeProjectReference instead of ProjectReference
Changing this permits usage of "\runtime\dotnet.cmd build" as opposed
to forcing users to use "\runtime\dotnet.cmd msbuild".
Diffstat (limited to 'docs')
-rw-r--r-- | docs/workflow/testing/coreclr/test-configuration.md | 43 | ||||
-rw-r--r-- | docs/workflow/testing/coreclr/testing.md | 2 |
2 files changed, 24 insertions, 21 deletions
diff --git a/docs/workflow/testing/coreclr/test-configuration.md b/docs/workflow/testing/coreclr/test-configuration.md index a2342d3bb6e..4f5d11cf6ab 100644 --- a/docs/workflow/testing/coreclr/test-configuration.md +++ b/docs/workflow/testing/coreclr/test-configuration.md @@ -66,28 +66,31 @@ should simply `throw new PlatformNotSupportedException()` in its dummy method im 1. Set the `<CLRTestKind>`/`<CLRTestPriority>` properties. 1. Add source files to the new project. -1. Indicate the success of the test by returning `100`. Failure can be indicated by any non-`100` value. - - Example: - ```CSharp - static public int Main(string[] notUsed) - { - try - { - // Test scenario here - } - catch (Exception e) - { - Console.WriteLine($"Test Failure: {e.Message}"); - return 101; - } - - return 100; - } - ``` +1. Add test cases using the Xunit `Fact` attribute. + + - We use a source generator to construct the `Main` entry point for test projects. The source generator will discover all methods marked with `Fact` and call them from the generated `Main`. + - Alternatively, `Main` can be user-defined. On success, the test returns `100`. Failure can be indicated by any non-`100` value. + + Example: + ```CSharp + static public int Main(string[] notUsed) + { + try + { + // Test scenario here + } + catch (Exception e) + { + Console.WriteLine($"Test Failure: {e}"); + return 101; + } + + return 100; + } + ``` 1. Add any other projects as a dependency, if needed. * Managed reference: `<ProjectReference Include="../ManagedDll.csproj" />` - * Native reference: `<ProjectReference Include="../NativeDll/CMakeLists.txt" />` + * CMake reference: `<CMakeProjectReference Include="../NativeDll/CMakeLists.txt" />` 1. Build the test. 1. Follow the steps to re-run a failed test to validate the new test. diff --git a/docs/workflow/testing/coreclr/testing.md b/docs/workflow/testing/coreclr/testing.md index 2deb2a0ed3d..fb17cfd0765 100644 --- a/docs/workflow/testing/coreclr/testing.md +++ b/docs/workflow/testing/coreclr/testing.md @@ -35,7 +35,7 @@ Note: CoreCLR must be built prior to building an individual test. See the first ``` <runtime-repo-root>/dotnet.sh build <runtime-repo-root>/src/tests/<path-to-project> -c <configuration> ``` - * To build managed test projects with dependencies on native test projects, the native test project must first be built. The managed test should then be built using `dotnet build --no-restore` to skip restoring. + * To build managed test projects with dependencies on native test projects, the native test project must first be built. ## Additional Documents |