Skip to content
Open
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
5 changes: 2 additions & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"sonarsource.sonarlint-vscode",
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"orta.vscode-jest",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"redhat.java",
"vitest.explorer",
"vscjava.vscode-gradle",
"vscjava.vscode-java-debug"
]
Expand Down
4 changes: 0 additions & 4 deletions Clava-JS/CxxTestSources/test1/lib.cpp

This file was deleted.

6 changes: 0 additions & 6 deletions Clava-JS/CxxTestSources/test1/lib.h

This file was deleted.

7 changes: 0 additions & 7 deletions Clava-JS/CxxTestSources/test1/main.cpp

This file was deleted.

12 changes: 2 additions & 10 deletions Clava-JS/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,12 @@ Starting from the `workspace` directory, execute the following commands to build

```bash
npm install
gradle -p clava/ClavaWeaver installDist
npm run build -w lara-framework/Lara-JS
npm run build -w clava/Clava-JS
npm install
cd clava/ClavaWeaver
gradle installDist
cd ../..
```

Finally, copy the JARs in the folder `./clava/ClavaWeaver/build/install/ClavaWeaver/lib` into a new folder called java-binaries in `./clava/Clava-JS`:

```bash
mkdir clava/Clava-JS/java-binaries
cp -r ./clava/ClavaWeaver/build/install/ClavaWeaver/lib ./clava/Clava-JS/java-binaries
```
The `installDist` task synchronizes the complete ClavaWeaver distribution into `./clava/Clava-JS/java-binaries`. The generated directory is refreshed automatically, including when `installDist` is invoked directly, so do not copy or edit its contents manually. Local `npm pack` and `npm publish` also validate that `java-binaries` is a real, populated directory before creating a package.

Install the package globally:

Expand Down
2 changes: 1 addition & 1 deletion Clava-JS/api/Issues.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
registerSourceCode,
registerSourceCodes,
} from "@specs-feup/lara/jest/jestHelpers.ts";
} from "@specs-feup/lara/vitest/weaverTestHelpers.ts";
import Query from "@specs-feup/lara/api/weaver/Query.ts";
import { FunctionJp } from "./Joinpoints.ts";
import ClavaJoinPoints from "./clava/ClavaJoinPoints.ts";
Expand Down
17 changes: 12 additions & 5 deletions Clava-JS/api/LegacyIntegrationTests - C.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { ClavaLegacyTester } from "../jest/ClavaLegacyTester.ts";
import IdGenerator from "@specs-feup/lara/api/lara/util/IdGenerator.js";
import JavaTypes from "@specs-feup/lara/api/lara/util/JavaTypes.ts";
import ClavaJavaTypes from "./clava/ClavaJavaTypes.ts";
import PrintOnce from "@specs-feup/lara/api/lara/util/PrintOnce.js";
import path from "path";
import { ClavaLegacyTester } from "../vitest/ClavaLegacyTester.ts";
import ClavaJavaTypes from "./clava/ClavaJavaTypes.ts";

const isWindows = process.platform === "win32";
const isMacOS = process.platform === "darwin";

