Skip to content

Commit 7af3c47

Browse files
committed
[Wrap] Adds macOS-specific test files and updates test logic for platform compatibility
1 parent a17a039 commit 7af3c47

3 files changed

Lines changed: 707 additions & 6 deletions

File tree

Clava-JS/src-api/LegacyIntegrationTests - C.test.ts

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,14 @@ describe("CTest", () => {
6464
*/
6565

6666
it("Wrap", async () => {
67-
await newTester()
68-
.set(ClavaJavaTypes.CxxWeaverOption.PARSE_INCLUDES)
69-
.test("Wrap.js", "wrap.c", "wrap.h");
67+
const tester = newTester()
68+
.set(ClavaJavaTypes.CxxWeaverOption.PARSE_INCLUDES);
69+
70+
if (JavaTypes.SpecsPlatforms.isMac()) {
71+
tester.setResultsFile("Wrap.js.macos.txt");
72+
}
73+
74+
await tester.test("Wrap.js", "wrap.c", "wrap.h")
7075
});
7176

7277
it("VarrefInWhile", async () => {
@@ -246,7 +251,16 @@ describe("CApiTest", () => {
246251
tester.setResultsFile("TimerTest.js.unix.txt");
247252
}
248253

249-
await tester.test("TimerTest.js", "timer_test.c");
254+
const t = async () => tester.test("TimerTest.js", "timer_test.c");
255+
256+
if( JavaTypes.SpecsPlatforms.isMac()) {
257+
expect(t()).rejects.toThrow(
258+
"Timer Exception: Platform not supported (Windows and Linux only)"
259+
);
260+
}
261+
else {
262+
await t();
263+
}
250264
});
251265

252266
// Compiles C code, but with C++ flag.
@@ -258,12 +272,21 @@ describe("CApiTest", () => {
258272
if (JavaTypes.SpecsPlatforms.isUnix()) {
259273
tester.setResultsFile("TimerTestWithCxxFlag.js.unix.txt");
260274
}
261-
await tester
275+
276+
const t = async () => tester
262277
.set(
263278
ClavaJavaTypes.ClavaOptions.STANDARD,
264279
ClavaJavaTypes.Standard.CXX11
265280
)
266281
.test("TimerTestWithCxxFlag.js", "timer_test.c");
282+
283+
if (JavaTypes.SpecsPlatforms.isMac()) {
284+
expect(t()).rejects.toThrow(
285+
"Timer Exception: Platform not supported (Windows and Linux only)"
286+
);
287+
} else {
288+
await t();
289+
}
267290
});
268291

269292
it("Energy", async () => {
@@ -302,7 +325,13 @@ describe("CApiTest", () => {
302325
});
303326

304327
it("Inliner", async () => {
305-
await newTester().test("InlinerTest.js", "inliner.c");
328+
const tester = newTester();
329+
330+
if (JavaTypes.SpecsPlatforms.isMac()) {
331+
tester.setResultsFile("Inliner.js.macos.txt");
332+
}
333+
334+
await tester.test("InlinerTest.js", "inliner.c");
306335
});
307336

308337
it("StatementDecomposer", async () => {

0 commit comments

Comments
 (0)