Skip to content

Commit 582fc24

Browse files
authored
Tests debug builds in CI (WebAssembly#679)
Add tests for `DEBUG=true` builds of wasi-libc to ensure that builds-with-asserts pass all tests (and build) as well.
1 parent 7e923e7 commit 582fc24

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,30 @@ jobs:
118118
MAKE_TARGETS: "no-check-symbols"
119119
EXTRA_CFLAGS: "-O2 -DNDEBUG -msimd128 -mrelaxed-simd -mbulk-memory -D__wasilibc_simd_string"
120120

121+
- name: Test wasm32-wasip1 (debug)
122+
os: ubuntu-24.04
123+
clang_version: 19
124+
test: true
125+
env:
126+
TARGET_TRIPLE: wasm32-wasip1
127+
DEBUG: true
128+
- name: Test wasm32-wasip2 (debug)
129+
os: ubuntu-24.04
130+
clang_version: 19
131+
test: true
132+
env:
133+
TARGET_TRIPLE: wasm32-wasip2
134+
WASI_SNAPSHOT: p2
135+
DEBUG: true
136+
- name: Test wasm32-wasip1-threads (debug)
137+
os: ubuntu-24.04
138+
clang_version: 19
139+
test: true
140+
env:
141+
TARGET_TRIPLE: wasm32-wasip1-threads
142+
THREAD_MODEL: posix
143+
DEBUG: true
144+
121145
steps:
122146
- uses: actions/[email protected]
123147
with:

libc-bottom-half/sources/preopens.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ static void assert_invariants(void) {
6565
const preopen *pre = &preopens[i];
6666
assert(pre->prefix != NULL);
6767
#ifdef __wasilibc_use_wasip2
68-
assert(pre->wasi_handle.__handle != 0);
69-
assert(pre->wasi_handle.libc_fd != -1);
68+
assert(pre->libc_fd != -1);
7069
#else
7170
assert(pre->wasi_handle != -1);
7271
#endif

test/src/sockets-client-udp-blocking.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void test_udp_client() {
6666
TEST(bytes_received == len);
6767

6868
// Message received should be the same as message sent
69-
TEST(strcmp(message, client_buffer) == 0);
69+
TEST(strncmp(message, client_buffer, len) == 0);
7070

7171
// Shut down client
7272
close(socket_fd);

0 commit comments

Comments
 (0)