Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CTSRD-CHERI/cheri-c-tests to cheriabitest.
The cheri-c-tests has been added as a submodule in contrib/cheri-c-tests. The cheritest infrastructure has been modified to support building these tests into the main test program when requested. This makes sense only when compiling for the pure capabilty ABI so cheriabitest does this. Because submodules are somewhat fragile and require additional steps, the Makefile infrastructure attempts to avoid building the cheri-c-tests code if they are not present and derives a list of tests from the submodule rather than hardcoding one. Currently tests requiring fault handlers are not supported. In principle they should work, but currently they do not so the are not included in the cheri_tests array.
- Loading branch information
1 parent
92209de
commit 9081a9c
Showing
8 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "contrib/cheri-c-tests"] | ||
path = contrib/cheri-c-tests | ||
url = https://github.com/CTSRD-CHERI/cheri-c-tests.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef __CHERI_C_TEST_FRAMEWORK_H__ | ||
#define __CHERI_C_TEST_FRAMEWORK_H__ | ||
#include <sys/types.h> | ||
#include <stdlib.h> | ||
#include <cheritest.h> | ||
|
||
#define assert(x) \ | ||
do { \ | ||
if (!(x)) \ | ||
cheritest_failure_errx("%s is false: %s:%d", #x, __FILE__, __LINE__); \ | ||
} while(0) | ||
|
||
#define DECLARE_TEST(name, desc) \ | ||
void cheri_c_test_ ## name(const struct cheri_test *ctp __unused); | ||
#define DECLARE_TEST_FAULT(name, desc) /* Not supported */ | ||
#define BEGIN_TEST(name) \ | ||
void cheri_c_test_ ## name(const struct cheri_test *ctp __unused) { \ | ||
test_setup(); | ||
#define END_TEST cheritest_success(); } | ||
|
||
#endif /* __CHERI_C_TEST_FRAMEWORK_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cheri-c-tests
added at
b66835