Skip to content

Commit a907474

Browse files
committed
build: add tests
1 parent eba4fc6 commit a907474

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.12.1)
22

33
project(wasi-libc
44
LANGUAGES C)
5+
enable_testing()
56

67
set(CMAKE_C_COMPILE_OPTIONS_TARGET "-target ")
78
set(CMAKE_C_COMPILER_TARGET wasm32-unknown-wasi CACHE STRING
@@ -1170,3 +1171,8 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/sysroot/lib/libc.imports
11701171
add_custom_target(libc.imports ALL
11711172
DEPENDS ${CMAKE_BINARY_DIR}/sysroot/lib/libc.imports)
11721173
add_dependencies(libc.imports c crt1.o)
1174+
1175+
add_test(NAME check-metadata
1176+
COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${PROJECT_SOURCE_DIR}/expected/wasm32-wasi/predefined-macros.txt ${CMAKE_BINARY_DIR}/sysroot/share/predefined-macros.txt)
1177+
add_test(NAME check-headers
1178+
COMMAND ${CMAKE_C_COMPILER} -target ${CMAKE_C_COMPILER_TARGET} --sysroot=${CMAKE_BINARY_DIR}/sysroot -fsyntax-only "-Wno#warnings" ${CMAKE_BINARY_DIR}/sysroot/share/include-all.c)

0 commit comments

Comments
 (0)