#include "c_sntptest.h"
#include <string.h>
+#include <unistd.h>
enum DirectoryType {
const char * CreatePath(const char* filename, enum DirectoryType argument) {
- char * path = malloc (sizeof (char) * 100);
+ char * path = malloc (sizeof (char) * 256);
/*
if (m_params.size() >= argument + 1) {
//return path;
- strcpy(path,"../../../sntp/tests/data/");
+ char cwd[1024];
+ if (getcwd(cwd, sizeof(cwd)) != NULL)
+ printf("Current working dir: %s\n", cwd);
+
+
+ if(strstr(cwd,"_build") == NULL){ //if it's run as make distcheck, it's in a different directory!
+ strcpy(path,"../../../sntp/tests/data/");
+ }
+
+ else {
+ strcpy(path,"../../../../sntp/tests/data/");
+ }
+
+
strcat(path,filename);
return path;
int main(int argc, char *argv[])
{
progname = argv[0];
+ //printf("NUM: %d , %s\n",argc,argv[0]);
Unity.TestFile = "keyFile.c";
UnityBegin("keyFile.c");
RUN_TEST(test_ReadEmptyKeyFile, 53);