-
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.
Merge branch 'main' into feature/add-bash-completion
- Loading branch information
Showing
24 changed files
with
1,158 additions
and
91 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,20 +12,24 @@ | |
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]" | ||
"[email protected]" | ||
], | ||
"settings": { | ||
"C_Cpp.intelliSenseEngine": "disabled", | ||
"C_Cpp.formatting": "clangFormat", | ||
"clangd.arguments": [ | ||
"--query-driver=/opt/**/arm-none-eabi-*", | ||
"--compile-commands-dir=${userHome}/.amp" | ||
], | ||
"cmake.copyCompileCommands": "${userHome}/.amp/compile_commands.json", | ||
"cortex-debug.gdbPath": "gdb-multiarch", | ||
"cortex-debug.objdumpPath": "arm-none-eabi-objdump", | ||
"sonarlint.pathToCompileCommands": "/root/.amp/compile_commands.json" | ||
"sonarlint.pathToCompileCommands": "/root/.amp/compile_commands.json", | ||
"[c]": { | ||
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" | ||
}, | ||
"[cpp]": { | ||
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" | ||
} | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -20,10 +20,16 @@ | |
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"cucumberautocomplete.steps": [".devcontainer/cpp/e2e/features/steps/*.steps.ts"], | ||
"cucumberautocomplete.strictGherkinCompletion": false, | ||
"cucumberautocomplete.strictGherkinValidation": false, | ||
"cucumberautocomplete.smartSnippets": true, | ||
"cucumberautocomplete.onTypeFormat": true, | ||
"files.insertFinalNewline": true, | ||
"files.trimTrailingWhitespace": true | ||
}, | ||
"extensions": [ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
|
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,18 @@ | ||
Feature: Compile source code into working software | ||
|
||
As a developer | ||
In order to generate working software | ||
Source code needs to be compiled successfully | ||
|
||
Scenario: Compile valid source code into working software targeting the host architecture | ||
|
||
Compiling valid source code into working software, able to run on the host architecture, | ||
can be necessary in several scenarios; for example when: | ||
|
||
- the host is the deployment target | ||
- running tests on the host | ||
- building plug-ins, extensions, code generators, or other additional tools that need to run on the host | ||
|
||
Given the default build configuration is selected | ||
When the configuration "host" is built | ||
Then the output should contain "Build finished with exit code 0" |
37 changes: 37 additions & 0 deletions
37
.devcontainer/cpp/e2e/features/pages/authentication.pom.ts
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,37 @@ | ||
import { type Page } from '@playwright/test'; | ||
import * as OTPAuth from 'otpauth'; | ||
import { STORAGE_STATE } from '../../playwright.config'; | ||
|
||
export class AuthenticationPage { | ||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
async authenticate() { | ||
await this.page.goto('https://github.com/login'); | ||
await this.page.getByLabel('Username or email address').fill(process.env.GITHUB_USER!); | ||
await this.page.getByLabel('Password').fill(process.env.GITHUB_PASSWORD!); | ||
await this.page.getByRole('button', { name: 'Sign in', exact: true }).click(); | ||
|
||
let totp = new OTPAuth.TOTP({ | ||
issuer: 'GitHub', | ||
label: 'GitHub', | ||
algorithm: 'SHA1', | ||
digits: 6, | ||
period: 30, | ||
secret: process.env.GITHUB_TOTP_SECRET! | ||
}); | ||
|
||
let code = totp.generate(); | ||
await this.page.getByPlaceholder('XXXXXX').fill(code); | ||
|
||
// Wait until the page receives the cookies. | ||
// | ||
// Sometimes login flow sets cookies in the process of several redirects. | ||
// Wait for the final URL to ensure that the cookies are actually set. | ||
await this.page.waitForURL('https://github.com/'); | ||
await this.page.context().storageState({ path: STORAGE_STATE }); | ||
} | ||
} |
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 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,24 @@ | ||
import { AuthenticationPage } from '../pages/authentication.pom'; | ||
import { CodespacePage } from '../pages/codespace.pom'; | ||
import { test as base, createBdd } from 'playwright-bdd'; | ||
|
||
export const test = base.extend<{ codespacePage: CodespacePage }, { authenticationPage: AuthenticationPage }>({ | ||
authenticationPage: [async ({ browser }, use) => { | ||
let authenticationPage = new AuthenticationPage(await browser.newPage()); | ||
await authenticationPage.authenticate(); | ||
|
||
await use(authenticationPage); | ||
}, { scope: 'worker', auto: true } | ||
], | ||
codespacePage: async ({ page }, use) => { | ||
const codespacePage = new CodespacePage(page); | ||
await codespacePage.goto(); | ||
await codespacePage.areExtensionsActive(['Testing', 'SonarLint', 'CMake', 'Live Share', 'GitHub Pull Requests']); | ||
|
||
await use(codespacePage); | ||
|
||
await codespacePage.executeInTerminal('git clean -fdx'); | ||
}, | ||
}); | ||
|
||
export const { Given, When, Then } = createBdd(test); |
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 was deleted.
Oops, something went wrong.
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
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; | ||
} |
Oops, something went wrong.