test_helpers.h revision 11313
110915Sandreas.sandberg@arm.com/*
210915Sandreas.sandberg@arm.com * Copyright (c) 2013 Andreas Sandberg
310915Sandreas.sandberg@arm.com * All rights reserved
410915Sandreas.sandberg@arm.com *
510915Sandreas.sandberg@arm.com * Licensed under the Apache License, Version 2.0 (the "License");
610915Sandreas.sandberg@arm.com * you may not use this file except in compliance with the License.
710915Sandreas.sandberg@arm.com * You may obtain a copy of the License at
810915Sandreas.sandberg@arm.com *
910915Sandreas.sandberg@arm.com *     http://www.apache.org/licenses/LICENSE-2.0
1010915Sandreas.sandberg@arm.com *
1110915Sandreas.sandberg@arm.com * Unless required by applicable law or agreed to in writing, software
1210915Sandreas.sandberg@arm.com * distributed under the License is distributed on an "AS IS" BASIS,
1310915Sandreas.sandberg@arm.com * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1410915Sandreas.sandberg@arm.com * See the License for the specific language governing permissions and
1510915Sandreas.sandberg@arm.com * limitations under the License.
1610915Sandreas.sandberg@arm.com *
1710915Sandreas.sandberg@arm.com * Authors: Andreas Sandberg
1810915Sandreas.sandberg@arm.com */
1910915Sandreas.sandberg@arm.com
2010915Sandreas.sandberg@arm.com#ifndef _TEST_HELPERS
2110915Sandreas.sandberg@arm.com#define _TEST_HELPERS 1
2210915Sandreas.sandberg@arm.com
2310915Sandreas.sandberg@arm.com#include <stdio.h>
2410915Sandreas.sandberg@arm.com
2510915Sandreas.sandberg@arm.com#ifdef __cplusplus
2611313Sandreas.sandberg@arm.comextern "C" {
2710915Sandreas.sandberg@arm.com#endif
2810915Sandreas.sandberg@arm.com
2910915Sandreas.sandberg@arm.comextern unsigned test_current;
3010915Sandreas.sandberg@arm.comextern unsigned test_count;
3110915Sandreas.sandberg@arm.comextern unsigned test_fail_count;
3210915Sandreas.sandberg@arm.com
3310915Sandreas.sandberg@arm.comvoid test_init(unsigned no_tests);
3410915Sandreas.sandberg@arm.comvoid test_exit()
3510915Sandreas.sandberg@arm.com    __attribute__((noreturn));
3610915Sandreas.sandberg@arm.com
3710915Sandreas.sandberg@arm.comvoid test_bail(const char *fmt, ...)
3810915Sandreas.sandberg@arm.com    __attribute__((format (printf, 1, 2), noreturn));
3910915Sandreas.sandberg@arm.com
4010915Sandreas.sandberg@arm.comvoid test_diag(const char *fmt, ...)
4110915Sandreas.sandberg@arm.com    __attribute__((format (printf, 1, 2)));
4210915Sandreas.sandberg@arm.com
4310915Sandreas.sandberg@arm.comvoid test_ok(const char *test);
4410915Sandreas.sandberg@arm.com
4510915Sandreas.sandberg@arm.comvoid test_fail(const char *test);
4610915Sandreas.sandberg@arm.com
4710915Sandreas.sandberg@arm.comvoid test_skip(const char *test, const char *fmt_why, ...)
4810915Sandreas.sandberg@arm.com    __attribute__((format (printf, 2, 3)));
4910915Sandreas.sandberg@arm.com
5010915Sandreas.sandberg@arm.comvoid test_todo(const char *test, const char *fmt_why, ...)
5110915Sandreas.sandberg@arm.com    __attribute__((format (printf, 2, 3)));
5210915Sandreas.sandberg@arm.com
5310915Sandreas.sandberg@arm.com#ifdef __cplusplus
5410915Sandreas.sandberg@arm.com}
5510915Sandreas.sandberg@arm.com#endif
5610915Sandreas.sandberg@arm.com
5710915Sandreas.sandberg@arm.com#endif
58