forked from OSchip/llvm-project
[Reproducer] Use // in the unit tests
This should be a valid absolute path on both POSIX and Windows. llvm-svn: 373124
This commit is contained in:
parent
84ca5c8cbf
commit
b0921daf02
|
@ -53,17 +53,17 @@ TEST(ReproducerTest, SetCapture) {
|
||||||
|
|
||||||
// Enable capture and check that means we have a generator.
|
// Enable capture and check that means we have a generator.
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetCapture(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Succeeded());
|
Succeeded());
|
||||||
EXPECT_NE(nullptr, reproducer.GetGenerator());
|
EXPECT_NE(nullptr, reproducer.GetGenerator());
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
reproducer.GetGenerator()->GetRoot());
|
reproducer.GetGenerator()->GetRoot());
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
reproducer.GetReproducerPath());
|
reproducer.GetReproducerPath());
|
||||||
|
|
||||||
// Ensure that we cannot enable replay.
|
// Ensure that we cannot enable replay.
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetReplay(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetReplay(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Failed());
|
Failed());
|
||||||
EXPECT_EQ(nullptr, reproducer.GetLoader());
|
EXPECT_EQ(nullptr, reproducer.GetLoader());
|
||||||
|
|
||||||
|
@ -82,20 +82,20 @@ TEST(ReproducerTest, SetReplay) {
|
||||||
|
|
||||||
// Expected to fail because we can't load the index.
|
// Expected to fail because we can't load the index.
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetReplay(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetReplay(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Failed());
|
Failed());
|
||||||
// However the loader should still be set, which we check here.
|
// However the loader should still be set, which we check here.
|
||||||
EXPECT_NE(nullptr, reproducer.GetLoader());
|
EXPECT_NE(nullptr, reproducer.GetLoader());
|
||||||
|
|
||||||
// Make sure the bogus path is correctly set.
|
// Make sure the bogus path is correctly set.
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
reproducer.GetLoader()->GetRoot());
|
reproducer.GetLoader()->GetRoot());
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
reproducer.GetReproducerPath());
|
reproducer.GetReproducerPath());
|
||||||
|
|
||||||
// Ensure that we cannot enable replay.
|
// Ensure that we cannot enable replay.
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetCapture(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Failed());
|
Failed());
|
||||||
EXPECT_EQ(nullptr, reproducer.GetGenerator());
|
EXPECT_EQ(nullptr, reproducer.GetGenerator());
|
||||||
}
|
}
|
||||||
|
@ -104,13 +104,13 @@ TEST(GeneratorTest, Create) {
|
||||||
DummyReproducer reproducer;
|
DummyReproducer reproducer;
|
||||||
|
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetCapture(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Succeeded());
|
Succeeded());
|
||||||
auto &generator = *reproducer.GetGenerator();
|
auto &generator = *reproducer.GetGenerator();
|
||||||
|
|
||||||
auto *provider = generator.Create<DummyProvider>();
|
auto *provider = generator.Create<DummyProvider>();
|
||||||
EXPECT_NE(nullptr, provider);
|
EXPECT_NE(nullptr, provider);
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
provider->GetRoot());
|
provider->GetRoot());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ TEST(GeneratorTest, Get) {
|
||||||
DummyReproducer reproducer;
|
DummyReproducer reproducer;
|
||||||
|
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetCapture(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Succeeded());
|
Succeeded());
|
||||||
auto &generator = *reproducer.GetGenerator();
|
auto &generator = *reproducer.GetGenerator();
|
||||||
|
|
||||||
|
@ -133,12 +133,12 @@ TEST(GeneratorTest, GetOrCreate) {
|
||||||
DummyReproducer reproducer;
|
DummyReproducer reproducer;
|
||||||
|
|
||||||
EXPECT_THAT_ERROR(
|
EXPECT_THAT_ERROR(
|
||||||
reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
|
reproducer.SetCapture(FileSpec("//bogus/path", FileSpec::Style::posix)),
|
||||||
Succeeded());
|
Succeeded());
|
||||||
auto &generator = *reproducer.GetGenerator();
|
auto &generator = *reproducer.GetGenerator();
|
||||||
|
|
||||||
auto &provider = generator.GetOrCreate<DummyProvider>();
|
auto &provider = generator.GetOrCreate<DummyProvider>();
|
||||||
EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
|
EXPECT_EQ(FileSpec("//bogus/path", FileSpec::Style::posix),
|
||||||
provider.GetRoot());
|
provider.GetRoot());
|
||||||
|
|
||||||
auto &provider_alt = generator.GetOrCreate<DummyProvider>();
|
auto &provider_alt = generator.GetOrCreate<DummyProvider>();
|
||||||
|
|
Loading…
Reference in New Issue