Skip to content

Testing

tests/ boots OS/2 Warp 3 from its two boot diskettes in QEMU and runs programs from a diskette in drive B: (see tests/README.md). The 16-bit examples pass in all four memory models, and the 32-bit ones pass too. tests/dosapi.c exercises the 32-bit Dos calls (exception handlers, semaphores, queues, named pipes, timers, NLS, file systems, messages and extended attributes), tests/restest.c reads back the resources os2rc.py bound into it with DosGetResource (16 and 32-bit), tests/posix.c tries the directory calls of the C library, tests/spawn.c starts itself with spawn, exec, system and popen and tries pipe (16 and 32-bit), tests/threads.c the C11 threads, locks and per-thread errno, tests/cxx.cpp C++ exceptions (in four threads at once too), RTTI, iostreams and std::thread, and tests/vio.c the Vio, Kbd and Mou calls from 32-bit code. tests/testdll.c is a 16-bit DLL that uses the C library and tests/dllapp.c a program that calls it, and starts itself again to check that the DLL's data is per process. All pass on Warp 3, the DLL in all four memory models. Warp 3's boot diskettes have no Presentation Manager, so PM programs are only built.

Testing on OS/2 Warp 3 in QEMU

No install is needed. Warp 3's two boot diskettes boot to a CMD.EXE prompt once diskette 1's CONFIG.SYS starts cmd.exe /k b:\run.cmd instead of the installer. The programs under test go on a diskette in drive B:, each one's output goes to B:\NAME.out, and mtools reads it back afterwards.

./mkwarp3.sh Disk00.img Disk01.img work   # Blue Spine floppy set
./runtests.sh work 60 hello.exe sysinfo.exe

Files given that are not programs are copied to B: too; dosapi.exe reads XDF.MSG, which is on diskette 0:

mcopy -i Disk00.img ::/XDF.MSG .
./runtests.sh work 60 dosapi.exe XDF.MSG

The programs run with B:\ as the current directory, where OS/2 finds DLLs (LIBPATH starts with .). The 16-bit DLL test, in each memory model:

clang --target=i8086-pc-os2 -mcmodel=small -shared testdll.c -o TESTDLL.DLL
python3 ../tools/os2-imports.py TESTDLL.DLL > testdll.lnk
clang --target=i8086-pc-os2 -mcmodel=small dllapp.c -Wl,@testdll.lnk -o DLLAPP.EXE
./runtests.sh work 60 DLLAPP.EXE TESTDLL.DLL

Needs qemu-system-i386, mtools and python3. The last screen is saved as work/screen.ppm.

OS/2 2.11 SMP hangs at "Loading, please wait..." in QEMU and OS/2 1.0 loops through CPU resets. Warp 3 runs both 16-bit (NE) and 32-bit (LX) programs.