#include "xUnit++/IOutput.h"#include "xUnit++/TestCollection.h"#include "xUnit++/xUnitTestRunner.h"#include "xUnit++/xUnit++.h"#include "Helpers/OutputRecord.h"SUITE("Attributes"){ATTRIBUTES(("Cats","Meow")){FACT("TestWithAttributes"){for(constauto&test:xUnitpp::TestCollection::Instance().Tests()){if(test->TestDetails().Name=="TestWithAttributes"){autoit=std::find_if(test->TestDetails().Attributes.begin(),test->TestDetails().Attributes.end(),[](conststd::pair<std::string,std::string>&item){returnitem.first=="Cats";});Assert.True(it!=test->TestDetails().Attributes.end());Assert.True(it->second=="Meow");return;}}Assert.Fail()<<"Could not find self in test list.";}}FACT("SkippedTestsShouldNotBeInstantiated"){// have to set this internal test up manually since the macros don't work embedded within each otherstructSkippedTest:xUnitpp::NoFixture{SkippedTest(){Assert.Fail()<<"Should not be instantiated.";}voidRunTest(){Assert.Fail()<<"Should not be run.";}};xUnitpp::Tests::OutputRecordrecord;xUnitpp::AttributeCollectionattributes;attributes.insert(std::make_pair("Skip","Testing skip."));xUnitpp::TestCollectioncollection;std::vector<std::shared_ptr<xUnitpp::TestEventRecorder>>localEventRecorders;xUnitpp::TestCollection::Registerreg(collection,[](){SkippedTest().RunTest();},"SkippedTest","Attributes",std::forward<decltype(attributes)>(attributes),-1,__FILE__,__LINE__,std::forward<decltype(localEventRecorders)>(localEventRecorders));(void)reg;xUnitpp::RunTests(record,[](constxUnitpp::ITestDetails&){returntrue;},collection.Tests(),xUnitpp::Time::Duration::zero(),0);}}