-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: consolidate formatting in amp-devcontainer-cpp (#582)
* chore: consolidate formatting in amp-devcontainer-cpp * chore: don't forcefully enable formatOnSave * chore: fix xwin-cache * test: add test for formatting * test: make execute in terminal more robust * test: revert fill on terminal; element is not an input * test: look in the correct place for terminal output
- Loading branch information
Showing
11 changed files
with
398 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
.devcontainer/cpp/e2e/features/static-dynamic-analysis.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Analyze source code using static and dynamic analysis | ||
|
||
As a software craftsman | ||
To maintain consistent, high-quality and bug-free code | ||
Source code needs to be statically and dynamically analyzed | ||
|
||
Scenario: Format source code according to a formatting style | ||
|
||
Given the file "unformatted.cpp" is opened in the editor | ||
When the active document is formatted | ||
And the active document is saved | ||
Then the contents of "unformatted.cpp" should match the contents of "formatted.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { expect } from "@playwright/test"; | ||
import { Given, When, Then } from "./fixtures"; | ||
import * as path from 'path'; | ||
|
||
Given("the default build configuration is selected", async () => { | ||
// No-op | ||
}); | ||
|
||
Given("the file {string} is opened in the editor", async ({ codespacePage }, file: string) => { | ||
const fileExtension = path.extname(file).slice(1); | ||
|
||
switch (fileExtension) { | ||
case 'cpp': | ||
await codespacePage.openCppFileInEditor(file); | ||
break; | ||
default: | ||
await codespacePage.openFileInEditor(file); | ||
} | ||
}); | ||
|
||
When("the configuration {string} is built", async ({ codespacePage }, configuration: string) => { | ||
await codespacePage.page.getByRole('button', { name: 'Build the selected target' }).click(); | ||
await codespacePage.page.getByLabel(configuration).locator('a').click(); | ||
}); | ||
|
||
When("the active document is formatted", async ({ codespacePage }) => { | ||
await codespacePage.formatDocument(); | ||
}); | ||
|
||
When("the active document is saved", async ({ codespacePage }) => { | ||
await codespacePage.saveDocument(); | ||
}); | ||
|
||
Then("the output should contain {string}", async ({ codespacePage }, expectedOutput: string) => { | ||
await expect(codespacePage.outputPanel).toContainText(expectedOutput, { timeout: 5 * 60 * 1000 }); | ||
}); | ||
|
||
Then("the editor should contain {string}", async ({ codespacePage }, expectedContent: string) => { | ||
await codespacePage.expectEditorContent(new RegExp(expectedContent)); | ||
}); | ||
|
||
Then("the contents of {string} should match the contents of {string}", async ({ codespacePage }, actual: string, expected: string) => { | ||
await codespacePage.expectFileContentsToMatch(actual, expected); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <algorithm> | ||
#include <iostream> | ||
|
||
int main() { | ||
std::cout << "Hello World!" << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <iostream> | ||
#include <algorithm> | ||
|
||
int main() | ||
{ | ||
std::cout << "Hello World!" << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.