1f08c3bdfSopenharmony_ci/*
2f08c3bdfSopenharmony_ci * Copyright (c) 2013 Cyril Hrubis chrubis@suse.cz
3f08c3bdfSopenharmony_ci *
4f08c3bdfSopenharmony_ci * This program is free software; you can redistribute it and/or
5f08c3bdfSopenharmony_ci * modify it under the terms of the GNU General Public License
6f08c3bdfSopenharmony_ci * as published by the Free Software Foundation; either version 2
7f08c3bdfSopenharmony_ci * of the License, or (at your option) any later version.
8f08c3bdfSopenharmony_ci *
9f08c3bdfSopenharmony_ci * This program is distributed in the hope that it will be useful,
10f08c3bdfSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
11f08c3bdfSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12f08c3bdfSopenharmony_ci * GNU General Public License for more details.
13f08c3bdfSopenharmony_ci *
14f08c3bdfSopenharmony_ci * You should have received a copy of the GNU General Public License
15f08c3bdfSopenharmony_ci * along with this program; if not, write to the Free Software
16f08c3bdfSopenharmony_ci * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17f08c3bdfSopenharmony_ci * This program is free software; you can redistribute it and/or modify it
18f08c3bdfSopenharmony_ci * under the terms of version 2 of the GNU General Public License as
19f08c3bdfSopenharmony_ci * published by the Free Software Foundation.
20f08c3bdfSopenharmony_ci */
21f08c3bdfSopenharmony_ci
22f08c3bdfSopenharmony_ci#ifndef __LTP_PRIV_H__
23f08c3bdfSopenharmony_ci#define __LTP_PRIV_H__
24f08c3bdfSopenharmony_ci
25f08c3bdfSopenharmony_ci#include <stdarg.h>
26f08c3bdfSopenharmony_ci#include "tst_defaults.h"
27f08c3bdfSopenharmony_ci
28f08c3bdfSopenharmony_ci/* environment variables for controlling  tst_res verbosity */
29f08c3bdfSopenharmony_ci#define TOUT_VERBOSE_S  "VERBOSE"	/* All test cases reported */
30f08c3bdfSopenharmony_ci#define TOUT_NOPASS_S   "NOPASS"	/* No pass test cases are reported */
31f08c3bdfSopenharmony_ci#define TOUT_DISCARD_S  "DISCARD"	/* No output is reported */
32f08c3bdfSopenharmony_ci
33f08c3bdfSopenharmony_ci#define USC_ITERATION_ENV       "USC_ITERATIONS"
34f08c3bdfSopenharmony_ci#define USC_LOOP_WALLTIME	"USC_LOOP_WALLTIME"
35f08c3bdfSopenharmony_ci#define USC_NO_FUNC_CHECK	"USC_NO_FUNC_CHECK"
36f08c3bdfSopenharmony_ci#define USC_LOOP_DELAY		"USC_LOOP_DELAY"
37f08c3bdfSopenharmony_ci
38f08c3bdfSopenharmony_ciconst char *parse_opts(int ac, char **av, const option_t *user_optarr, void
39f08c3bdfSopenharmony_ci                       (*uhf)(void));
40f08c3bdfSopenharmony_ci
41f08c3bdfSopenharmony_ci/* Interface for rerouting to new lib calls from tst_res.c */
42f08c3bdfSopenharmony_ciextern void *tst_test;
43f08c3bdfSopenharmony_ci
44f08c3bdfSopenharmony_civoid tst_vbrk_(const char *file, const int lineno, int ttype,
45f08c3bdfSopenharmony_ci               const char *fmt, va_list va) __attribute__((noreturn));
46f08c3bdfSopenharmony_ci
47f08c3bdfSopenharmony_civoid tst_brk_(const char *file, const int lineno, int ttype,
48f08c3bdfSopenharmony_ci              const char *msg, ...);
49f08c3bdfSopenharmony_ci
50f08c3bdfSopenharmony_civoid tst_vres_(const char *file, const int lineno, int ttype,
51f08c3bdfSopenharmony_ci               const char *fmt, va_list va);
52f08c3bdfSopenharmony_ci
53f08c3bdfSopenharmony_civoid tst_res_(const char *file, const int lineno, int ttype,
54f08c3bdfSopenharmony_ci              const char *msg, ...);
55f08c3bdfSopenharmony_ci
56f08c3bdfSopenharmony_ci
57f08c3bdfSopenharmony_ci#define NO_NEWLIB_ASSERT(file, lineno)                                \
58f08c3bdfSopenharmony_ci	if (tst_test) {                                               \
59f08c3bdfSopenharmony_ci		tst_brk_(file, lineno, TBROK,                         \
60f08c3bdfSopenharmony_ci			 "%s() executed from newlib!", __FUNCTION__); \
61f08c3bdfSopenharmony_ci	}
62f08c3bdfSopenharmony_ci
63f08c3bdfSopenharmony_ci#endif /* __LTP_PRIV_H__ */
64