Skip to content

Commit

Permalink
Get test suites running
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Sep 13, 2022
1 parent 0c5afda commit 72d390c
Show file tree
Hide file tree
Showing 19 changed files with 478 additions and 431 deletions.
10 changes: 7 additions & 3 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const cmdLineOptions = require("./scripts/build/options");
const copyright = "CopyrightNotice.txt";
const cleanTasks = [];

const testRunner = "./built/local/testRunner/_namespaces/Harness.js";
const testRunner = "./built/local/testRunner/runner.js";

const buildScripts = () => buildProject("scripts");
task("scripts", buildScripts);
Expand Down Expand Up @@ -94,6 +94,10 @@ const localize = async () => {
}
};

const buildAll = () => buildProject("src");

task("moduleBuild", parallel(generateLibs, series(buildScripts, localize, buildAll)));

const buildDebugTools = () => buildProject("src/debug");
const cleanDebugTools = () => cleanProject("src/debug");
cleanTasks.push(cleanDebugTools);
Expand Down Expand Up @@ -439,7 +443,7 @@ const preTest = parallel(buildTsc, buildTests, buildServices, buildLssl);
preTest.displayName = "preTest";

const runTests = () => runConsoleTests(testRunner, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false);
task("runtests", series(/*preBuild, preTest,*/ runTests)); // TODO(jakebailey): fix this for modules
task("runtests", series(/*preBuild, preTest,*/ task("moduleBuild"), runTests)); // TODO(jakebailey): fix this for modules
task("runtests").description = "Runs the tests using the built run.js file.";
task("runtests").flags = {
"-t --tests=<regex>": "Pattern for tests to run.",
Expand All @@ -458,7 +462,7 @@ task("runtests").flags = {
};

const runTestsParallel = () => runConsoleTests(testRunner, "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
task("runtests-parallel", series(/*preBuild, preTest,*/ runTestsParallel)); // TODO(jakebailey): fix this for modules
task("runtests-parallel", series(/*preBuild, preTest,*/ task("moduleBuild"), runTestsParallel)); // TODO(jakebailey): fix this for modules
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
task("runtests-parallel").flags = {
" --light": "Run tests in light mode (fewer verifications, but tests run faster).",
Expand Down
9 changes: 8 additions & 1 deletion src/compiler/sys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1522,7 +1522,14 @@ export let sys: System = (() => {
}
},
getExecutingFilePath() {
return __filename;
// This function previously returned a path like `built/local/tsc.js`.
// Now, with a module output, this file is now `built/local/compiler/sys.js`.
// We want to return a file that looks like the old one, so that callers
// can locate other assets like the lib.d.ts files.
//
// TODO(jakebailey): replace this function with one that returns the path
// to the lib folder (or package path)?.
return _path.join(_path.dirname(__dirname), "fake.js");
},
getCurrentDirectory,
getDirectories,
Expand Down
4 changes: 2 additions & 2 deletions src/server/_namespaces/ts.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export * from "../../jsTyping/_namespaces/ts.server";
export * from "../types";
export * from "../utilitiesPublic";
export * from "../utilities";
import * as protocol from "./ts.server.protocol";
export { protocol };
export * from "../scriptInfo";
export * from "../typingsCache";
export * from "../project";
Expand All @@ -12,5 +14,3 @@ export * from "../moduleSpecifierCache";
export * from "../packageJsonCache";
export * from "../session";
export * from "../scriptVersionCache";
import * as protocol from "./ts.server.protocol";
export { protocol };
6 changes: 4 additions & 2 deletions src/testRunner/_namespaces/Harness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

export * from "../../harness/_namespaces/Harness";
export * from "../../loggedIO/_namespaces/Harness";

import * as Parallel from "./Harness.Parallel";
export { Parallel };

export * from "../fourslashRunner";
export * from "../compilerRunner";
export * from "../externalCompileRunner";
export * from "../test262Runner";
export * from "../runner";
import * as Parallel from "./Harness.Parallel";
export { Parallel };
186 changes: 186 additions & 0 deletions src/testRunner/_namespaces/tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// Tests; see tsconfig.json list

import "../unittests/asserts";
import "../unittests/base64";
import "../unittests/builder";
import "../unittests/comments";
import "../unittests/compilerCore";
import "../unittests/convertToBase64";
import "../unittests/customTransforms";
import "../unittests/factory";
import "../unittests/incrementalParser";
import "../unittests/jsDocParsing";
import "../unittests/jsonParserRecovery";
import "../unittests/moduleResolution";
import "../unittests/parsePseudoBigInt";
import "../unittests/paths";
import "../unittests/printer";
import "../unittests/programApi";
import "../unittests/publicApi";
import "../unittests/reuseProgramStructure";
import "../unittests/semver";
import "../unittests/transform";
import "../unittests/config/commandLineParsing";
import "../unittests/config/configurationExtension";
import "../unittests/config/convertCompilerOptionsFromJson";
import "../unittests/config/convertTypeAcquisitionFromJson";
import "../unittests/config/initializeTSConfig";
import "../unittests/config/matchFiles";
import "../unittests/config/projectReferences";
import "../unittests/config/showConfig";
import "../unittests/config/tsconfigParsing";
import "../unittests/config/tsconfigParsingWatchOptions";
import "../unittests/evaluation/arraySpread";
import "../unittests/evaluation/asyncArrow";
import "../unittests/evaluation/asyncGenerator";
import "../unittests/evaluation/awaiter";
import "../unittests/evaluation/destructuring";
import "../unittests/evaluation/externalModules";
import "../unittests/evaluation/forAwaitOf";
import "../unittests/evaluation/forOf";
import "../unittests/evaluation/optionalCall";
import "../unittests/evaluation/objectRest";
import "../unittests/evaluation/superInStaticInitializer";
import "../unittests/evaluation/templateLiteral";
import "../unittests/evaluation/updateExpressionInModule";
import "../unittests/services/cancellableLanguageServiceOperations";
import "../unittests/services/colorization";
import "../unittests/services/convertToAsyncFunction";
import "../unittests/services/documentRegistry";
import "../unittests/services/extract/constants";
import "../unittests/services/extract/functions";
import "../unittests/services/extract/symbolWalker";
import "../unittests/services/extract/ranges";
import "../unittests/services/hostNewLineSupport";
import "../unittests/services/languageService";
import "../unittests/services/organizeImports";
import "../unittests/services/patternMatcher";
import "../unittests/services/preProcessFile";
import "../unittests/services/textChanges";
import "../unittests/services/transpile";
import "../unittests/tsbuild/amdModulesWithOut";
import "../unittests/tsbuild/clean";
import "../unittests/tsbuild/configFileErrors";
import "../unittests/tsbuild/configFileExtends";
import "../unittests/tsbuild/containerOnlyReferenced";
import "../unittests/tsbuild/declarationEmit";
import "../unittests/tsbuild/demo";
import "../unittests/tsbuild/emitDeclarationOnly";
import "../unittests/tsbuild/emptyFiles";
import "../unittests/tsbuild/exitCodeOnBogusFile";
import "../unittests/tsbuild/graphOrdering";
import "../unittests/tsbuild/inferredTypeFromTransitiveModule";
import "../unittests/tsbuild/javascriptProjectEmit";
import "../unittests/tsbuild/lateBoundSymbol";
import "../unittests/tsbuild/moduleResolution";
import "../unittests/tsbuild/moduleSpecifiers";
import "../unittests/tsbuild/noEmitOnError";
import "../unittests/tsbuild/outFile";
import "../unittests/tsbuild/outputPaths";
import "../unittests/tsbuild/publicApi";
import "../unittests/tsbuild/referencesWithRootDirInParent";
import "../unittests/tsbuild/resolveJsonModule";
import "../unittests/tsbuild/sample";
import "../unittests/tsbuild/transitiveReferences";
import "../unittests/tsbuildWatch/configFileErrors";
import "../unittests/tsbuildWatch/demo";
import "../unittests/tsbuildWatch/moduleResolution";
import "../unittests/tsbuildWatch/noEmit";
import "../unittests/tsbuildWatch/noEmitOnError";
import "../unittests/tsbuildWatch/programUpdates";
import "../unittests/tsbuildWatch/projectsBuilding";
import "../unittests/tsbuildWatch/publicApi";
import "../unittests/tsbuildWatch/reexport";
import "../unittests/tsbuildWatch/watchEnvironment";
import "../unittests/tsc/cancellationToken";
import "../unittests/tsc/composite";
import "../unittests/tsc/declarationEmit";
import "../unittests/tsc/forceConsistentCasingInFileNames";
import "../unittests/tsc/incremental";
import "../unittests/tsc/listFilesOnly";
import "../unittests/tsc/projectReferences";
import "../unittests/tsc/redirect";
import "../unittests/tsc/runWithoutArgs";
import "../unittests/tscWatch/consoleClearing";
import "../unittests/tscWatch/emit";
import "../unittests/tscWatch/nodeNextWatch";
import "../unittests/tscWatch/emitAndErrorUpdates";
import "../unittests/tscWatch/forceConsistentCasingInFileNames";
import "../unittests/tscWatch/incremental";
import "../unittests/tscWatch/moduleResolution";
import "../unittests/tscWatch/programUpdates";
import "../unittests/tscWatch/projectsWithReferences";
import "../unittests/tscWatch/resolutionCache";
import "../unittests/tscWatch/sourceOfProjectReferenceRedirect";
import "../unittests/tscWatch/watchApi";
import "../unittests/tscWatch/watchEnvironment";
import "../unittests/tsserver/applyChangesToOpenFiles";
import "../unittests/tsserver/autoImportProvider";
import "../unittests/tsserver/auxiliaryProject";
import "../unittests/tsserver/cachingFileSystemInformation";
import "../unittests/tsserver/cancellationToken";
import "../unittests/tsserver/compileOnSave";
import "../unittests/tsserver/completions";
import "../unittests/tsserver/completionsIncomplete";
import "../unittests/tsserver/configFileSearch";
import "../unittests/tsserver/configuredProjects";
import "../unittests/tsserver/declarationFileMaps";
import "../unittests/tsserver/documentRegistry";
import "../unittests/tsserver/duplicatePackages";
import "../unittests/tsserver/dynamicFiles";
import "../unittests/tsserver/events/largeFileReferenced";
import "../unittests/tsserver/events/projectLanguageServiceState";
import "../unittests/tsserver/events/projectLoading";
import "../unittests/tsserver/events/projectUpdatedInBackground";
import "../unittests/tsserver/exportMapCache";
import "../unittests/tsserver/externalProjects";
import "../unittests/tsserver/forceConsistentCasingInFileNames";
import "../unittests/tsserver/formatSettings";
import "../unittests/tsserver/getApplicableRefactors";
import "../unittests/tsserver/getEditsForFileRename";
import "../unittests/tsserver/getExportReferences";
import "../unittests/tsserver/getFileReferences";
import "../unittests/tsserver/importHelpers";
import "../unittests/tsserver/inlayHints";
import "../unittests/tsserver/inferredProjects";
import "../unittests/tsserver/jsdocTag";
import "../unittests/tsserver/languageService";
import "../unittests/tsserver/maxNodeModuleJsDepth";
import "../unittests/tsserver/metadataInResponse";
import "../unittests/tsserver/moduleResolution";
import "../unittests/tsserver/moduleSpecifierCache";
import "../unittests/tsserver/navTo";
import "../unittests/tsserver/occurences";
import "../unittests/tsserver/openFile";
import "../unittests/tsserver/packageJsonInfo";
import "../unittests/tsserver/partialSemanticServer";
import "../unittests/tsserver/plugins";
import "../unittests/tsserver/projectErrors";
import "../unittests/tsserver/projectReferenceCompileOnSave";
import "../unittests/tsserver/projectReferenceErrors";
import "../unittests/tsserver/projectReferences";
import "../unittests/tsserver/projectReferencesSourcemap";
import "../unittests/tsserver/projects";
import "../unittests/tsserver/projectsWithReferences";
import "../unittests/tsserver/refactors";
import "../unittests/tsserver/reload";
import "../unittests/tsserver/reloadProjects";
import "../unittests/tsserver/rename";
import "../unittests/tsserver/resolutionCache";
import "../unittests/tsserver/session";
import "../unittests/tsserver/skipLibCheck";
import "../unittests/tsserver/smartSelection";
import "../unittests/tsserver/symlinkCache";
import "../unittests/tsserver/symLinks";
import "../unittests/tsserver/syntacticServer";
import "../unittests/tsserver/syntaxOperations";
import "../unittests/tsserver/textStorage";
import "../unittests/tsserver/telemetry";
import "../unittests/tsserver/typeAquisition";
import "../unittests/tsserver/typeOnlyImportChains";
import "../unittests/tsserver/typeReferenceDirectives";
import "../unittests/tsserver/typingsInstaller";
import "../unittests/tsserver/versionCache";
import "../unittests/tsserver/watchEnvironment";
import "../unittests/tsserver/webServer";
import "../unittests/debugDeprecation";
66 changes: 0 additions & 66 deletions src/testRunner/_namespaces/ts.projectSystem.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,3 @@
/* Generated file to emulate the ts.projectSystem namespace. */

export * from "../unittests/tsserver/helpers";
export * from "../unittests/tsserver/applyChangesToOpenFiles";
export * from "../unittests/tsserver/autoImportProvider";
export * from "../unittests/tsserver/auxiliaryProject";
export * from "../unittests/tsserver/cachingFileSystemInformation";
export * from "../unittests/tsserver/cancellationToken";
export * from "../unittests/tsserver/compileOnSave";
export * from "../unittests/tsserver/completions";
export * from "../unittests/tsserver/completionsIncomplete";
export * from "../unittests/tsserver/configFileSearch";
export * from "../unittests/tsserver/configuredProjects";
export * from "../unittests/tsserver/declarationFileMaps";
export * from "../unittests/tsserver/documentRegistry";
export * from "../unittests/tsserver/duplicatePackages";
export * from "../unittests/tsserver/dynamicFiles";
export * from "../unittests/tsserver/events/largeFileReferenced";
export * from "../unittests/tsserver/events/projectLanguageServiceState";
export * from "../unittests/tsserver/events/projectLoading";
export * from "../unittests/tsserver/events/projectUpdatedInBackground";
export * from "../unittests/tsserver/exportMapCache";
export * from "../unittests/tsserver/externalProjects";
export * from "../unittests/tsserver/forceConsistentCasingInFileNames";
export * from "../unittests/tsserver/formatSettings";
export * from "../unittests/tsserver/getApplicableRefactors";
export * from "../unittests/tsserver/getEditsForFileRename";
export * from "../unittests/tsserver/getExportReferences";
export * from "../unittests/tsserver/getFileReferences";
export * from "../unittests/tsserver/importHelpers";
export * from "../unittests/tsserver/inlayHints";
export * from "../unittests/tsserver/inferredProjects";
export * from "../unittests/tsserver/jsdocTag";
export * from "../unittests/tsserver/languageService";
export * from "../unittests/tsserver/maxNodeModuleJsDepth";
export * from "../unittests/tsserver/metadataInResponse";
export * from "../unittests/tsserver/moduleResolution";
export * from "../unittests/tsserver/moduleSpecifierCache";
export * from "../unittests/tsserver/navTo";
export * from "../unittests/tsserver/occurences";
export * from "../unittests/tsserver/openFile";
export * from "../unittests/tsserver/packageJsonInfo";
export * from "../unittests/tsserver/partialSemanticServer";
export * from "../unittests/tsserver/plugins";
export * from "../unittests/tsserver/projectErrors";
export * from "../unittests/tsserver/projectReferenceCompileOnSave";
export * from "../unittests/tsserver/projectReferenceErrors";
export * from "../unittests/tsserver/projectReferences";
export * from "../unittests/tsserver/projectReferencesSourcemap";
export * from "../unittests/tsserver/projects";
export * from "../unittests/tsserver/projectsWithReferences";
export * from "../unittests/tsserver/refactors";
export * from "../unittests/tsserver/reload";
export * from "../unittests/tsserver/reloadProjects";
export * from "../unittests/tsserver/rename";
export * from "../unittests/tsserver/resolutionCache";
export * from "../unittests/tsserver/skipLibCheck";
export * from "../unittests/tsserver/smartSelection";
export * from "../unittests/tsserver/symlinkCache";
export * from "../unittests/tsserver/symLinks";
export * from "../unittests/tsserver/syntacticServer";
export * from "../unittests/tsserver/syntaxOperations";
export * from "../unittests/tsserver/telemetry";
export * from "../unittests/tsserver/typeAquisition";
export * from "../unittests/tsserver/typeOnlyImportChains";
export * from "../unittests/tsserver/typeReferenceDirectives";
export * from "../unittests/tsserver/typingsInstaller";
export * from "../unittests/tsserver/watchEnvironment";
export * from "../unittests/tsserver/webServer";
1 change: 0 additions & 1 deletion src/testRunner/_namespaces/ts.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ export * from "../../webServer/_namespaces/ts.server";
export * from "../../typingsInstallerCore/_namespaces/ts.server";
export * from "../../harness/_namespaces/ts.server";
export * from "../../loggedIO/_namespaces/ts.server";
export * from "../unittests/tsserver/session";
2 changes: 1 addition & 1 deletion src/testRunner/_namespaces/ts.textStorage.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* Generated file to emulate the ts.textStorage namespace. */

export * from "../unittests/tsserver/textStorage";
export {};
Loading

0 comments on commit 72d390c

Please sign in to comment.