ovni/test/unit/cfg.c
Rodrigo Arias ddbb7dd9f4 Add include-what-you-use
Adds forwards declarations in headers and includes all headers in
sources, even if they are found by transitive includes.
2023-03-24 12:08:45 +00:00

30 lines
611 B
C

/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "emu/pv/cfg.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include "common.h"
int main(void)
{
char dir[] = "/tmp/ovni.trace.XXXXXX";
if (mkdtemp(dir) == NULL)
die("mkdtemp failed:");
if (cfg_generate(dir) != 0)
die("cfg_generate failed");
/* Check that one configuration file is present */
char cfg[PATH_MAX];
sprintf(cfg, "%s/cfg/cpu/ovni/pid.cfg", dir);
struct stat st;
if (stat(cfg, &st) != 0)
die("stat failed");
return 0;
}