diff options
Diffstat (limited to 'tutorial/chapter-7/test')
-rw-r--r-- | tutorial/chapter-7/test/test.c | 18 | ||||
-rw-r--r-- | tutorial/chapter-7/test/test.qbs | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tutorial/chapter-7/test/test.c b/tutorial/chapter-7/test/test.c new file mode 100644 index 000000000..1fef24685 --- /dev/null +++ b/tutorial/chapter-7/test/test.c @@ -0,0 +1,18 @@ +#include "lib.h" + +#include <stdio.h> +#include <string.h> + +int main(int argc, char *argv[]) +{ + if (argc > 2) { + printf("usage: test [value]\n"); + return 1; + } + const char *expected = argc == 2 ? argv[1] : "Hello from library"; + if (strcmp(get_string(), expected) != 0) { + printf("text differs\n"); + return 1; + } + return 0; +} diff --git a/tutorial/chapter-7/test/test.qbs b/tutorial/chapter-7/test/test.qbs new file mode 100644 index 000000000..1e911da47 --- /dev/null +++ b/tutorial/chapter-7/test/test.qbs @@ -0,0 +1,5 @@ +MyAutoTest { + Depends { name: "mylib" } + name: "mytest" + files: "test.c" +} |