mirror of
https://github.com/troglobit/libite.git
synced 2026-10-26 12:04:38 +00:00
Add autotest for dir
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
ab2b0f00fa
commit
36da3aa35e
3 files changed
+9
-4
No files matched your search
@@ -67,6 +67,7 @@ include rules.mk
|
|||||||
test:
|
test:
|
||||||
$(MAKE) -f chomp.mk
|
$(MAKE) -f chomp.mk
|
||||||
$(MAKE) -f copyfile.mk
|
$(MAKE) -f copyfile.mk
|
||||||
|
$(MAKE) -f dir.mk
|
||||||
$(MAKE) -f pidfilefn.mk
|
$(MAKE) -f pidfilefn.mk
|
||||||
$(MAKE) -f rsync.mk
|
$(MAKE) -f rsync.mk
|
||||||
|
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ int dir(const char *dir, const char *type, int (*filter) (const char *file), cha
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "otn/c.h"
|
#include "lite.h"
|
||||||
|
|
||||||
#define DIR_TYPE_IMAGE ".img"
|
#define DIR_TYPE_IMAGE ".img"
|
||||||
#define DIR_TYPE_SYSLOG ""
|
#define DIR_TYPE_SYSLOG ""
|
||||||
@@ -138,7 +138,7 @@ int simulate_files(int creat)
|
|||||||
"rr109.img", "rx100.img", "rx107.img", "rm957.img", "messages"
|
"rr109.img", "rx100.img", "rx107.img", "rm957.img", "messages"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_ELEMENTS(files); i++) {
|
for (i = 0; i < NELEMS(files); i++) {
|
||||||
if (creat)
|
if (creat)
|
||||||
touch(files[i]);
|
touch(files[i]);
|
||||||
else
|
else
|
||||||
@@ -217,11 +217,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif /* UNITTEST */
|
#endif /* UNITTEST */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local Variables:
|
* Local Variables:
|
||||||
* compile-command: "gcc -g -DUNITTEST -o unittest dir.c"
|
* compile-command: "make V=1 -f dir.mk"
|
||||||
* version-control: t
|
* version-control: t
|
||||||
* indent-tabs-mode: t
|
* indent-tabs-mode: t
|
||||||
* c-file-style: "linux"
|
* c-file-style: "linux"
|
||||||
|
|||||||
Reference in new issue
Block a user