author | Aleksey Demakov <ademakov@gmail.com> | 2020年01月09日 14:02:30 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020年01月09日 14:02:30 +0700 |
commit | 77fbfeceaa7d0d20a3fbc38f00a8d3f85707e7a8 (patch) | |
tree | 9ea40c89d96f654c52c1a0c1990b01c97f58a0ab /tests/unit/unit-tests.h | |
parent | 5fba3155b029c577cdb59569f222ba2d2bef045e (diff) | |
parent | 6a7e6d9eb375a6e853a36b9193c40d702d77ff48 (diff) | |
download | libjit-77fbfeceaa7d0d20a3fbc38f00a8d3f85707e7a8.tar.gz |
-rw-r--r-- | tests/unit/unit-tests.h | 41 |
diff --git a/tests/unit/unit-tests.h b/tests/unit/unit-tests.h new file mode 100644 index 0000000..0a51189 --- /dev/null +++ b/tests/unit/unit-tests.h @@ -0,0 +1,41 @@ +/* + * unit-tests.h - Defines for unit tests. + * + * Copyright (C) 2020 Free Software Foundation + * + * This file is part of the libjit library. + * + * The libjit library is free software: you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation, either version 2.1 of + * the License, or (at your option) any later version. + * + * The libjit library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the libjit library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef _JIT_TESTS_UNIT_TESTS_H +#define _JIT_TESTS_UNIT_TESTS_H + +#include <stdio.h> +#include <stdlib.h> + +/* Convenience. */ +#include <jit/jit-dump.h> + +#define CHECK(val) \ + do { \ + if (!(val)) { \ + fprintf (stderr, "%s:%d: error: test failure\n", \ + __FILE__, __LINE__); \ + exit (1); \ + } \ + } while (0) + +#endif /* _JIT_TESTS_UNIT_TESTS_H */ |