/* eslint-disable jest/expect-expect */
/* oxlint-disable vitest/expect-expect */
describe("CTest", () => {
function newTester() {
return new ClavaLegacyTester(
Expand All @@ -17,6 +19,11 @@ describe("CTest", () => {
.setSrcPackage("c/src");
}

afterEach(() => {
PrintOnce.messagesSet.clear();
IdGenerator.idCounter.clear();
});

// TODO: Temporarily disabled, Jenkins fails with "Cannot inherit from final class"
it("Loop", async () => {
await newTester().test("Loop.js", "loop.c");
Expand Down Expand Up @@ -101,7 +108,7 @@ describe("CTest", () => {
await newTester()
.checkExpectedOutput(false)
.test("InlineNasLu.js", "inline_nas_lu.c");
});
}, 10_000);

it("InlineNasFt", async () => {
await newTester()
Expand Down Expand Up @@ -340,7 +347,7 @@ describe("CApiTest", () => {
}

await tester.test("InlinerTest.js", "inliner.c");
});
}, 15_000);

it("StatementDecomposer", async () => {
await newTester().test(
Expand Down
13 changes: 10 additions & 3 deletions Clava-JS/api/LegacyIntegrationTests - CXX.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { ClavaLegacyTester } from "../jest/ClavaLegacyTester.ts";
import ClavaJavaTypes from "./clava/ClavaJavaTypes.ts";
import JavaInterop from "@specs-feup/lara/api/lara/JavaInterop.ts";
import IdGenerator from "@specs-feup/lara/api/lara/util/IdGenerator.js";
import PrintOnce from "@specs-feup/lara/api/lara/util/PrintOnce.js";
import path from "path";
import { ClavaLegacyTester } from "../vitest/ClavaLegacyTester.ts";
import ClavaJavaTypes from "./clava/ClavaJavaTypes.ts";

const isWindows = process.platform === "win32";
const isMacOS = process.platform === "darwin";

/* eslint-disable jest/expect-expect */
/* oxlint-disable vitest/expect-expect */
describe("CxxTest", () => {
function newTester() {
return new ClavaLegacyTester(
Expand All @@ -17,6 +19,11 @@ describe("CxxTest", () => {
.setSrcPackage("cpp/src");
}

afterEach(() => {
PrintOnce.messagesSet.clear();
IdGenerator.idCounter.clear();
});

it("Statement", async () => {
await newTester().test("Statement.js", "statement.cpp");
});
Expand Down
4 changes: 2 additions & 2 deletions Clava-JS/api/LegacyIntegrationTests - Issues.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ClavaLegacyTester } from "../jest/ClavaLegacyTester.ts";
import { ClavaLegacyTester } from "../vitest/ClavaLegacyTester.ts";
import ClavaJavaTypes from "./clava/ClavaJavaTypes.ts";
import path from "path";

/* eslint-disable jest/expect-expect */
/* oxlint-disable vitest/expect-expect */
describe("IssuesTest", () => {
function newTester() {
return new ClavaLegacyTester(
Expand Down
2 changes: 1 addition & 1 deletion Clava-JS/api/Query.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerSourceCode } from "@specs-feup/lara/jest/jestHelpers.ts";
import { registerSourceCode } from "@specs-feup/lara/vitest/weaverTestHelpers.ts";
import Query from "@specs-feup/lara/api/weaver/Query.ts";
import { FunctionJp, Loop } from "./Joinpoints.ts";

Expand Down
6 changes: 3 additions & 3 deletions Clava-JS/api/clava/ClavaJavaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import JavaTypes, {
type JavaClasses,
} from "@specs-feup/lara/api/lara/util/JavaTypes.ts";

// eslint-disable-next-line @typescript-eslint/no-namespace
// oxlint-disable-next-line typescript/no-namespace
export namespace ClavaJavaClasses {
/* eslint-disable @typescript-eslint/no-empty-object-type */
/* oxlint-disable typescript/no-empty-object-type */
export interface ClavaNodes extends JavaClasses.JavaClass {}
export interface ClavaNode extends JavaClasses.JavaClass {}
export interface CxxJoinpoints extends JavaClasses.JavaClass {}
Expand All @@ -19,7 +19,7 @@ export namespace ClavaJavaClasses {
export interface CxxWeaverOption extends JavaClasses.JavaClass {}
export interface ClavaOptions extends JavaClasses.JavaClass {}
export interface CodeParser extends JavaClasses.JavaClass {}
/* eslint-enable @typescript-eslint/no-empty-object-type */
/* oxlint-enable typescript/no-empty-object-type */
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Clava-JS/api/clava/ClavaJoinPoints.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerSourceCode } from "@specs-feup/lara/jest/jestHelpers.ts";
import { registerSourceCode } from "@specs-feup/lara/vitest/weaverTestHelpers.ts";
import Query from "@specs-feup/lara/api/weaver/Query.ts";
import { ExprStmt } from "../Joinpoints.ts";
import ClavaJoinPoints from "./ClavaJoinPoints.ts";
Expand Down
17 changes: 0 additions & 17 deletions Clava-JS/api/jest.config.ts

This file was deleted.

Binary file not shown.
Binary file removed Clava-JS/clang-plugin-binaries/plugin-14.so
Binary file not shown.
Binary file removed Clava-JS/clang-plugin-binaries/plugin-15.so
Binary file not shown.
Binary file removed Clava-JS/clang-plugin-binaries/plugin-16.so
Binary file not shown.
1 change: 0 additions & 1 deletion Clava-JS/clava.json

This file was deleted.

8 changes: 4 additions & 4 deletions Clava-JS/code/ClangPlugin/ClangPlugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { jest } from "@jest/globals";
import { vi } from "vitest";
import fs from "fs";
import path from "path";

Expand Down Expand Up @@ -76,17 +76,17 @@ describe("ClangPlugin", () => {
const actualMap = await ClangPlugin.getAvailablePlugins();

expect(actualMap).toEqual(expectedMap);
jest.restoreAllMocks();
vi.restoreAllMocks();
});

it("should throw an error when the clang-plugin-binaries directory does not exist", async () => {
jest.spyOn(fs, "existsSync").mockClear().mockReturnValue(false);
vi.spyOn(fs, "existsSync").mockClear().mockReturnValue(false);

await expect(ClangPlugin.getAvailablePlugins()).rejects.toThrow(
"Could not find 'clang-plugin-binaries' directory"
);

jest.restoreAllMocks();
vi.restoreAllMocks();
});
});
*/
Expand Down
9 changes: 0 additions & 9 deletions Clava-JS/code/jest.config.ts

This file was deleted.

52 changes: 0 additions & 52 deletions Clava-JS/eslint.config.ts

This file was deleted.

18 changes: 0 additions & 18 deletions Clava-JS/jest.config.ts

This file was deleted.

44 changes: 0 additions & 44 deletions Clava-JS/jest/ClavaLegacyTester.ts

This file was deleted.

6 changes: 6 additions & 0 deletions Clava-JS/oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import config from "@specs-feup/lara/oxlint.config.ts";
import { defineConfig } from "oxlint";

export default defineConfig({
extends: [config],
});
Loading
Loading