Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Commit

Permalink
Setup for instrumentation testing
Browse files Browse the repository at this point in the history
Currently contains one stub test, just so that
we have something which runs for setting up
CI.
  • Loading branch information
Chris Banes committed Dec 19, 2017
1 parent 170785a commit 9236b92
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ android {

defaultConfig {
minSdkVersion 14
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
}

Expand All @@ -42,6 +43,11 @@ dependencies {
testImplementation 'org.robolectric:robolectric:3.5.1'
testImplementation 'com.google.truth:truth:0.37'

androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.1", {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'com.android.support.test:runner:1.0.1'

ktlint 'com.github.shyiko:ktlint:0.14.0'
}

Expand Down
6 changes: 6 additions & 0 deletions src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.kotlin">
<application>
<activity android:name=".KotlinTestActivity"/>
</application>
</manifest>
21 changes: 21 additions & 0 deletions src/androidTest/java/androidx/kotlin/KotlinTestActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package androidx.kotlin

import android.app.Activity

class KotlinTestActivity : Activity()
37 changes: 37 additions & 0 deletions src/androidTest/java/androidx/transition/ExampleTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package androidx.transition

import android.support.test.filters.LargeTest
import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import androidx.kotlin.KotlinTestActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@LargeTest
@RunWith(AndroidJUnit4::class)
class ExampleTest {

@Rule @JvmField val activityRule = ActivityTestRule(KotlinTestActivity::class.java)

@Test
fun testNothing() {
// Do nothing
}
}

0 comments on commit 9236b92

Please sign in to comment.