summaryrefslogtreecommitdiff
path: root/test-cmdline.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2011-10-31 18:29:35 +0000
committerBen Hutchings <bhutchings@solarflare.com>2012-05-23 01:02:29 +0100
commitdfacc4a0fa3be71539be94da11f5cd3f47ffcbe5 (patch)
treeae4f589f30d8e84a87540a45fea091450919541d /test-cmdline.c
parent2edf56749abe006f6a68c9c21a2a249d29345a01 (diff)
downloadethtool-dfacc4a0fa3be71539be94da11f5cd3f47ffcbe5.tar.gz
Run tests in-process
Wrap main(), exit(), and resource management so that ethtool commands can be tested without starting a new process and without leaking. This will allow deeper teesting that covers ioctl requests and responses. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'test-cmdline.c')
-rw-r--r--test-cmdline.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test-cmdline.c b/test-cmdline.c
index c30b0e6..c62bb97 100644
--- a/test-cmdline.c
+++ b/test-cmdline.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
+#define TEST_NO_WRAPPERS
#include "internal.h"
static struct test_case {
@@ -232,6 +233,12 @@ static struct test_case {
{ 1, "-0" },
};
+int send_ioctl(struct cmd_context *ctx, void *cmd)
+{
+ /* If we get this far then parsing succeeded */
+ test_exit(0);
+}
+
int main(void)
{
struct test_case *tc;