forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OpenMP][OMPT] Add "expected fail" testcases to libomptest
Added macro `OMPTTESTCASE_XFAIL` to allow for expected fails Moved macros into separate header file Added `printSummary` function which prints an execution summary Fixed smaller issues Change-Id: Ib19097642afa9e68522290aba4c3dd336a8ab290
- Loading branch information
Showing
8 changed files
with
150 additions
and
76 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
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,78 @@ | ||
#ifndef OPENMP_LIBOMPTARGET_TEST_OMPTEST_ASSERTMACROS_H | ||
#define OPENMP_LIBOMPTARGET_TEST_OMPTEST_ASSERTMACROS_H | ||
|
||
#define XQUOTE(str) QUOTE(str) | ||
#define QUOTE(str) #str | ||
|
||
/// ASSERT MACROS TO BE USED BY THE USER | ||
|
||
// Not implemented yet | ||
#define OMPT_ASSERT_EVENT(Event, ...) | ||
#define OMPT_ASSERT_SEQUENCE_NOT(Event, ...) | ||
|
||
// Handle a minimum unordered set of events | ||
#define OMPT_ASSERT_SET_EVENT(Name, Group, EventTy, ...) \ | ||
this->SetAsserter.insert(OmptAssertEvent::EventTy(Name, Group, __VA_ARGS__)); | ||
#define OMPT_ASSERT_SET(EventTy, ...) \ | ||
OMPT_ASSERT_SET_EVENT("", "", EventTy, __VA_ARGS__) | ||
#define OMPT_ASSERT_SET_GROUP(Group, EventTy, ...) \ | ||
OMPT_ASSERT_SET_EVENT("", Group, EventTy, __VA_ARGS__) | ||
#define OMPT_ASSERT_SET_NAMED(Name, EventTy, ...) \ | ||
OMPT_ASSERT_SET_EVENT(Name, "", EventTy, __VA_ARGS__) | ||
|
||
// Handle an exact sequence of events | ||
#define OMPT_ASSERT_SEQUENCE_EVENT(Name, Group, EventTy, ...) \ | ||
this->SequenceAsserter.insert( \ | ||
OmptAssertEvent::EventTy(Name, Group, __VA_ARGS__)); | ||
#define OMPT_ASSERT_SEQUENCE(EventTy, ...) \ | ||
OMPT_ASSERT_SEQUENCE_EVENT("", "", EventTy, __VA_ARGS__) | ||
#define OMPT_ASSERT_GROUPED_SEQUENCE(Group, EventTy, ...) \ | ||
OMPT_ASSERT_SEQUENCE_EVENT("", Group, EventTy, __VA_ARGS__) | ||
#define OMPT_ASSERT_NAMED_SEQUENCE(Name, EventTy, ...) \ | ||
OMPT_ASSERT_SEQUENCE_EVENT(Name, "", EventTy, __VA_ARGS__) | ||
|
||
// Enable / disable asserters entirely | ||
#define OMPT_ASSERTER_DISABLE(AsserterName) this->AsserterName.setActive(false); | ||
#define OMPT_ASSERTER_ENABLE(AsserterName) this->AsserterName.setActive(true); | ||
#define OMPT_ASSERT_SET_DISABLE() OMPT_ASSERTER_DISABLE(SetAsserter) | ||
#define OMPT_ASSERT_SET_ENABLE() OMPT_ASSERTER_ENABLE(SetAsserter) | ||
#define OMPT_REPORT_EVENT_DISABLE() OMPT_ASSERTER_DISABLE(EventReporter) | ||
#define OMPT_REPORT_EVENT_ENABLE() OMPT_ASSERTER_ENABLE(EventReporter) | ||
#define OMPT_ASSERT_SEQUENCE_DISABLE() OMPT_ASSERTER_DISABLE(SequenceAsserter) | ||
#define OMPT_ASSERT_SEQUENCE_ENABLE() OMPT_ASSERTER_ENABLE(SequenceAsserter) | ||
|
||
// Enable / disable certain event types for asserters | ||
#define OMPT_ASSERTER_PERMIT_EVENT(Asserter, EventTy) \ | ||
this->Asserter.permitEvent(EventTy); | ||
#define OMPT_ASSERTER_SUPPRESS_EVENT(Asserter, EventTy) \ | ||
this->Asserter.suppressEvent(EventTy); | ||
#define OMPT_PERMIT_EVENT(EventTy) \ | ||
OMPT_ASSERTER_PERMIT_EVENT(SetAsserter, EventTy); \ | ||
OMPT_ASSERTER_PERMIT_EVENT(EventReporter, EventTy); \ | ||
OMPT_ASSERTER_PERMIT_EVENT(SequenceAsserter, EventTy); | ||
#define OMPT_SUPPRESS_EVENT(EventTy) \ | ||
OMPT_ASSERTER_SUPPRESS_EVENT(SetAsserter, EventTy); \ | ||
OMPT_ASSERTER_SUPPRESS_EVENT(EventReporter, EventTy); \ | ||
OMPT_ASSERTER_SUPPRESS_EVENT(SequenceAsserter, EventTy); | ||
|
||
/// MACROS TO DEFINE A TESTSUITE + TESTCASE (like GoogleTest does) | ||
#define OMPTTESTCASE(SuiteName, CaseName) \ | ||
struct SuiteName##_##CaseName : public TestCase { \ | ||
SuiteName##_##CaseName() : TestCase(XQUOTE(CaseName)) {} \ | ||
virtual void execImpl() override; \ | ||
}; \ | ||
static Registerer R_##SuiteName##CaseName(new SuiteName##_##CaseName(), \ | ||
#SuiteName); \ | ||
void SuiteName##_##CaseName::execImpl() | ||
|
||
#define OMPTTESTCASE_XFAIL(SuiteName, CaseName) \ | ||
struct SuiteName##_##CaseName : public TestCase { \ | ||
SuiteName##_##CaseName() \ | ||
: TestCase(XQUOTE(CaseName), omptest::AssertState::fail) {} \ | ||
virtual void execImpl() override; \ | ||
}; \ | ||
static Registerer R_##SuiteName##CaseName(new SuiteName##_##CaseName(), \ | ||
#SuiteName); \ | ||
void SuiteName##_##CaseName::execImpl() | ||
|
||
#endif // include guard |
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
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