Added test case to inspect processed argc/argv after libbarrelfish initialization.
authorSimon Gerber <simon.gerber@hp.com>
Mon, 4 Aug 2014 22:58:38 +0000 (15:58 -0700)
committerSimon Gerber <simon.gerber@inf.ethz.ch>
Mon, 4 May 2015 09:28:13 +0000 (11:28 +0200)
Signed-off-by: Simon Gerber <simon.gerber@hp.com>

usr/tests/argtest/Hakefile [new file with mode: 0644]
usr/tests/argtest/argtest.c [new file with mode: 0644]

diff --git a/usr/tests/argtest/Hakefile b/usr/tests/argtest/Hakefile
new file mode 100644 (file)
index 0000000..f13d33f
--- /dev/null
@@ -0,0 +1,16 @@
+--------------------------------------------------------------------------
+-- Copyright (c) 2014, HP Labs.
+-- All rights reserved.
+--
+-- This file is distributed under the terms in the attached LICENSE file.
+-- If you do not find this file, copies can be found by writing to:
+-- ETH Zurich D-INFK, Universitaetstr 6, CH-8092 Zurich. Attn: Systems Group.
+--
+-- Hakefile for /usr/tests/argtest
+--
+-- Argument parsing test.
+--
+--------------------------------------------------------------------------
+
+[ build application { target = "argtest", cFiles = [ "argtest.c" ] }
+]
diff --git a/usr/tests/argtest/argtest.c b/usr/tests/argtest/argtest.c
new file mode 100644 (file)
index 0000000..6b84c28
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * \file
+ * \brief arguments test.
+ */
+
+/*
+ * Copyright (c) 2014, HP Labs.
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached LICENSE file.
+ * If you do not find this file, copies can be found by writing to:
+ * ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
+ */
+
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+    for (int i = 0; i < argc; i++) {
+        printf("argv[%d] = %s\n", i, argv[i]);
+    }
+    return 0;
+}