summaryrefslogtreecommitdiff
path: root/testing/hstox/driver.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-10-01 00:26:52 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-10-01 02:13:34 +0100
commitc037100747a1a224160cb12defb600ddfe1ba927 (patch)
tree8332a7d288116b802866e1ed98d1b950425206f7 /testing/hstox/driver.h
parent1977d56caaff40ea9bbf6754b69bec9539a5a969 (diff)
Import the hstox SUT interface from hstox.
We'll maintain it in the c-toxcore repo, where it belongs.
Diffstat (limited to 'testing/hstox/driver.h')
-rw-r--r--testing/hstox/driver.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/hstox/driver.h b/testing/hstox/driver.h
new file mode 100644
index 00000000..219df8a1
--- /dev/null
+++ b/testing/hstox/driver.h
@@ -0,0 +1,20 @@
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>
5
6// Settings for the test runner.
7struct settings {
8 // Print the msgpack object on test failure.
9 bool debug;
10 // Write test sample files into test-inputs/. These files, one per test
11 // method, are used to seed the fuzzer.
12 bool collect_samples;
13};
14
15// Main loop communicating via read/write file descriptors. The two fds can be
16// the same in case of a network socket.
17int communicate(struct settings cfg, int read_fd, int write_fd);
18
19// Open a TCP socket on the given port and start communicate().
20uint32_t network_main(struct settings cfg, uint16_t port, unsigned int timeout);