Commit 33830308 authored by Geoffrey Métais's avatar Geoffrey Métais

Proper unit testing for Android

parent e097d1d5
......@@ -165,6 +165,9 @@ android {
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
sourceSets.test {
java.srcDirs = ['test']
}
sourceSets.tv {
manifest.srcFile 'tv/AndroidManifest.xml'
java.srcDirs = ['tv/src']
......@@ -182,6 +185,7 @@ dependencies {
compile 'com.android.support:cardview-v7:22.1.1'
compile 'com.android.support:recyclerview-v7:22.1.1'
tvCompile 'com.android.support:leanback-v17:22.1.1'
testCompile 'junit:junit:4.12'
}
def buildTime() {
......
package org.videolan.vlc.tests;
import android.annotation.TargetApi;
import android.os.Build;
import android.test.ActivityInstrumentationTestCase2;
import org.videolan.vlc.gui.MainActivity;
import org.videolan.vlc.util.Strings;
/**
* Created by geoffrey on 08/05/15.
*/
public class VLCTests extends ActivityInstrumentationTestCase2<MainActivity>{
// private MainActivity mFirstTestActivity;
//
// @TargetApi(Build.VERSION_CODES.FROYO)
// public VLCTests(Class<MainActivity> activityClass) {
// super(activityClass);
// }
@TargetApi(Build.VERSION_CODES.FROYO)
public VLCTests(){
super(MainActivity.class);
}
package org.videolan.vlc.util;
import static org.junit.Assert.*;
public class StringsTest {
@Override
protected void setUp() throws Exception {
super.setUp();
// mFirstTestActivity = getActivity();
}
public void testGetName(){
String path = "/home/folder/file.txt";
......@@ -56,4 +31,4 @@ public class VLCTests extends ActivityInstrumentationTestCase2<MainActivity>{
result = Strings.getParent("/folder/sub/");
assertEquals("/folder", result);
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment