-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BasicNativeAndroidTest: Move gtest to a single flavor
The junit-gtest library will bring native test library and its c++ shared library into the final package. It's not easy to keep these necessary shared libraries into androidTest flavor only. So this CL adds a new flavor called nativeTest to include native test related libraries and run it with androidTest. For normal usage, we can use core flavor, the new default flavor without any native test related libraries. Signed-off-by: utzcoz <[email protected]>
- Loading branch information
Showing
5 changed files
with
59 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...c/androidTest/java/com/example/android/testing/nativesample/DefaultInstrumentationTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.android.testing.nativesample | ||
|
||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
import androidx.test.platform.app.InstrumentationRegistry | ||
import com.google.common.truth.Truth.assertThat | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
@RunWith(AndroidJUnit4::class) | ||
class DefaultInstrumentationTest { | ||
@Test | ||
fun useAppContext() { | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertThat(appContext.packageName).isEqualTo("com.example.android.testing.nativesample") | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters