Add some compile tests.

These are to check there are no syntax errors in the headers and that
all the CHECK_OFFSET and CHECK_SIZE macros are valid.
This commit is contained in:
James Benton 2018-06-18 10:26:37 +01:00
parent e65cb2304b
commit 0750d60693
5 changed files with 212 additions and 0 deletions

7
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.2)
set(CMAKE_TOOLCHAIN_FILE $ENV{WUT_ROOT}/share/wut.toolchain.cmake)
project(tests)
include("${WUT_ROOT}/share/wut.cmake" REQUIRED)
add_subdirectory(test_compile_headers_as_c)
add_subdirectory(test_compile_headers_as_cpp)

View File

@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.2)
project(test_compile_headers_as_c C)
include("${WUT_ROOT}/share/wut.cmake" REQUIRED)
add_executable(test_compile_headers_as_c
main.c)
wut_create_rpx(test_compile_headers_as_c.rpx test_compile_headers_as_c)

View File

@ -0,0 +1,94 @@
#include <coreinit/alarm.h>
#include <coreinit/atomic.h>
#include <coreinit/atomic64.h>
#include <coreinit/cache.h>
#include <coreinit/condition.h>
#include <coreinit/context.h>
#include <coreinit/core.h>
#include <coreinit/coroutine.h>
#include <coreinit/debug.h>
#include <coreinit/dynload.h>
#include <coreinit/energysaver.h>
#include <coreinit/event.h>
#include <coreinit/exception.h>
#include <coreinit/exit.h>
#include <coreinit/fastcondition.h>
#include <coreinit/fastmutex.h>
#include <coreinit/filesystem.h>
#include <coreinit/foreground.h>
#include <coreinit/internal.h>
#include <coreinit/ios.h>
#include <coreinit/mcp.h>
#include <coreinit/memblockheap.h>
#include <coreinit/memdefaultheap.h>
#include <coreinit/memexpheap.h>
#include <coreinit/memfrmheap.h>
#include <coreinit/memheap.h>
#include <coreinit/memlist.h>
#include <coreinit/memory.h>
#include <coreinit/memorymap.h>
#include <coreinit/memunitheap.h>
#include <coreinit/messagequeue.h>
#include <coreinit/mutex.h>
#include <coreinit/rendezvous.h>
#include <coreinit/screen.h>
#include <coreinit/semaphore.h>
#include <coreinit/spinlock.h>
#include <coreinit/systeminfo.h>
#include <coreinit/taskqueue.h>
#include <coreinit/thread.h>
#include <coreinit/threadqueue.h>
#include <coreinit/time.h>
#include <coreinit/title.h>
#include <gx2/clear.h>
#include <gx2/context.h>
#include <gx2/display.h>
#include <gx2/displaylist.h>
#include <gx2/draw.h>
#include <gx2/enum.h>
#include <gx2/event.h>
#include <gx2/mem.h>
#include <gx2/registers.h>
#include <gx2/sampler.h>
#include <gx2/shaders.h>
#include <gx2/state.h>
#include <gx2/surface.h>
#include <gx2/swap.h>
#include <gx2/temp.h>
#include <gx2/tessellation.h>
#include <gx2/texture.h>
#include <gx2/utils.h>
#include <gx2r/buffer.h>
#include <gx2r/displaylist.h>
#include <gx2r/draw.h>
#include <gx2r/mem.h>
#include <gx2r/resource.h>
#include <gx2r/surface.h>
#include <nn/ac/ac_c.h>
#include <nn/ac/ac_cpp.h>
#include <nn/ac.h>
#include <nn/result.h>
#include <nn/swkbd/swkbd_cpp.h>
#include <nn/swkbd.h>
#include <nsyshid/hid.h>
#include <nsysnet/socket.h>
#include <padscore/kpad.h>
#include <padscore/wpad.h>
#include <proc_ui/procui.h>
#include <sndcore2/core.h>
#include <sndcore2/device.h>
#include <sndcore2/drcvs.h>
#include <sndcore2/result.h>
#include <sndcore2/voice.h>
#include <swkbd/rpl_interface.h>
#include <sysapp/launch.h>
#include <sysapp/switch.h>
#include <vpad/input.h>
#include <wut.h>
#include <wut_structsize.h>
#include <wut_types.h>
int main(int argc, char **argv)
{
return 0;
}

