diff options
author | Thomas Wienecke <wienecke.t@gmail.com> | 2014-03-11 19:11:46 +0100 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-03-15 11:50:22 -0300 |
commit | 1f578ec5a1baa75b557af2261518d9fb8aee488b (patch) | |
tree | d3322c795566e967fd2af3cc2fded077b93bff9a /test/includes | |
parent | 231d4511d1f24bb96bb17eff7a448fb360eba9c6 (diff) | |
download | rneovim-1f578ec5a1baa75b557af2261518d9fb8aee488b.tar.gz rneovim-1f578ec5a1baa75b557af2261518d9fb8aee488b.tar.bz2 rneovim-1f578ec5a1baa75b557af2261518d9fb8aee488b.zip |
Add unit tests for mch_[gs]etperm.
Use preprocessor trick proposed by @mahkoh to import 'defines' like
S_IRUSR.
Diffstat (limited to 'test/includes')
-rw-r--r-- | test/includes/Makefile | 11 | ||||
-rw-r--r-- | test/includes/pre/sys/stat.h | 26 |
2 files changed, 37 insertions, 0 deletions
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 <sys/stat.h> + +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; |