From 1f578ec5a1baa75b557af2261518d9fb8aee488b Mon Sep 17 00:00:00 2001 From: Thomas Wienecke Date: Tue, 11 Mar 2014 19:11:46 +0100 Subject: Add unit tests for mch_[gs]etperm. Use preprocessor trick proposed by @mahkoh to import 'defines' like S_IRUSR. --- test/includes/Makefile | 11 +++++++++++ test/includes/pre/sys/stat.h | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 test/includes/Makefile create mode 100644 test/includes/pre/sys/stat.h (limited to 'test/includes') diff --git a/test/includes/Makefile b/test/includes/Makefile new file mode 100644 index 0000000000..740d571504 --- /dev/null +++ b/test/includes/Makefile @@ -0,0 +1,11 @@ +POST = $(shell find pre -name '*.h' | sed 's/^pre/post/') + +all: $(POST) + +$(POST): post/%: pre/% + @echo GEN $* + @mkdir -p $(@D) + @cc -std=c99 -E -P $< -o $@ + +clean: + rm -rf post diff --git a/test/includes/pre/sys/stat.h b/test/includes/pre/sys/stat.h new file mode 100644 index 0000000000..c6cac80913 --- /dev/null +++ b/test/includes/pre/sys/stat.h @@ -0,0 +1,26 @@ +#define _GNU_SOURCE +#include + +static const mode_t kS_IFMT = S_IFMT; +static const mode_t kS_IFSOCK = S_IFSOCK; +static const mode_t kS_IFLNK = S_IFLNK; +static const mode_t kS_IFREG = S_IFREG; +static const mode_t kS_IFBLK = S_IFBLK; +static const mode_t kS_IFDIR = S_IFDIR; +static const mode_t kS_IFCHR = S_IFCHR; +static const mode_t kS_IFIFO = S_IFIFO; +static const mode_t kS_ISUID = S_ISUID; +static const mode_t kS_ISGID = S_ISGID; +static const mode_t kS_ISVTX = S_ISVTX; +static const mode_t kS_IRWXU = S_IRWXU; +static const mode_t kS_IRUSR = S_IRUSR; +static const mode_t kS_IWUSR = S_IWUSR; +static const mode_t kS_IXUSR = S_IXUSR; +static const mode_t kS_IRWXG = S_IRWXG; +static const mode_t kS_IRGRP = S_IRGRP; +static const mode_t kS_IWGRP = S_IWGRP; +static const mode_t kS_IXGRP = S_IXGRP; +static const mode_t kS_IRWXO = S_IRWXO; +static const mode_t kS_IROTH = S_IROTH; +static const mode_t kS_IWOTH = S_IWOTH; +static const mode_t kS_IXOTH = S_IXOTH; -- cgit