Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extension/src/LanguageServer/devcmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFo
const localize: nls.LocalizeFunc = nls.loadMessageBundle();

const errorNoContext = localize('no.context.provided', 'No context provided');
const errorNotWindows = localize('not.windows', 'The "Set Visual Studio Developer Environment" command is only available on Windows');
export const errorNotWindows = localize('not.windows', 'The "Set Visual Studio Developer Environment" command is only available on Windows');
const errorNoVSFound = localize('error.no.vs', 'A Visual Studio installation with the C++ compiler was not found');
export const errorOperationCancelled = localize('operation.cancelled', 'The operation was cancelled');
const errorNoHostsFound = localize('no.hosts', 'No hosts found');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
* See 'LICENSE' in the project root for license information.
* ------------------------------------------------------------------------------------------ */

import { describe, it } from 'mocha';
import { before, describe, it } from 'mocha';
import { deepEqual, equal, ok } from 'node:assert';
import * as path from 'path';
import { Uri } from 'vscode';
import { extractCompilerPathAndArgs } from '../../../../src/common';
import { isWindows } from '../../../../src/constants';
import { CppProperties } from '../../../../src/LanguageServer/configurations';
import * as testHelpers from '../../../common/testHelpers';

const assetsFolder = Uri.file(path.normalize(path.join(__dirname.replace(/dist[\/\\]/, ''), '..', 'assets')));
const assetsFolderFsPath = assetsFolder.fsPath;

before(async () => {
await testHelpers.activateCppExtension();
});

// A simple test counter for the tests that loop over several cases.
// This is to make it easier to see which test failed in the output.
// Start the counter with 1 instead of 0 since we're reporting on test cases, not arrays.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { suite } from 'mocha';
import * as vscode from 'vscode';
import * as util from '../../../../src/common';
import { isWindows } from "../../../../src/constants";
import { errorOperationCancelled } from '../../../../src/LanguageServer/devcmd';
import { errorNotWindows } from '../../../../src/LanguageServer/devcmd';

suite("set developer environment", () => {
if (isWindows) {
Expand All @@ -32,7 +32,7 @@ suite("set developer environment", () => {
equal(false, true, "Should not be able to set developer environment on non-Windows platform.");
}
catch (e) {
equal((e as Error).message, errorOperationCancelled, "Should throw error when trying to set developer environment on non-Windows platform.");
equal((e as Error).message, errorNotWindows, "Should throw error when trying to set developer environment on non-Windows platform.");
}
equal(util.hasMsvcEnvironment(), false, "MSVC environment should not be set on non-Windows platforms.");
});
Expand Down
Loading