aconfig: restructure integration tests

Consolidate integration tests under tests/. Rename build targets to
follow the same pattern.

The important aconfig build targets are:

  - aconfig           : the aconfig binary
  - aconfig.test      : the aconfig unit tests
  - aconfig.test.java : the Java integration tests
  - aconfig.test.cpp  : the C++ integration tests
  - aconfig.test.rust : the Rust integration tests (not implemented yet)

Note: the Rust integration tests are blocked until the build system has
added support for aconfig Rust libraries.

Note: the flags used in the integration are not set correctly. A
follow-up CL will fix this.

Bug: 283911467
Test: atest aconfig.test.java aconfig.test.cpp
Change-Id: Idb8dad4c38a49231c2e89228775bacf065ee1f57
This commit is contained in:
Mårten Kongstad
2023-07-24 11:10:00 +02:00
parent 289fdf213a
commit af3da9d1be
5 changed files with 78 additions and 42 deletions

View File

@@ -1,7 +1,12 @@
import static com.android.aconfig.test.Flags.FLAG_DISABLED_RO;
import static com.android.aconfig.test.Flags.FLAG_DISABLED_RW;
import static com.android.aconfig.test.Flags.FLAG_ENABLED_RO;
import static com.android.aconfig.test.Flags.FLAG_ENABLED_RW;
import static com.android.aconfig.test.Flags.disabledRo;
import static com.android.aconfig.test.Flags.disabledRw;
import static com.android.aconfig.test.Flags.enabledRo;
import static com.android.aconfig.test.Flags.enabledRw;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@@ -13,11 +18,13 @@ import org.junit.runners.JUnit4;
public final class AconfigTest {
@Test
public void testDisabledReadOnlyFlag() {
assertEquals("com.android.aconfig.test.disabled_ro", FLAG_DISABLED_RO);
assertFalse(disabledRo());
}
@Test
public void testEnabledReadOnlyFlag() {
assertEquals("com.android.aconfig.test.disabled_rw", FLAG_DISABLED_RW);
// TODO: change to assertTrue(enabledRo()) when the build supports reading tests/*.values
// (currently all flags are assigned the default READ_ONLY + DISABLED)
assertFalse(enabledRo());
@@ -25,11 +32,13 @@ public final class AconfigTest {
@Test
public void testDisabledReadWriteFlag() {
assertEquals("com.android.aconfig.test.enabled_ro", FLAG_ENABLED_RO);
assertFalse(disabledRw());
}
@Test
public void testEnabledReadWriteFlag() {
assertEquals("com.android.aconfig.test.enabled_rw", FLAG_ENABLED_RW);
// TODO: change to assertTrue(enabledRw()) when the build supports reading tests/*.values
// (currently all flags are assigned the default READ_ONLY + DISABLED)
assertFalse(enabledRw());