updated TESTING.md

This commit is contained in:
Joseph Henry
2017-06-05 17:46:49 -07:00
parent 4a14442d08
commit f578a901eb

View File

@@ -4,7 +4,9 @@ After building the static library, you can run:
- `make tests` - `make tests`
This will output `selftest` to `build/tests/`. Using this, you can run the tests below. Note, the following examples assume your testing environment is `linux`, you'll see this in the build output path. If this is not true, change it to `darwin`, or `win` depending on what you're running. This will output `selftest` to `build/$PLATFORM/`. Using this, you can run the tests below. Note, the following examples assume your testing environment is `linux`, you'll see this in the build output path. If this is not true, change it to `darwin`, or `win` depending on what you're running.
It is probably easiet to add out your `host-1` and `host-2` address, port, and network information to `test/alice.conf` and `test/bob.conf`, this way you can use the selftest shorthand shown below.
Build outputs are as follows: Build outputs are as follows:
@@ -24,47 +26,58 @@ build
### Simple Tests ### Simple Tests
Simple tests merely test one aspect of the library. For instance, it's role as an IPv4 server, or IPv6 client. Simple tests merely test one aspect of the library. For instance, its role as an IPv4 server, or IPv6 client.
To run a single-test IPv4 client/server test. Where `$PLATFORM` is `linux`, `darwin` or `win`: To run a single-test IPv4 client/server test:
- Host 1: `./build/linux/selftest zt1 c7cd7c9e1b0f52a2 simple 4 server 10.9.9.40 8787` - host-1: `./build/linux/selftest zt1 c7cd7c9e1b0f52a2 simple 4 server 10.9.9.40 8787`
- Host 2: `./build/linux/selftest zt2 c7cd7c9e1b0f52a2 simple 4 client 10.9.9.40 8787` - host-2: `./build/linux/selftest zt2 c7cd7c9e1b0f52a2 simple 4 client 10.9.9.40 8787`
To run a multi-message IPv4 client/server test: To run a multi-message IPv4 client/server test:
- Host 1: `./build/linux/selftest zt2 c7cd7c9e1b0f52a2 simple 4 server 10.9.9.40 8787 n_bytes 100 50`
- Host 2: `./build/linux/selftest zt2 c7cd7c9e1b0f52a2 simple 4 client 10.9.9.40 8787 n_bytes 100 50` - host-1: `./build/linux/selftest zt1 c7cd7c9e1b0f52a2 simple 4 server 10.9.9.40 8787 n_bytes 100 50`
- host-2: `./build/linux/selftest zt2 c7cd7c9e1b0f52a2 simple 4 client 10.9.9.40 8787 n_bytes 100 50`
### Sustained Tests ### Sustained Tests
Sustained tests will test the library's ability to support long-duration connections and data transfers. Sustained tests will test the library's ability to support long-duration connections and data transfers.
- host-1: `./build/linux/selftest sustained test/bob.conf`
- host-2: `./build/linux/selftest sustained test/alice.conf`
### Slam Tests ### Slam Tests
Slam tests will test the library's ability to handle many repeated API calls or repeated common sequences of API calls that a typical application may make. Slam tests will test the library's ability to handle many repeated API calls or repeated common sequences of API calls that a typical application may make. For instance, it will try to create as many sockets as possible, or try to create a socket, bind to an address, listen, and accept over and over. This is useful for detecting memory leaks and architectural limitations in the stack drivers.
- host-1: `./build/linux/selftest slam test/bob.conf`
- host-2: `./build/linux/selftest slam test/alice.conf`
### Comprehensive Tests ### Comprehensive Tests
A comprehensive test will test each aspect of the library one time. A comprehensive test will test each aspect of the library one time.
On `host-1`, run: - host-1: `./build/linux/selftest comprehensive test/bob.conf`
- `./build/linux/selftest test/bob.conf` - host-2: `./build/linux/selftest comprehensive test/alice.conf`
On `host-2`, run:
- `./build/linux/selftest test/alice.conf`
### Random Tests ### Random Tests
Makes random API calls with random (or plausible arguments/data) to test for proper error handling Makes random API calls with random (or plausible arguments/data) to test for proper error handling
- host-1: `./build/linux/selftest random test/bob.conf`
### Performance Tests ### Performance Tests
Test's the library's performance characteristics Test's the library's performance characteristics
- host-1: `./build/linux/selftest performance test/bob.conf`
- host-2: `./build/linux/selftest performance test/alice.conf`
### Correctness Tests ### Correctness Tests
Tests's the library's error handling, address treatment, and blocking/non-blocking behaviour. Tests's the library's error handling, address treatment, and blocking/non-blocking behaviour.
- host-1: `./build/linux/selftest correctness test/bob.conf`
- host-2: `./build/linux/selftest correctness test/alice.conf`