summaryrefslogtreecommitdiff
path: root/testing/hstox/driver.h
blob: 219df8a1cfd653a61e8e2607dea2e5c273319107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <stdbool.h>
#include <stdint.h>

// Settings for the test runner.
struct settings {
    // Print the msgpack object on test failure.
    bool debug;
    // Write test sample files into test-inputs/. These files, one per test
    // method, are used to seed the fuzzer.
    bool collect_samples;
};

// Main loop communicating via read/write file descriptors. The two fds can be
// the same in case of a network socket.
int communicate(struct settings cfg, int read_fd, int write_fd);

// Open a TCP socket on the given port and start communicate().
uint32_t network_main(struct settings cfg, uint16_t port, unsigned int timeout);