hello_world.csx 1.3 KB
Newer Older
S
Sam Harwell 已提交
1
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
2

3
#r "../../Perf.Utilities/Roslyn.Test.Performance.Utilities.dll"
4

T
Ty Overby 已提交
5
using System.IO;
6 7
using Roslyn.Test.Performance.Utilities;
using static Roslyn.Test.Performance.Utilities.TestUtilities;
T
Ty Overby 已提交
8

9
class HelloWorldTest : PerfTest 
10 11 12
{
    private string _pathToHelloWorld;
    private string _pathToOutput;
13 14 15 16
    private ILogger _logger;
    
    public HelloWorldTest(): base() 
    {
17
        _logger = new ConsoleAndFileLogger();
18
    }
19 20
    
    
21
    public override void Setup()
22 23
    {
        _pathToHelloWorld = Path.Combine(MyWorkingDirectory, "HelloWorld.cs");
24
        _pathToOutput = Path.Combine(TempDirectory, "HelloWorld.exe");
25 26 27 28
    }
    
    public override void Test() 
    {
29
        ShellOutVital(Path.Combine(MyBinaries(), "Exes", "csc", "net46", @"csc.exe"), _pathToHelloWorld + " /out:" + _pathToOutput, MyWorkingDirectory);
30
        _logger.Flush();
31 32
    }
    
33
    public override int Iterations => 3;
34
    public override string Name => "hello world";
B
Fix CPC  
Balaji Soundrarajan 已提交
35
    public override string MeasuredProc => "csc";
36 37 38 39 40
    public override bool ProvidesScenarios => false;
    public override string[] GetScenarios()
    {
        throw new System.NotImplementedException();
    }
41
}
T
Ty Overby 已提交
42

T
Ty Overby 已提交
43
TestThisPlease(new HelloWorldTest());