-
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.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Basic sample for writing C/C++ GTest tests and running them on Android emulators / devices. | ||
|
||
This project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended. | ||
|
||
1. Download the project code, preferably using `git clone`. | ||
2. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file. | ||
3. Check out the relevant code: | ||
* The C++ sources and tests are in `src/main/cpp` | ||
* The device tests (which wrap the native tests) are in `src/androidTest/java` | ||
4. Create and run the Instrumented test configuration | ||
* Open the `AdderTest` file, and click the run icon in the gutter, or | ||
* Manually create a configuration. | ||
* Open *Run* menu | *Edit Configurations* | ||
* Add a new *Android Instrumented Tests* configuration | ||
* Choose the `app` module | ||
* Connect a device or start an emulator | ||
* Run the newly created configuration | ||
|
||
If you are using Android Studio, the *Run* window will show the test results. |