Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9ec7d26 authored by Paul Duffin's avatar Paul Duffin
Browse files

Convert android/ninja_deps_test.go to test fixtures

Bug: 182885307
Test: m nothing
Change-Id: Iccba8caffc7e5a82ff13d93a032edcf3f748fc40
parent 78c36216
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -53,23 +53,20 @@ func (testNinjaDepsSingleton) GenerateBuildActions(ctx SingletonContext) {
}

func TestNinjaDeps(t *testing.T) {
	fs := map[string][]byte{
	fs := MockFS{
		"test_ninja_deps/exists": nil,
	}
	config := TestConfig(buildDir, nil, "", fs)

	ctx := NewTestContext(config)
	result := emptyTestFixtureFactory.RunTest(t,
		FixtureRegisterWithContext(func(ctx RegistrationContext) {
			ctx.RegisterSingletonType("test_ninja_deps_singleton", testNinjaDepsSingletonFactory)
			ctx.RegisterSingletonType("ninja_deps_singleton", ninjaDepsSingletonFactory)
	ctx.Register()

	_, errs := ctx.ParseFileList(".", []string{"Android.bp"})
	FailIfErrored(t, errs)
	ninjaDeps, errs := ctx.PrepareBuildActions(config)
	FailIfErrored(t, errs)
		}),
		fs.AddToFixture(),
	)

	// Verify that the ninja file has a dependency on the test_ninja_deps directory.
	if g, w := ninjaDeps, "test_ninja_deps"; !InList(w, g) {
	if g, w := result.NinjaDeps, "test_ninja_deps"; !InList(w, g) {
		t.Errorf("expected %q in %q", w, g)
	}
}