Add autotest for chomp

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2015-08-22 22:08:25 +02:00
parent 2ea2357b62
commit ebe2ad4a4c
4 changed files with 8 additions and 3 deletions
+1
View File
@@ -65,6 +65,7 @@ incdir ?= $(prefix)/include
include rules.mk
test:
$(MAKE) -f chomp.mk
$(MAKE) -f rsync.mk
$(OBJS): Makefile
+2 -2
View File
@@ -50,13 +50,13 @@ char *chomp(char *str)
int main(void)
{
int i; char t[][16] = { "hej\ndej", "Slime\n\n\\n", "Tripple\n\n\n", "" };
for (i = 0; t[i][0]; i++) printf("'%s'\n", chomp(t[i])); return 0;
for (i = 0; t[i][0]; i++) printf("[%02d]: '%s'\n", i, chomp(t[i])); return 0;
}
#endif
/**
* Local Variables:
* compile-command: "gcc -DUNITTEST -o chompy chomp.c && ./chompy"
* compile-command: "make V=1 -f chomp.mk"
* version-control: t
* indent-tabs-mode: t
* c-file-style: "linux"
+4
View File
@@ -0,0 +1,4 @@
OBJS =
TARGET = chomp.test clean
include rules.mk
+1 -1
View File
@@ -293,7 +293,7 @@ int main(int argc, char *argv[])
/**
* Local Variables:
* compile-command: "make -f rsync.mk"
* compile-command: "make V=1 -f rsync.mk"
* version-control: t
* indent-tabs-mode: t
* c-file-style: "linux"