Build/Tests

New in 4.2 The x3270 suite includes a number of built-in tests to verify the integrity of the code.

Prerequisites
The tools required to run the tests are:
 * python3
 * Needed for everything but the library tests. Modules that may not be part of a typical release include requests and pustil.


 * tightvncserver
 * Needed for x3270 tests on Linux.


 * openssl command-line tools
 * Needed for TLS tests.

Makefile targets
The x3270 top-level Makefile supports running tests on POSIX code. (For cross-compiled Windows code, see below.)

Tests have been run successfully on Linux, macOS, Cygwin and Solaris. Other platforms may or may not work.

Tests targets include:
 * make test
 * Run all tests


 * make smoketest
 * Run smoke tests (rudimentary subset)


 * make unix-lib-test
 * Run library tests.


 * make program-test
 * Run tests for the specified program.

Windows
All Windows tests require a Python 3 installation. The Python requests module is also required.

Visual Studio
There is a PowerShell script in the top-level directory called RunTests.ps1. Unless told otherwise, it rebuilds the code first.

RunTests takes two command-line options:
 * -v
 * Pass the -v flag to unittest to display each test name as it is run.


 * -nobuild
 * Do not rebuild the code. The script assumes the code was built using the Debug/x64 configuration.

Cygwin and Msys2
There is a Python script in the top-level directory called run_windows_tests.py. It takes one command-line option, -v to display each test name as it is run.

On Cygwin, this script must be run using a native Windows installation of Python 3 -- not the one included with Cygwin.