Skip to content

Tests and CI

The tests run in Wine (with 16-bit support, as in the 32-bit or WoW64 builds):

BIN=~/llvm-build/bin SYSROOT=$PWD/sysroot LD=/path/to/jwlink \
DOS_SDK=~/dos-sdk sh tests/run-tests.sh

They build each test for the small, medium, compact and large models at -O0, -Os and -O2 (MODELS= and OPTS= pick others):

  • tests/win16/hello.c: main, arguments, the heap, files and the clock.
  • tests/win16/api.c: WinMain and KERNEL and USER calls through <windows.h>.
  • tests/win16/sizes.c: the size of each structure in the headers.
  • tests/win16/windowsx.c: every message cracker splits a message and its forwarder packs it back the same way, with and without STRICT, and the control macros compile.
  • tests/win16/testdll.c with tests/win16/dllapp.c: a DLL with LibMain, exports and static data, called from a program, and its use of locals on the caller's stack, through far pointers and near ones (handed to the C library too).
  • tests/win16/cxxdll.cpp with tests/win16/cxxdllapp.c: a C++ DLL with objects, strings and vectors on its stack.
  • tests/win16/res.rc with tests/win16/res.c: resources compiled by llvm-rc -win16: strings, a menu, accelerators, a dialog, an icon, raw data and version information.
  • dos-sdk's tests/libc/nearfar.c, tests/libc/random.c and tests/cxx/except.cpp, built for Windows.
  • tests/win16/gui.c: a window, its message loop, painting and a timer. It needs a display: DISPLAY, or xvfb-run on PATH. NO_GUI=1 skips it.

CI

dos-sdk's toolchain workflow (.github/workflows/toolchain.yml) checks out this repository at main, or at the win16_sdk_ref it is given, and builds the toolchain package with every sysroot. Its smoke test builds a program for each Windows version, checks it with ne-check.py and runs it in Wine.