Dmitry V. Levin
9f93fd094f
* tests/skip_unavailable.c: New file. * tests/tests.h (skip_if_unavailable): New prototype. * tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c.
14 lines
197 B
C
14 lines
197 B
C
#include "tests.h"
|
|
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
|
|
void
|
|
skip_if_unavailable(const char *const path)
|
|
{
|
|
struct stat st;
|
|
|
|
if (stat(path, &st))
|
|
perror_msg_and_skip("stat: %s", path);
|
|
}
|