-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Small bugfix and remove some unnecessary includes
- Loading branch information
Showing
10 changed files
with
43 additions
and
36 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
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,18 @@ | ||
#ifndef _FLEXFLOW_LIB_UTILS_INCLUDE_UTILS_RAPIDCHECK_VARIANT_H | ||
#define _FLEXFLOW_LIB_UTILS_INCLUDE_UTILS_RAPIDCHECK_VARIANT_H | ||
|
||
#include <variant> | ||
#include <rapidcheck.h> | ||
|
||
namespace rc { | ||
|
||
template <typename... Ts> | ||
struct Arbitrary<std::variant<Ts...>> { | ||
static Gen<std::variant<Ts...>> arbitrary() { | ||
return gen::oneOf(gen::construct<std::variant<Ts...>>(gen::arbitrary<Ts>())...); | ||
} | ||
}; | ||
|
||
} // namespace rc | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
#include "utils/rapidcheck/variant.h" | ||
|
||
namespace rc { | ||
|
||
using T0 = int; | ||
using T1 = std::string; | ||
|
||
template | ||
struct Arbitrary<std::variant<T0, T1>>; | ||
|
||
} // namespace rc |
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,13 @@ | ||
#include "utils/rapidcheck/variant.h" | ||
#include <doctest/doctest.h> | ||
#include "test/utils/rapidcheck.h" | ||
|
||
using namespace ::FlexFlow; | ||
|
||
TEST_SUITE(FF_TEST_SUITE) { | ||
TEST_CASE("Arbitrary<std::variant>") { | ||
RC_SUBCASE("valid type", [](std::variant<int, float> v) { | ||
return std::holds_alternative<int>(v) || std::holds_alternative<float>(v); | ||
}); | ||
} | ||
} |
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