mosquitto/test/path_helper.h
Kai Buschulte a883bda9c1 Add CMake test target
Use `ctest` or `make test` to run all tests.
With this it's also possible to run tests on a Mac.

Relative paths used in tests become absolute ones to make tests
executable from any build folder.

Also fixed race condition in
  test/broker/11-persistent-subscription-no-local.py

Signed-off-by: Kai Buschulte <kai.buschulte@cedalo.com>
2022-06-22 23:56:50 +01:00

17 lines
348 B
C

#ifndef PATH_HELPER_H
#define PATH_HELPER_H
#include <libgen.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
/* returns <current source directory>/<relpath> written to <dest> */
void cat_sourcedir_with_relpath(char* dest, const char* relpath) {
strcpy(dest,TEST_SOURCE_DIR);
strcat(dest, relpath);
}
#endif