Allow namespace config to be tested properly

Previously, the NewTextContext created a context that always called
NewNameResolver with a export filter that always returned true.

This change fixes that by:
1. Changing NewNameResolver to take a Config parameter instead of a
   filter parameter and pushing the code to create the filter from the
   Config from newNameResolver() in cmd/soong_build/main.go into the
   NewNameResolver function.

2. Extracting a newTestContextForFixture that does not create a
   NameResolver or set it on the context. That avoids creating a
   NameResolver before the test has prepared the config.

3. Modify the fixture to create and set the NameResolver in the Context
   after the config has been prepared by the test.

4. Added test to verify that it all works.

Bug: 234825639
Test: m nothing
Change-Id: Ie4b13f18093dc01a0ab65a9ecfd143585d843b55
diff --git a/android/fixture.go b/android/fixture.go
index f33e718..3f01f5a 100644
--- a/android/fixture.go
+++ b/android/fixture.go
@@ -658,7 +658,7 @@
 
 func createFixture(t *testing.T, buildDir string, preparers []*simpleFixturePreparer) Fixture {
 	config := TestConfig(buildDir, nil, "", nil)
-	ctx := NewTestContext(config)
+	ctx := newTestContextForFixture(config)
 	fixture := &fixture{
 		preparers: preparers,
 		t:         t,
@@ -790,6 +790,16 @@
 		}
 	}
 
+	// Create and set the Context's NameInterface. It needs to be created here as it depends on the
+	// configuration that has been prepared for this fixture.
+	resolver := NewNameResolver(ctx.config)
+
+	// Set the NameInterface in the main Context.
+	ctx.SetNameInterface(resolver)
+
+	// Set the NameResolver in the TestContext.
+	ctx.NameResolver = resolver
+
 	ctx.Register()
 	var ninjaDeps []string
 	extraNinjaDeps, errs := ctx.ParseBlueprintsFiles("ignored")