All test utility code should go into the spvtest namespace.
namespace {
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
TEST_F(TextToBinaryTest, EncodeAAFTextAsAAF) {
SetText("%2 = OpConstant %1 1000");
spvBinaryDestroy(nullptr);
}
-using BinaryDestroySomething = test_fixture::TextToBinaryTest;
+using BinaryDestroySomething = spvtest::TextToBinaryTest;
// Checks safety of destroying a validly constructed binary.
TEST_F(BinaryDestroySomething, Default) {
namespace {
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
TEST_F(TextToBinaryTest, Whitespace) {
SetText(R"(
namespace {
+using spvtest::TextToBinaryTest;
using ::testing::ElementsAre;
using ::testing::HasSubstr;
using ::testing::StrEq;
-using test_fixture::TextToBinaryTest;
const auto kCAF = SPV_ASSEMBLY_SYNTAX_FORMAT_CANONICAL;
#include "UnitSPIRV.h"
-namespace test_fixture {
+namespace spvtest {
// Common setup for TextToBinary tests. SetText() should be called to populate
// the actual test text.
using TextToBinaryTest = TextToBinaryTestBase<::testing::Test>;
-} // namespace test_fixture
+} // namespace spvtest
#endif // _TEXT_FIXTURE_H_
using spvtest::MakeInstruction;
using spvtest::MakeVector;
+using spvtest::TextToBinaryTest;
using ::testing::Eq;
-using test_fixture::TextToBinaryTest;
// Test OpDecorate
};
using OpDecorateSimpleTest =
- test_fixture::TextToBinaryTestBase<::testing::TestWithParam<DecorateSimpleCase>>;
+ spvtest::TextToBinaryTestBase<::testing::TestWithParam<DecorateSimpleCase>>;
TEST_P(OpDecorateSimpleTest, AnySimpleDecoration) {
// This string should assemble, but should not validate.
std::string enum_name;
};
-using OpDecorateEnumTest = test_fixture::TextToBinaryTestBase<
+using OpDecorateEnumTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<DecorateEnumCase>>;
TEST_P(OpDecorateEnumTest, AnyEnumDecoration) {
std::string external_name;
};
-using OpDecorateLinkageTest = test_fixture::TextToBinaryTestBase<
+using OpDecorateLinkageTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<DecorateLinkageCase>>;
TEST_P(OpDecorateLinkageTest, AnyLinkageDecoration) {
// Test Sampler Addressing Mode enum values
-using SamplerAddressingModeTest = test_fixture::TextToBinaryTestBase<
+using SamplerAddressingModeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::SamplerAddressingMode>>>;
TEST_P(SamplerAddressingModeTest, AnySamplerAddressingMode) {
// Test Sampler Filter Mode enum values
-using SamplerFilterModeTest = test_fixture::TextToBinaryTestBase<
+using SamplerFilterModeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::SamplerFilterMode>>>;
TEST_P(SamplerFilterModeTest, AnySamplerFilterMode) {
using spvtest::MakeInstruction;
using ::testing::Eq;
-using test_fixture::TextToBinaryTest;
// Test OpSelectionMerge
-using OpSelectionMergeTest = test_fixture::TextToBinaryTestBase<
+using OpSelectionMergeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::SelectionControlMask>>>;
TEST_P(OpSelectionMergeTest, AnySingleSelectionControlMask) {
// Test OpLoopMerge
-using OpLoopMergeTest = test_fixture::TextToBinaryTestBase<
+using OpLoopMergeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::LoopControlMask>>>;
TEST_P(OpLoopMergeTest, AnySingleLoopControlMask) {
// clang-format on
using OpSourceTest =
- test_fixture::TextToBinaryTestBase<::testing::TestWithParam<LanguageCase>>;
+ spvtest::TextToBinaryTestBase<::testing::TestWithParam<LanguageCase>>;
TEST_P(OpSourceTest, AnyLanguage) {
std::string input = std::string("OpSource ") + GetParam().language_name +
// Test OpSourceExtension
using OpSourceExtensionTest =
- test_fixture::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
+ spvtest::TextToBinaryTestBase<::testing::TestWithParam<const char*>>;
TEST_P(OpSourceExtensionTest, AnyExtension) {
// TODO(dneto): utf-8, quoting, escaping
namespace {
using spvtest::MakeInstruction;
+using spvtest::TextToBinaryTest;;
using ::testing::Eq;
-using test_fixture::TextToBinaryTest;;
// Test OpFunction
-using OpFunctionControlTest = test_fixture::TextToBinaryTestBase<
+using OpFunctionControlTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::FunctionControlMask>>>;
TEST_P(OpFunctionControlTest, AnySingleFunctionControlMask) {
// Test GroupOperation enum
-using GroupOperationTest = test_fixture::TextToBinaryTestBase<
+using GroupOperationTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::GroupOperation>>>;
TEST_P(GroupOperationTest, AnyGroupOperation) {
// Test all kinds of image operands.
-using ImageOperandsTest = test_fixture::TextToBinaryTestBase<
+using ImageOperandsTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<ImageOperandsCase>>;
TEST_P(ImageOperandsTest, Sample) {
namespace {
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
TEST_F(TextToBinaryTest, LiteralStringInPlaceOfLiteralNumber) {
EXPECT_EQ(
namespace {
using spvtest::MakeInstruction;
+using spvtest::TextToBinaryTest;
using ::testing::Eq;
-using test_fixture::TextToBinaryTest;
// An example case for an enumerated value.
template <typename E>
// Test assembly of Memory Access masks
-using MemoryAccessTest = test_fixture::TextToBinaryTestBase<
+using MemoryAccessTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCaseWithOperands<spv::MemoryAccessMask>>>;
TEST_P(MemoryAccessTest, AnySingleMemoryAccessMask) {
// Test Storage Class enum values
-using StorageClassTest = test_fixture::TextToBinaryTestBase<
+using StorageClassTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCaseWithOperands<spv::StorageClass>>>;
TEST_P(StorageClassTest, AnyStorageClass) {
namespace {
-using SpirvVector = test_fixture::TextToBinaryTest::SpirvVector;
+using SpirvVector = spvtest::TextToBinaryTest::SpirvVector;
using spv::Op;
using spvtest::MakeInstruction;
using ::testing::Eq;
-using TextToBinaryMisc = test_fixture::TextToBinaryTest;
+using TextToBinaryMisc = spvtest::TextToBinaryTest;
TEST_F(TextToBinaryMisc, OpNop) {
EXPECT_THAT(CompiledInstructions("OpNop"), Eq(MakeInstruction(OpNop, {})));
std::string memory_name;
};
-using OpMemoryModelTest = test_fixture::TextToBinaryTestBase<
+using OpMemoryModelTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<MemoryModelCase>>;
TEST_P(OpMemoryModelTest, AnyMemoryModelCase) {
std::string entry_point_name;
};
-using OpEntryPointTest = test_fixture::TextToBinaryTestBase<
+using OpEntryPointTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EntryPointCase>>;
TEST_P(OpEntryPointTest, AnyEntryPointCase) {
std::vector<uint32_t> operands;
};
-using OpExecutionModeTest = test_fixture::TextToBinaryTestBase<
+using OpExecutionModeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<ExecutionModeCase>>;
TEST_P(OpExecutionModeTest, AnyExecutionMode) {
// Test OpCapability
-using OpCapabilityTest = test_fixture::TextToBinaryTestBase<
+using OpCapabilityTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::Capability>>>;
TEST_P(OpCapabilityTest, AnyCapability) {
// Test Dim enums via OpTypeImage
-using DimTest = test_fixture::TextToBinaryTestBase<
+using DimTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::Dim>>>;
TEST_P(DimTest, AnyDim) {
// Test ImageFormat enums via OpTypeImage
-using ImageFormatTest = test_fixture::TextToBinaryTestBase<
+using ImageFormatTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::ImageFormat>>>;
TEST_P(ImageFormatTest, AnyImageFormat) {
// Test AccessQualifier enums via OpTypePipe.
-using OpTypePipeTest = test_fixture::TextToBinaryTestBase<
+using OpTypePipeTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<EnumCase<spv::AccessQualifier>>>;
TEST_P(OpTypePipeTest, AnyAccessQualifier) {
namespace {
-using test_fixture::TextToBinaryTest;
+using spvtest::TextToBinaryTest;
TEST(GetWord, Simple) {
EXPECT_EQ("", spvGetWord(""));
diagnostic->error);
}
-using TextToBinaryFloatValueTest = test_fixture::TextToBinaryTestBase<
+using TextToBinaryFloatValueTest = spvtest::TextToBinaryTestBase<
::testing::TestWithParam<std::pair<std::string, uint32_t>>>;
TEST_P(TextToBinaryFloatValueTest, NormalValues) {