chore: Update BenchmarkDotNet.Samples project
This PR contains following changes.
1. Add code to return exit code
Currently void Main is used, and it return ExitCode: 0 regardless validation/build/benchmark failure exists.
This PR add code to return error code when failed. (Except for non-critical validation error)
2. Add Properties/launchSettings.json
Add profiles to switch settings (VisualStudio or Use --launch-profile argument).
By default, Default profile is loaded. (It can be suppressed when pass --no-launch-profile)
"workingDirectory": ".", setting is added to output logs based on current directory.
(It's project directory when running on VS)
Previous behavior output logs to bin/$(Configuration)/$(TargetFramework).
3. Add code for debugging
Add dedicated config that is used when build with Debug configuration.
It's expected to be used for Debugging with "Run IntroBasic Benchmarks" profile.
Note:
When target benchmark define local config with [Config(typeof(Config))].
Job is merged with ConfigUnionRule.Union rule. And it's not works as expected.
(Because both Job is executed that included GlobalConfig/LocalConfig)
CI tests(test-macos(arm64)) failed on AllocationQuantumIsNotAnIssueForNetCore21Plus
It's expected to caused by #2779 and fixed by rerun.
I've modified code to use DebugBuildConfig/DebugInProcessConfig.
By default, DebugBuildConfig is used on Debug build. (Target benchmarks are also build with Debug configuration).
When --inProcess argument is passed. It use DebugInProcessConfig instead.
Other changes
- Add some settings that are used on
DefaultConfig. - Add
MemoryDiagnoser/ExceptionDiagnoser/ThreadingDiagnoser(Requires .NET 3.0+) RunStrategy.Monitoringsetting is removed from config. and need to specified as command line argument.