Cygwin: Fix 'make check' in utils

This has a test of the path translation code used in various utilities
(mount, cygpath, strace).

MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e.
The issys member of mnt_t struct was removed in b677a99b.

> $ make check
[...]
> total tests: 63
> pass       : 63 (100.0%)
> fail       : 0 (0.0%)
This commit is contained in:
Jon Turney 2020-11-12 14:56:09 +00:00
parent 7d5efba796
commit cbf8fe6dca
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
3 changed files with 12 additions and 10 deletions

View File

@ -123,9 +123,9 @@ MINGW_BINS += testsuite.exe
MINGW_OBJS += path-testsuite.o testsuite.o
testsuite.exe: path-testsuite.o
path-testsuite.cc: path.cc ; @test -L $@ || ln -sf ${filter %.cc,$^} $@
path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE
path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE -Wno-error=write-strings
# this is necessary because this .c lives in the build dir instead of src
path-testsuite.o: MINGW_CXX := ${patsubst -I.,-I$(utils_source),$(MINGW_CXX)}
path-testsuite.o: MINGW_CXXFLAGS += -I$(srcdir)
path-testsuite.cc path.cc testsuite.cc: testsuite.h
check: testsuite.exe ; $(<D)/$(<F)

View File

@ -22,7 +22,9 @@ int get_word (HANDLE, int);
int get_dword (HANDLE, int);
bool from_fstab_line (mnt_t *m, char *line, bool user);
#ifndef TESTSUITE
extern mnt_t mount_table[255];
#endif
extern int max_mount_entry;
#ifndef SYMLINK_MAX

View File

@ -29,14 +29,14 @@ details. */
#if defined(TESTSUITE_MOUNT_TABLE)
static mnt_t mount_table[] = {
/* native posix flags issys */
{ TESTSUITE_ROOT, (char*)"/", MOUNT_BINARY | MOUNT_SYSTEM, 1 },
{ "O:\\other", (char*)"/otherdir", MOUNT_BINARY | MOUNT_SYSTEM, 1 },
{ "S:\\some\\dir", (char*)"/somedir", MOUNT_BINARY | MOUNT_SYSTEM, 1 },
{ TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_BINARY | MOUNT_SYSTEM, 1 },
{ TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_BINARY | MOUNT_SYSTEM, 1 },
{ ".", (char*)TESTSUITE_CYGDRIVE, MOUNT_BINARY | MOUNT_SYSTEM | MOUNT_CYGDRIVE, 1 },
{ NULL, (char*)NULL, 0, 0 }
/* native posix flags */
{ TESTSUITE_ROOT, (char*)"/", MOUNT_SYSTEM},
{ "O:\\other", (char*)"/otherdir", MOUNT_SYSTEM},
{ "S:\\some\\dir", (char*)"/somedir", MOUNT_SYSTEM},
{ TESTSUITE_ROOT"\\bin", (char*)"/usr/bin", MOUNT_SYSTEM},
{ TESTSUITE_ROOT"\\lib", (char*)"/usr/lib", MOUNT_SYSTEM},
{ ".", (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
{ NULL, (char*)NULL, 0}
};