Skip to content

Commit 5524077

Browse files
committed
fix: add cmath to the gcc and llvm tests
1 parent ade2538 commit 5524077

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ temp-*
1515
!./dist/setup_cpp.js
1616
!./dist/setup_cpp.js.map
1717
.parcel-cache
18-
exe
18+
*.log
19+
*.exe

src/gcc/__tests__/gcc.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jest.setTimeout(3000000)
1010
describe("setup-gcc", () => {
1111
let directory: string
1212
beforeAll(async () => {
13-
directory = await setupTmpDir("doxygen")
13+
directory = await setupTmpDir("gcc")
1414
})
1515

1616
it("should setup gcc", async () => {
@@ -37,6 +37,6 @@ describe("setup-gcc", () => {
3737
})
3838

3939
afterAll(async () => {
40-
await cleanupTmpDir("doxygen")
40+
await cleanupTmpDir("gcc")
4141
}, 100000)
4242
})

src/gcc/__tests__/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
#include <cstddef>
99
#include <cstdint>
1010
#include <cstring>
11+
#include <cmath>
1112

1213
int main() {
13-
const auto x = 10.0;
14-
std::cout << "Testing " << x << '\n';
14+
const auto val1 = 10.0;
15+
std::cout << "Testing " << val1 << '\n';
1516

16-
const auto y = std::to_string(x);
17-
std::cout << "Testing " << y << '\n';
17+
const auto val2 = std::to_string(val1);
18+
std::cout << "Testing " << val2 << '\n';
19+
20+
return static_cast<int>(std::sin(val1) + std::log(static_cast<double>(val2.size())) - 1);
1821
}

src/gcc/__tests__/main.exe

-111 KB
Binary file not shown.

src/llvm/__tests__/main.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@
88
#include <cstddef>
99
#include <cstdint>
1010
#include <cstring>
11+
#include <cmath>
1112

1213
int main() {
13-
const auto x = 10.0;
14-
std::cout << "Testing " << x << '\n';
14+
const auto val1 = 10.0;
15+
std::cout << "Testing " << val1 << '\n';
1516

16-
const auto y = std::to_string(x);
17-
std::cout << "Testing " << y << '\n';
17+
const auto val2 = std::to_string(val1);
18+
std::cout << "Testing " << val2 << '\n';
19+
20+
return static_cast<int>(std::sin(val1) + std::log(static_cast<double>(val2.size())) - 1);
1821
}

0 commit comments

Comments
 (0)