View File

@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.2)
project(test_compile_headers_as_cpp CXX)
include("${WUT_ROOT}/share/wut.cmake" REQUIRED)
add_executable(test_compile_headers_as_cpp
main.cpp)
wut_enable_stdcpp(test_compile_headers_as_cpp)
wut_create_rpx(test_compile_headers_as_cpp.rpx test_compile_headers_as_cpp)

View File

@ -0,0 +1,94 @@
#include <coreinit/alarm.h>
#include <coreinit/atomic.h>
#include <coreinit/atomic64.h>
#include <coreinit/cache.h>
#include <coreinit/condition.h>
#include <coreinit/context.h>
#include <coreinit/core.h>
#include <coreinit/coroutine.h>
#include <coreinit/debug.h>
#include <coreinit/dynload.h>
#include <coreinit/energysaver.h>
#include <coreinit/event.h>
#include <coreinit/exception.h>
#include <coreinit/exit.h>
#include <coreinit/fastcondition.h>
#include <coreinit/fastmutex.h>
#include <coreinit/filesystem.h>
#include <coreinit/foreground.h>
#include <coreinit/internal.h>
#include <coreinit/ios.h>
#include <coreinit/mcp.h>
#include <coreinit/memblockheap.h>
#include <coreinit/memdefaultheap.h>
#include <coreinit/memexpheap.h>
#include <coreinit/memfrmheap.h>
#include <coreinit/memheap.h>
#include <coreinit/memlist.h>
#include <coreinit/memory.h>
#include <coreinit/memorymap.h>
#include <coreinit/memunitheap.h>
#include <coreinit/messagequeue.h>
#include <coreinit/mutex.h>
#include <coreinit/rendezvous.h>
#include <coreinit/screen.h>
#include <coreinit/semaphore.h>
#include <coreinit/spinlock.h>
#include <coreinit/systeminfo.h>
#include <coreinit/taskqueue.h>
#include <coreinit/thread.h>
#include <coreinit/threadqueue.h>
#include <coreinit/time.h>
#include <coreinit/title.h>
#include <gx2/clear.h>
#include <gx2/context.h>
#include <gx2/display.h>
#include <gx2/displaylist.h>
#include <gx2/draw.h>
#include <gx2/enum.h>
#include <gx2/event.h>
#include <gx2/mem.h>
#include <gx2/registers.h>
#include <gx2/sampler.h>
#include <gx2/shaders.h>
#include <gx2/state.h>
#include <gx2/surface.h>
#include <gx2/swap.h>
#include <gx2/temp.h>
#include <gx2/tessellation.h>
#include <gx2/texture.h>
#include <gx2/utils.h>
#include <gx2r/buffer.h>
#include <gx2r/displaylist.h>
#include <gx2r/draw.h>
#include <gx2r/mem.h>
#include <gx2r/resource.h>
#include <gx2r/surface.h>
#include <nn/ac/ac_c.h>
#include <nn/ac/ac_cpp.h>
#include <nn/ac.h>
#include <nn/result.h>
#include <nn/swkbd/swkbd_cpp.h>
#include <nn/swkbd.h>
#include <nsyshid/hid.h>
#include <nsysnet/socket.h>
#include <padscore/kpad.h>
#include <padscore/wpad.h>
#include <proc_ui/procui.h>
#include <sndcore2/core.h>
#include <sndcore2/device.h>
#include <sndcore2/drcvs.h>
#include <sndcore2/result.h>
#include <sndcore2/voice.h>
#include <swkbd/rpl_interface.h>
#include <sysapp/launch.h>
#include <sysapp/switch.h>
#include <vpad/input.h>
#include <wut.h>
#include <wut_structsize.h>
#include <wut_types.h>
int main(int argc, char **argv)
{
return 0;
}