diff --git a/.devcontainer/cpp-test/devcontainer.json b/.devcontainer/cpp-test/devcontainer.json index 02940f28..8d65dc01 100644 --- a/.devcontainer/cpp-test/devcontainer.json +++ b/.devcontainer/cpp-test/devcontainer.json @@ -1,10 +1,14 @@ { "image": "ghcr.io/philips-software/amp-devcontainer-cpp:${localEnv:IMAGE_VERSION}", - "workspaceFolder": "/workspaces/amp-devcontainer/.devcontainer/cpp/e2e/workspace", + "workspaceFolder": "/workspaces/amp-devcontainer/test/cpp/workspace", "customizations": { "vscode": { "settings": { - "cmake.automaticReconfigure": false + "cmake.automaticReconfigure": false, + "cmake.configureOnOpen": false, + "cmake.ctest.testExplorerIntegrationEnabled": false, + "cmake.enableAutomaticKitScan": false, + "cmake.showOptionsMovedNotification": false } } } diff --git a/.devcontainer/cpp/devcontainer.json b/.devcontainer/cpp/devcontainer.json index ec41c60e..ad326b26 100644 --- a/.devcontainer/cpp/devcontainer.json +++ b/.devcontainer/cpp/devcontainer.json @@ -20,7 +20,7 @@ "customizations": { "vscode": { "settings": { - "cucumberautocomplete.steps": [".devcontainer/cpp/e2e/features/steps/*.steps.ts"], + "cucumberautocomplete.steps": ["test/cpp/features/steps/*.steps.ts"], "cucumberautocomplete.strictGherkinCompletion": false, "cucumberautocomplete.strictGherkinValidation": false, "cucumberautocomplete.smartSnippets": true, diff --git a/.devcontainer/cpp/e2e/workspace/CMakeLists.txt b/.devcontainer/cpp/e2e/workspace/CMakeLists.txt deleted file mode 100644 index b67fe424..00000000 --- a/.devcontainer/cpp/e2e/workspace/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -cmake_minimum_required(VERSION 3.24) - -project(e2e-test VERSION 1.0.0) - -add_executable(e2e-test main.cpp) diff --git a/.devcontainer/cpp/e2e/workspace/CMakePresets.json b/.devcontainer/cpp/e2e/workspace/CMakePresets.json deleted file mode 100644 index 1a0a9aad..00000000 --- a/.devcontainer/cpp/e2e/workspace/CMakePresets.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "version": 3, - "configurePresets": [ - { - "name": "defaults", - "hidden": true, - "binaryDir": "${sourceDir}/build/${presetName}", - "generator": "Ninja Multi-Config", - "cacheVariables": { - "CMAKE_CONFIGURATION_TYPES": "Debug;Release;RelWithDebInfo;MinSizeRel" - } - }, - { - "name": "host", - "inherits": "defaults" - } - ], - "buildPresets": [ - { - "name": "host-Debug", - "configuration": "Debug", - "configurePreset": "host" - }, - { - "name": "host-Release", - "configuration": "Release", - "configurePreset": "host" - }, - { - "name": "host-RelWithDebInfo", - "configuration": "RelWithDebInfo", - "configurePreset": "host" - }, - { - "name": "host-MinSizeRel", - "configuration": "MinSizeRel", - "configurePreset": "host" - } - ] -} diff --git a/.devcontainer/cpp/e2e/workspace/formatted.cpp b/.devcontainer/cpp/e2e/workspace/formatted.cpp deleted file mode 100644 index c2266d56..00000000 --- a/.devcontainer/cpp/e2e/workspace/formatted.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include -#include - -int main() { - std::cout << "Hello World!" << std::endl; - return 0; -} diff --git a/.devcontainer/cpp/e2e/workspace/main.cpp b/.devcontainer/cpp/e2e/workspace/main.cpp deleted file mode 100644 index 37a56944..00000000 --- a/.devcontainer/cpp/e2e/workspace/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -void SmellyFunction() -{ - auto array = new int[10]; -} - -int main() -{ - std::cout << "Hello World!" << std::endl; - return 0; -} diff --git a/.devcontainer/cpp/e2e/workspace/unformatted.cpp b/.devcontainer/cpp/e2e/workspace/unformatted.cpp deleted file mode 100644 index faa6721a..00000000 --- a/.devcontainer/cpp/e2e/workspace/unformatted.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main() -{ - std::cout << "Hello World!" << std::endl; - return 0; -} diff --git a/.devcontainer/cpp/test/gcc-arm-none-eabi/main.cpp b/.devcontainer/cpp/test/gcc-arm-none-eabi/main.cpp deleted file mode 100644 index ca3e2918..00000000 --- a/.devcontainer/cpp/test/gcc-arm-none-eabi/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -void _exit(int status) -{ - while (1) {} -} - -int main() {} diff --git a/.devcontainer/cpp/test/sanitizers/threadsan.cpp b/.devcontainer/cpp/test/sanitizers/threadsan.cpp deleted file mode 100644 index 50d8a377..00000000 --- a/.devcontainer/cpp/test/sanitizers/threadsan.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include - -int main() -{ - int i = 0; - - std::thread t([&] { i = 10; }); - i = 20; - t.join(); - - return i; -} diff --git a/.devcontainer/rust-test/devcontainer.json b/.devcontainer/rust-test/devcontainer.json new file mode 100644 index 00000000..153307fb --- /dev/null +++ b/.devcontainer/rust-test/devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "ghcr.io/philips-software/amp-devcontainer-rust:${localEnv:IMAGE_VERSION}", + "workspaceFolder": "/workspaces/amp-devcontainer/test/rust/workspace" +} diff --git a/.github/workflows/acceptance-test.yml b/.github/workflows/acceptance-test.yml index 96c116ec..c3f40b3d 100644 --- a/.github/workflows/acceptance-test.yml +++ b/.github/workflows/acceptance-test.yml @@ -39,11 +39,18 @@ jobs: env: GH_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }} HEAD_REF: ${{ github.head_ref }} - - run: cd .devcontainer/${{ inputs.flavor }}/e2e && npm test + - run: cd test/${{ inputs.flavor }}/features && npm test env: GITHUB_USER: ${{ secrets.TEST_GITHUB_USER }} GITHUB_PASSWORD: ${{ secrets.TEST_GITHUB_PASSWORD }} GITHUB_TOTP_SECRET: ${{ secrets.TEST_GITHUB_TOTP_SECRET }} + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 + if: always() + with: + name: playwright-artifacts + path: | + test-results/ + retention-days: 10 - run: | set -Eeuo pipefail gh codespace delete --force --codespace "$CODESPACE_NAME" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5272201e..c06cd94b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name: Run Tests run: | set -Eeuo pipefail - docker run --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src="${{ github.workspace }}/.devcontainer/${{ matrix.flavor }}/test",dst=/ws -w /ws ${{ github.repository }}-${{ matrix.flavor }}:test bats --formatter junit testsuite.bats | tee test-report-${{ matrix.flavor }}.xml + docker run --rm --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src="${{ github.workspace }}/test/${{ matrix.flavor }}",dst=/ws -w /ws ${{ github.repository }}-${{ matrix.flavor }}:test bats --formatter junit integration-tests.bats | tee test-report-${{ matrix.flavor }}.xml - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: always() with: diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 955891ec..033caf40 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -2,16 +2,16 @@ "version": "2.0.0", "tasks": [ { - "label": "Run Tests", + "label": "Run Integration Tests", "type": "shell", "group": { "kind": "test", "isDefault": true }, "command": "bats", - "args": ["testsuite.bats"], + "args": ["integration-tests.bats"], "options": { - "cwd": "${workspaceFolder}/.devcontainer/${env:CONTAINER_FLAVOR}/test" + "cwd": "${workspaceFolder}/test/${env:CONTAINER_FLAVOR}" }, "presentation": { "reveal": "always", diff --git a/.devcontainer/cpp/e2e/features/compilation.feature b/test/cpp/features/compilation.feature similarity index 79% rename from .devcontainer/cpp/e2e/features/compilation.feature rename to test/cpp/features/compilation.feature index f06d58b2..b2128ef8 100644 --- a/.devcontainer/cpp/e2e/features/compilation.feature +++ b/test/cpp/features/compilation.feature @@ -1,7 +1,7 @@ Feature: Compile source code into working software As a developer - In order to generate working software + To generate working software Source code needs to be compiled successfully Scenario: Compile valid source code into working software targeting the host architecture @@ -13,6 +13,7 @@ Feature: Compile source code into working software - 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 + Given build configuration "gcc" is selected + And build preset "gcc" is selected + When the selected target is built Then the output should contain "Build finished with exit code 0" diff --git a/.devcontainer/cpp/e2e/features/pages/authentication.pom.ts b/test/cpp/features/pages/authentication.pom.ts similarity index 95% rename from .devcontainer/cpp/e2e/features/pages/authentication.pom.ts rename to test/cpp/features/pages/authentication.pom.ts index 289642a0..8f4512ef 100644 --- a/.devcontainer/cpp/e2e/features/pages/authentication.pom.ts +++ b/test/cpp/features/pages/authentication.pom.ts @@ -1,6 +1,6 @@ import { type Page } from '@playwright/test'; import * as OTPAuth from 'otpauth'; -import { STORAGE_STATE } from '../../playwright.config'; +import { STORAGE_STATE } from '../playwright.config'; export class AuthenticationPage { readonly page: Page; diff --git a/.devcontainer/cpp/e2e/features/pages/codespace.pom.ts b/test/cpp/features/pages/codespace.pom.ts similarity index 80% rename from .devcontainer/cpp/e2e/features/pages/codespace.pom.ts rename to test/cpp/features/pages/codespace.pom.ts index b1061cd3..4bcce96a 100644 --- a/.devcontainer/cpp/e2e/features/pages/codespace.pom.ts +++ b/test/cpp/features/pages/codespace.pom.ts @@ -1,4 +1,5 @@ import { test, expect, type Page, type Locator } from '@playwright/test'; +import path from 'path'; type CommandAndPrompt = { command: string, @@ -97,8 +98,13 @@ export class CodespacePage { } async openFileInEditor(name: string) { - await this.page.getByRole('treeitem', { name: name }).locator('a').click(); - await expect(this.page.locator('[id="workbench.parts.editor"]')).toContainText(name); + await this.page.keyboard.press('Control+P'); + const searchBox = this.page.getByPlaceholder('Search files by name'); + await expect(searchBox).toBeVisible(); + + await searchBox.fill(name); + await this.page.keyboard.press('Enter'); + await expect(this.page.locator('[id="workbench.parts.editor"]')).toContainText(path.basename(name)); } async openCppFileInEditor(name: string) { @@ -106,14 +112,34 @@ export class CodespacePage { await expect(this.page.locator('[id="llvm-vs-code-extensions.vscode-clangd"]')).toContainText('clangd: idle', { timeout: 1 * 60 * 1000 }); } - async formatDocument() { - await this.executeFromCommandPalette({ command: 'Format Document' }); + async openDocument(name: string) { + const fileExtension = path.extname(name).slice(1); + + if (fileExtension === 'cpp') { + await this.openCppFileInEditor(name); + } else { + await this.openFileInEditor(name); + } } async saveDocument() { await this.page.keyboard.press('Control+S'); } + async formatDocument() { + await this.executeFromCommandPalette({ command: 'Format Document' }); + } + + async selectBuildConfiguration(configuration: string) { + await this.executeFromCommandPalette({ command: 'CMake: Select Configure Preset' }); + await this.page.getByRole('option', { name: configuration, exact: true }).locator('a').click(); + } + + async selectBuildPreset(preset: string) { + await this.executeFromCommandPalette({ command: 'CMake: Select Build Preset' }); + await this.page.getByRole('option', { name: preset, exact: true }).locator('a').click(); + } + async buildSelectedTarget() { await this.page.getByRole('button', { name: 'Build the selected target' }).click(); } diff --git a/.devcontainer/cpp/e2e/playwright.config.ts b/test/cpp/features/playwright.config.ts similarity index 91% rename from .devcontainer/cpp/e2e/playwright.config.ts rename to test/cpp/features/playwright.config.ts index a561dfd7..f0a57ca5 100644 --- a/.devcontainer/cpp/e2e/playwright.config.ts +++ b/test/cpp/features/playwright.config.ts @@ -7,8 +7,8 @@ require('dotenv').config({ path: path.join(__dirname, '..', '..', '..', '.env') export const STORAGE_STATE = path.join(__dirname, 'playwright/.auth/user.json'); const testDir = defineBddConfig({ - features: "features/*.feature", - steps: ["features/steps/*.ts"], + features: "*.feature", + steps: ["steps/*.ts"], }); export default defineConfig({ diff --git a/.devcontainer/cpp/e2e/features/static-dynamic-analysis.feature b/test/cpp/features/static-dynamic-analysis.feature similarity index 64% rename from .devcontainer/cpp/e2e/features/static-dynamic-analysis.feature rename to test/cpp/features/static-dynamic-analysis.feature index 9e3de367..313f49c4 100644 --- a/.devcontainer/cpp/e2e/features/static-dynamic-analysis.feature +++ b/test/cpp/features/static-dynamic-analysis.feature @@ -4,9 +4,10 @@ Feature: Analyze source code using static and dynamic analysis To maintain consistent, high-quality and bug-free code Source code needs to be statically and dynamically analyzed + @fixme Scenario: Format source code according to a formatting style - Given the file "unformatted.cpp" is opened in the editor + Given the file "clang-tools/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" + Then the contents of "clang-tools/unformatted.cpp" should match the contents of "clang-tools/formatted.cpp" diff --git a/.devcontainer/cpp/e2e/features/steps/codespace.steps.ts b/test/cpp/features/steps/codespace.steps.ts similarity index 62% rename from .devcontainer/cpp/e2e/features/steps/codespace.steps.ts rename to test/cpp/features/steps/codespace.steps.ts index 110b8f80..52726326 100644 --- a/.devcontainer/cpp/e2e/features/steps/codespace.steps.ts +++ b/test/cpp/features/steps/codespace.steps.ts @@ -1,26 +1,20 @@ 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("build configuration {string} is selected", async ({ codespacePage }, configuration: string) => { + await codespacePage.selectBuildConfiguration(configuration); }); -Given("the file {string} is opened in the editor", async ({ codespacePage }, file: string) => { - const fileExtension = path.extname(file).slice(1); +Given("build preset {string} is selected", async ({ codespacePage }, preset: string) => { + await codespacePage.selectBuildPreset(preset); +}); - switch (fileExtension) { - case 'cpp': - await codespacePage.openCppFileInEditor(file); - break; - default: - await codespacePage.openFileInEditor(file); - } +Given("the file {string} is opened in the editor", async ({ codespacePage }, file: string) => { + await codespacePage.openDocument(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 selected target is built", async ({ codespacePage }) => { + await codespacePage.buildSelectedTarget(); }); When("the active document is formatted", async ({ codespacePage }) => { diff --git a/.devcontainer/cpp/e2e/features/steps/fixtures.ts b/test/cpp/features/steps/fixtures.ts similarity index 100% rename from .devcontainer/cpp/e2e/features/steps/fixtures.ts rename to test/cpp/features/steps/fixtures.ts diff --git a/.devcontainer/cpp/test/testsuite.bats b/test/cpp/integration-tests.bats similarity index 97% rename from .devcontainer/cpp/test/testsuite.bats rename to test/cpp/integration-tests.bats index a6e178f3..ffbaffb8 100644 --- a/.devcontainer/cpp/test/testsuite.bats +++ b/test/cpp/integration-tests.bats @@ -28,10 +28,14 @@ teardown_file() { setup() { load '/usr/local/bats-support/load' load '/usr/local/bats-assert/load' + + pushd workspace } teardown() { rm -rf build crash-* $(conan config home)/p + + popd } @test "valid code input should result in working executable using host compiler" { @@ -220,4 +224,8 @@ function build_and_run_with_sanitizers() { run build/${PRESET}/sanitizers/test-ubsan assert_failure assert_output --partial "runtime error: load of null pointer" + + run build/${PRESET}/sanitizers/test-threadsan + assert_failure + assert_output --partial "ThreadSanitizer: data race" } diff --git a/.devcontainer/cpp/test/CMakeLists.txt b/test/cpp/workspace/CMakeLists.txt similarity index 92% rename from .devcontainer/cpp/test/CMakeLists.txt rename to test/cpp/workspace/CMakeLists.txt index 2c22f7aa..c58475f5 100644 --- a/.devcontainer/cpp/test/CMakeLists.txt +++ b/test/cpp/workspace/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.30) project(devcontainer-test LANGUAGES ASM C CXX) +set(CMAKE_CXX_STANDARD 20) + include(CTest) include(GoogleTest) diff --git a/.devcontainer/cpp/test/CMakePresets.json b/test/cpp/workspace/CMakePresets.json similarity index 100% rename from .devcontainer/cpp/test/CMakePresets.json rename to test/cpp/workspace/CMakePresets.json diff --git a/.devcontainer/cpp/test/clang-cl/CMakeLists.txt b/test/cpp/workspace/clang-cl/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/clang-cl/CMakeLists.txt rename to test/cpp/workspace/clang-cl/CMakeLists.txt diff --git a/.devcontainer/cpp/test/clang-cl/main.cpp b/test/cpp/workspace/clang-cl/main.cpp similarity index 100% rename from .devcontainer/cpp/test/clang-cl/main.cpp rename to test/cpp/workspace/clang-cl/main.cpp diff --git a/.devcontainer/cpp/test/clang-cl/toolchain.cmake b/test/cpp/workspace/clang-cl/toolchain.cmake similarity index 100% rename from .devcontainer/cpp/test/clang-cl/toolchain.cmake rename to test/cpp/workspace/clang-cl/toolchain.cmake diff --git a/.devcontainer/cpp/test/clang-tools/CMakeLists.txt b/test/cpp/workspace/clang-tools/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/clang-tools/CMakeLists.txt rename to test/cpp/workspace/clang-tools/CMakeLists.txt diff --git a/test/cpp/workspace/clang-tools/formatted.cpp b/test/cpp/workspace/clang-tools/formatted.cpp new file mode 100644 index 00000000..237c8ce1 --- /dev/null +++ b/test/cpp/workspace/clang-tools/formatted.cpp @@ -0,0 +1 @@ +int main() {} diff --git a/.devcontainer/cpp/test/clang-tools/main.cpp b/test/cpp/workspace/clang-tools/main.cpp similarity index 100% rename from .devcontainer/cpp/test/clang-tools/main.cpp rename to test/cpp/workspace/clang-tools/main.cpp diff --git a/.devcontainer/cpp/test/clang-tools/unformatted.cpp b/test/cpp/workspace/clang-tools/unformatted.cpp similarity index 100% rename from .devcontainer/cpp/test/clang-tools/unformatted.cpp rename to test/cpp/workspace/clang-tools/unformatted.cpp diff --git a/.devcontainer/cpp/test/fuzzing/CMakeLists.txt b/test/cpp/workspace/fuzzing/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/fuzzing/CMakeLists.txt rename to test/cpp/workspace/fuzzing/CMakeLists.txt diff --git a/.devcontainer/cpp/test/fuzzing/main.cpp b/test/cpp/workspace/fuzzing/main.cpp similarity index 100% rename from .devcontainer/cpp/test/fuzzing/main.cpp rename to test/cpp/workspace/fuzzing/main.cpp diff --git a/.devcontainer/cpp/test/gcc-arm-none-eabi/CMakeLists.txt b/test/cpp/workspace/gcc-arm-none-eabi/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/gcc-arm-none-eabi/CMakeLists.txt rename to test/cpp/workspace/gcc-arm-none-eabi/CMakeLists.txt diff --git a/test/cpp/workspace/gcc-arm-none-eabi/main.cpp b/test/cpp/workspace/gcc-arm-none-eabi/main.cpp new file mode 100644 index 00000000..029d56a5 --- /dev/null +++ b/test/cpp/workspace/gcc-arm-none-eabi/main.cpp @@ -0,0 +1,6 @@ +[[noreturn]] void _exit(int) +{ + while (true); +} + +int main() {} diff --git a/.devcontainer/cpp/test/gcc-arm-none-eabi/toolchain.cmake b/test/cpp/workspace/gcc-arm-none-eabi/toolchain.cmake similarity index 100% rename from .devcontainer/cpp/test/gcc-arm-none-eabi/toolchain.cmake rename to test/cpp/workspace/gcc-arm-none-eabi/toolchain.cmake diff --git a/.devcontainer/cpp/test/gcc/CMakeLists.txt b/test/cpp/workspace/gcc/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/gcc/CMakeLists.txt rename to test/cpp/workspace/gcc/CMakeLists.txt diff --git a/.devcontainer/cpp/test/gcc/main-fail.cpp b/test/cpp/workspace/gcc/main-fail.cpp similarity index 100% rename from .devcontainer/cpp/test/gcc/main-fail.cpp rename to test/cpp/workspace/gcc/main-fail.cpp diff --git a/.devcontainer/cpp/test/gcc/main.cpp b/test/cpp/workspace/gcc/main.cpp similarity index 100% rename from .devcontainer/cpp/test/gcc/main.cpp rename to test/cpp/workspace/gcc/main.cpp diff --git a/.devcontainer/cpp/test/package-managers/CMakeLists.txt b/test/cpp/workspace/package-managers/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/package-managers/CMakeLists.txt rename to test/cpp/workspace/package-managers/CMakeLists.txt diff --git a/.devcontainer/cpp/test/package-managers/conan/CMakeLists.txt b/test/cpp/workspace/package-managers/conan/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/package-managers/conan/CMakeLists.txt rename to test/cpp/workspace/package-managers/conan/CMakeLists.txt diff --git a/.devcontainer/cpp/test/package-managers/conan/conanfile.txt b/test/cpp/workspace/package-managers/conan/conanfile.txt similarity index 100% rename from .devcontainer/cpp/test/package-managers/conan/conanfile.txt rename to test/cpp/workspace/package-managers/conan/conanfile.txt diff --git a/.devcontainer/cpp/test/package-managers/conan/main.cpp b/test/cpp/workspace/package-managers/conan/main.cpp similarity index 100% rename from .devcontainer/cpp/test/package-managers/conan/main.cpp rename to test/cpp/workspace/package-managers/conan/main.cpp diff --git a/.devcontainer/cpp/test/package-managers/cpm/CMakeLists.txt b/test/cpp/workspace/package-managers/cpm/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/package-managers/cpm/CMakeLists.txt rename to test/cpp/workspace/package-managers/cpm/CMakeLists.txt diff --git a/.devcontainer/cpp/test/package-managers/cpm/main.cpp b/test/cpp/workspace/package-managers/cpm/main.cpp similarity index 100% rename from .devcontainer/cpp/test/package-managers/cpm/main.cpp rename to test/cpp/workspace/package-managers/cpm/main.cpp diff --git a/.devcontainer/cpp/test/sanitizers/CMakeLists.txt b/test/cpp/workspace/sanitizers/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/sanitizers/CMakeLists.txt rename to test/cpp/workspace/sanitizers/CMakeLists.txt diff --git a/.devcontainer/cpp/test/sanitizers/asan.cpp b/test/cpp/workspace/sanitizers/asan.cpp similarity index 100% rename from .devcontainer/cpp/test/sanitizers/asan.cpp rename to test/cpp/workspace/sanitizers/asan.cpp diff --git a/.devcontainer/cpp/test/sanitizers/memsan.cpp b/test/cpp/workspace/sanitizers/memsan.cpp similarity index 100% rename from .devcontainer/cpp/test/sanitizers/memsan.cpp rename to test/cpp/workspace/sanitizers/memsan.cpp diff --git a/test/cpp/workspace/sanitizers/threadsan.cpp b/test/cpp/workspace/sanitizers/threadsan.cpp new file mode 100644 index 00000000..823bd8a8 --- /dev/null +++ b/test/cpp/workspace/sanitizers/threadsan.cpp @@ -0,0 +1,17 @@ +#include +#include +#include + +int main() +{ + std::vector threads; + int counter = 0; + + for (auto i : std::ranges::iota_view(0, 10)) + threads.emplace_back(std::jthread([&counter] { + for (auto j : std::ranges::iota_view(0, 1000)) + ++counter; + })); + + return counter; +} diff --git a/.devcontainer/cpp/test/sanitizers/ubsan.cpp b/test/cpp/workspace/sanitizers/ubsan.cpp similarity index 100% rename from .devcontainer/cpp/test/sanitizers/ubsan.cpp rename to test/cpp/workspace/sanitizers/ubsan.cpp diff --git a/.devcontainer/cpp/test/test/CMakeLists.txt b/test/cpp/workspace/test/CMakeLists.txt similarity index 100% rename from .devcontainer/cpp/test/test/CMakeLists.txt rename to test/cpp/workspace/test/CMakeLists.txt diff --git a/.devcontainer/cpp/test/test/test.cpp b/test/cpp/workspace/test/test.cpp similarity index 100% rename from .devcontainer/cpp/test/test/test.cpp rename to test/cpp/workspace/test/test.cpp diff --git a/.devcontainer/rust/test/testsuite.bats b/test/rust/integration-tests.bats similarity index 99% rename from .devcontainer/rust/test/testsuite.bats rename to test/rust/integration-tests.bats index 37c88d2a..8e16f2ea 100644 --- a/.devcontainer/rust/test/testsuite.bats +++ b/test/rust/integration-tests.bats @@ -5,10 +5,14 @@ bats_require_minimum_version 1.5.0 setup() { load '/usr/local/bats-support/load' load '/usr/local/bats-assert/load' + + pushd workspace } teardown() { rm -rf build ./**/target ./**/default*.prof* ./**/mutants.out + + popd } @test "valid code input should result in working executable targeting the host architecture" { diff --git a/.devcontainer/rust/test/cargo/Cargo.lock b/test/rust/workspace/cargo/Cargo.lock similarity index 100% rename from .devcontainer/rust/test/cargo/Cargo.lock rename to test/rust/workspace/cargo/Cargo.lock diff --git a/.devcontainer/rust/test/cargo/Cargo.toml b/test/rust/workspace/cargo/Cargo.toml similarity index 100% rename from .devcontainer/rust/test/cargo/Cargo.toml rename to test/rust/workspace/cargo/Cargo.toml diff --git a/.devcontainer/rust/test/cargo/src/main.rs b/test/rust/workspace/cargo/src/main.rs similarity index 100% rename from .devcontainer/rust/test/cargo/src/main.rs rename to test/rust/workspace/cargo/src/main.rs diff --git a/.devcontainer/rust/test/clippy/Cargo.lock b/test/rust/workspace/clippy/Cargo.lock similarity index 100% rename from .devcontainer/rust/test/clippy/Cargo.lock rename to test/rust/workspace/clippy/Cargo.lock diff --git a/.devcontainer/rust/test/clippy/Cargo.toml b/test/rust/workspace/clippy/Cargo.toml similarity index 100% rename from .devcontainer/rust/test/clippy/Cargo.toml rename to test/rust/workspace/clippy/Cargo.toml diff --git a/.devcontainer/rust/test/clippy/src/main.rs b/test/rust/workspace/clippy/src/main.rs similarity index 100% rename from .devcontainer/rust/test/clippy/src/main.rs rename to test/rust/workspace/clippy/src/main.rs diff --git a/.devcontainer/rust/test/cortex-m/.cargo/config.toml b/test/rust/workspace/cortex-m/.cargo/config.toml similarity index 100% rename from .devcontainer/rust/test/cortex-m/.cargo/config.toml rename to test/rust/workspace/cortex-m/.cargo/config.toml diff --git a/.devcontainer/rust/test/cortex-m/Cargo.lock b/test/rust/workspace/cortex-m/Cargo.lock similarity index 100% rename from .devcontainer/rust/test/cortex-m/Cargo.lock rename to test/rust/workspace/cortex-m/Cargo.lock diff --git a/.devcontainer/rust/test/cortex-m/Cargo.toml b/test/rust/workspace/cortex-m/Cargo.toml similarity index 100% rename from .devcontainer/rust/test/cortex-m/Cargo.toml rename to test/rust/workspace/cortex-m/Cargo.toml diff --git a/.devcontainer/rust/test/cortex-m/src/main.rs b/test/rust/workspace/cortex-m/src/main.rs similarity index 100% rename from .devcontainer/rust/test/cortex-m/src/main.rs rename to test/rust/workspace/cortex-m/src/main.rs diff --git a/.devcontainer/rust/test/cortex-mf/.cargo/config.toml b/test/rust/workspace/cortex-mf/.cargo/config.toml similarity index 100% rename from .devcontainer/rust/test/cortex-mf/.cargo/config.toml rename to test/rust/workspace/cortex-mf/.cargo/config.toml diff --git a/.devcontainer/rust/test/cortex-mf/Cargo.lock b/test/rust/workspace/cortex-mf/Cargo.lock similarity index 100% rename from .devcontainer/rust/test/cortex-mf/Cargo.lock rename to test/rust/workspace/cortex-mf/Cargo.lock diff --git a/.devcontainer/rust/test/cortex-mf/Cargo.toml b/test/rust/workspace/cortex-mf/Cargo.toml similarity index 100% rename from .devcontainer/rust/test/cortex-mf/Cargo.toml rename to test/rust/workspace/cortex-mf/Cargo.toml diff --git a/.devcontainer/rust/test/cortex-mf/src/main.rs b/test/rust/workspace/cortex-mf/src/main.rs similarity index 100% rename from .devcontainer/rust/test/cortex-mf/src/main.rs rename to test/rust/workspace/cortex-mf/src/main.rs diff --git a/.devcontainer/rust/test/rust/fail.rs b/test/rust/workspace/rust/fail.rs similarity index 100% rename from .devcontainer/rust/test/rust/fail.rs rename to test/rust/workspace/rust/fail.rs diff --git a/.devcontainer/rust/test/rust/hello.rs b/test/rust/workspace/rust/hello.rs similarity index 100% rename from .devcontainer/rust/test/rust/hello.rs rename to test/rust/workspace/rust/hello.rs diff --git a/.devcontainer/rust/test/rust/unformatted.rs b/test/rust/workspace/rust/unformatted.rs similarity index 100% rename from .devcontainer/rust/test/rust/unformatted.rs rename to test/rust/workspace/rust/unformatted.rs diff --git a/.devcontainer/rust/test/test/Cargo.lock b/test/rust/workspace/test/Cargo.lock similarity index 100% rename from .devcontainer/rust/test/test/Cargo.lock rename to test/rust/workspace/test/Cargo.lock diff --git a/.devcontainer/rust/test/test/Cargo.toml b/test/rust/workspace/test/Cargo.toml similarity index 100% rename from .devcontainer/rust/test/test/Cargo.toml rename to test/rust/workspace/test/Cargo.toml diff --git a/.devcontainer/rust/test/test/src/main.rs b/test/rust/workspace/test/src/main.rs similarity index 100% rename from .devcontainer/rust/test/test/src/main.rs rename to test/rust/workspace/test/src/main.rs