提交 00d62c8f 编写于 作者: B Balaji Soundrarajan

All tests are under Tests folder

This change expects all the tests to be under the Tests folder under the
Perf folder

and some refactorings
上级 f6010fd1
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#load "../util/test_util.csx"
#load "../../util/test_util.csx"
using System.IO;
InitUtilities();
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#load "../../util/test_util.csx"
#load "../../../util/test_util.csx"
using System.IO;
InitUtilities();
......
......@@ -10,13 +10,7 @@ using System;
InitUtilities();
var myDir = MyWorkingDirectory();
var skip = new HashSet<string> {
Path.Combine(myDir, "runner.csx"),
Path.Combine(myDir, "bootstrap.csx"),
Path.Combine(myDir, "util"),
Path.Combine(myDir, "infra"),
};
var testDirectory = PerfTestDirectory();
var allResults = new List<Tuple<string, List<Tuple<int, string, object>>>>();
var failed = false;
......@@ -31,7 +25,7 @@ Log("hash: " + StdoutFrom("git", "show --format=\"%h\" HEAD --").Split(new[] {"\
Log("time: " + DateTime.Now.ToString());
// Run all the scripts that we've found and populate allResults.
foreach (var script in AllCsiRecursive(myDir, skip)) {
foreach (var script in GetAllCsxRecursive(testDirectory)) {
var scriptName = Path.GetFileNameWithoutExtension(script);
Log("\nRunning " + scriptName);
try
......
......@@ -3,8 +3,6 @@
using System;
using System.IO;
InitUtilities();
public void DownloadCPC()
{
var cpcDestinationPath = GetCPCDirectoryPath();
......
......@@ -38,3 +38,21 @@ async Task<ScriptState<object>> RunFile(string fileName)
return await state.ContinueWithAsync<object>(text, scriptOptions);
}
/// Gets all csx file recursively in a given directory
IEnumerable<string> GetAllCsxRecursive(string directoryName)
{
foreach (var fileName in Directory.EnumerateFiles(directoryName, "*.csx"))
{
yield return fileName;
}
foreach (var childDir in Directory.EnumerateDirectories(directoryName))
{
foreach (var fileName in GetAllCsxRecursive(childDir))
{
yield return fileName;
}
}
}
......@@ -81,6 +81,11 @@ string BinDirectory()
return Path.Combine(RoslynDirectory(), "Binaries");
}
string PerfTestDirectory()
{
return Path.Combine(RoslynDirectory(), "src", "Test", "Perf", "Tests");
}
string BinDebugDirectory()
{
return Path.Combine(BinDirectory(), "Debug");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册