Merge remote-tracking branch 'origin/bellesip' into bellesip
Conflicts: liblinphone_tester/.classpath
This commit is contained in:
commit
f9f8693113
13 changed files with 229 additions and 7 deletions
2
Makefile
2
Makefile
|
@ -128,7 +128,7 @@ update-project:
|
|||
$(SDK_PATH)/android update project --path . --target $(ANDROID_MOST_RECENT_TARGET)
|
||||
|
||||
liblinphone_tester: prepare-sources prepare-cunit prepare-liblinphone_tester
|
||||
$(NDK_PATH)/ndk-build -C liblinphone_tester NDK_DEBUG=1 $(LIBLINPHONE_OPTIONS) -j$(NUMCPUS)
|
||||
$(NDK_PATH)/ndk-build -C liblinphone_tester $(LIBLINPHONE_OPTIONS) NDK_DEBUG=1 -j$(NUMCPUS)
|
||||
|
||||
generate-apk:
|
||||
ant partial-clean
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="src" path="mediastreamer2"/>
|
||||
<classpathentry kind="lib" path="/Users/jehanmonnier/workspaces/workspace-android/linphone-android-private/libs/android-support-v4.jar"/>
|
||||
<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<link>
|
||||
<name>mediastreamer2</name>
|
||||
<type>2</type>
|
||||
<location>/Users/ydiorcet/Desktop/linphone-android/submodules/linphone/mediastreamer2/java/src</location>
|
||||
<locationURI>PARENT-1-PROJECT_LOCATION/submodules/linphone/mediastreamer2/java/src</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
|
|
@ -8,7 +8,12 @@
|
|||
android:minSdkVersion="8"
|
||||
android:targetSdkVersion="17" />
|
||||
|
||||
<instrumentation
|
||||
android:targetPackage="org.linphone.tester"
|
||||
android:name="org.linphone.tester.TestRunner" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
|
||||
|
@ -41,6 +46,8 @@
|
|||
android:screenOrientation="nosensor"
|
||||
android:launchMode="singleTask">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
<uses-library android:name="android.test.runner" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
92
liblinphone_tester/build.xml
Normal file
92
liblinphone_tester/build.xml
Normal file
|
@ -0,0 +1,92 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="liblinphone_tester" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="${sdk.dir}/tools/ant/build.xml" />
|
||||
|
||||
</project>
|
26
liblinphone_tester/custom_rules.xml
Normal file
26
liblinphone_tester/custom_rules.xml
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="custom_rules">
|
||||
<target name="run">
|
||||
<exec executable="adb">
|
||||
<arg value="shell" />
|
||||
<arg value="am" />
|
||||
<arg value="start" />
|
||||
<arg value="-a" />
|
||||
<arg value="android.intent.action.MAIN" />
|
||||
<arg value="-n" />
|
||||
<arg value="org.linphone.tester/org.linphone.tester.MainActivity" />
|
||||
</exec>
|
||||
</target>
|
||||
<target name="test">
|
||||
<exec executable="adb">
|
||||
<arg value="shell" />
|
||||
<arg value="am" />
|
||||
<arg value="instrument" />
|
||||
<arg value="-e" />
|
||||
<arg value="suite" />
|
||||
<arg value="Setup" />
|
||||
<arg value="-w" />
|
||||
<arg value="org.linphone.tester/org.linphone.tester.TestRunner" />
|
||||
</exec>
|
||||
</target>
|
||||
</project>
|
|
@ -37,6 +37,17 @@ public class LogsActivity extends Activity {
|
|||
}
|
||||
}
|
||||
|
||||
private static String join(String [] array, String separator) {
|
||||
String ret = "";
|
||||
for(int i = 0; i < array.length; ++i) {
|
||||
if(i != 0) {
|
||||
ret += separator;
|
||||
}
|
||||
ret += array[i];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -47,6 +58,7 @@ public class LogsActivity extends Activity {
|
|||
String[] values = extras.getStringArray("args");
|
||||
if(values != null) {
|
||||
if(mLogsThread == null || !mLogsThread.isAlive()) {
|
||||
this.setTitle("Test Logs (" + join(values, " ") + ")");
|
||||
mLogs = "";
|
||||
((TextView)findViewById(R.id.textView1)).setText(mLogs);
|
||||
mLogsThread = new LogsThread(this, values);
|
||||
|
|
|
@ -13,7 +13,6 @@ import android.view.Menu;
|
|||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.LinearLayout.LayoutParams;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ public class SuitesActivity extends Activity {
|
|||
if (extras != null) {
|
||||
mSuite = extras.getString("suite");
|
||||
if(mSuite != null) {
|
||||
this.setTitle(this.getResources().getString(R.string.app_name) + " | " + mSuite);
|
||||
TesterList suitesTest = new TesterList();
|
||||
suitesTest.run(new String[]{"tester", "--list-tests", mSuite});
|
||||
LinearLayout layout = ((LinearLayout)findViewById(R.id.tests_list));
|
||||
|
|
47
liblinphone_tester/src/org/linphone/tester/TestRunner.java
Normal file
47
liblinphone_tester/src/org/linphone/tester/TestRunner.java
Normal file
|
@ -0,0 +1,47 @@
|
|||
package org.linphone.tester;
|
||||
|
||||
import junit.framework.TestSuite;
|
||||
import android.os.Bundle;
|
||||
import android.test.InstrumentationTestRunner;
|
||||
|
||||
|
||||
public class TestRunner extends InstrumentationTestRunner {
|
||||
String mSuite = null;
|
||||
String mTest = null;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle arguments) {
|
||||
mSuite = arguments.getString("suite");
|
||||
mTest = arguments.getString("test");
|
||||
super.onCreate(arguments);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TestSuite getAllTests () {
|
||||
TestSuite suite = new TestSuite("Tests");
|
||||
addSuites(suite, mSuite, mTest);
|
||||
return suite;
|
||||
}
|
||||
|
||||
|
||||
public static void addSuites(TestSuite suite, String suiteCheck, String testCheck) {
|
||||
TesterList testerList = new TesterList();
|
||||
testerList.run(new String[]{"tester", "--list-suites"});
|
||||
for(String str: testerList.getList()) {
|
||||
str = str.trim();
|
||||
if(suiteCheck == null || suiteCheck.equals(str)) {
|
||||
addSuite(suite, str, testCheck);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void addSuite(TestSuite suite, String suiteStr, String testCheck) {
|
||||
TesterList testerList = new TesterList();
|
||||
testerList.run(new String[]{"tester", "--list-tests", suiteStr});
|
||||
for(String str: testerList.getList()) {
|
||||
str = str.trim();
|
||||
if(testCheck == null || testCheck.equals(str)) {
|
||||
suite.addTest(new TestUnit(suiteStr, str));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
38
liblinphone_tester/src/org/linphone/tester/TestUnit.java
Normal file
38
liblinphone_tester/src/org/linphone/tester/TestUnit.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package org.linphone.tester;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
public class TestUnit extends AndroidTestCase {
|
||||
private String mSuite;
|
||||
private String mTest;
|
||||
|
||||
public TestUnit(String suite, String test) {
|
||||
mSuite = suite;
|
||||
mTest = test;
|
||||
setName(suite + "/" + test);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void runTest() {
|
||||
String path = getContext().getFilesDir().getAbsolutePath();
|
||||
Tester tester = new Tester();
|
||||
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--config", path, "--suite", mSuite, "--test", mTest}));
|
||||
String[] array = list.toArray(new String[list.size()]);
|
||||
Assert.assertTrue(tester.run(array) == 0);
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
Subproject commit 8d9cb2fd7d171fcea0b537af44d4e8449b66aa23
|
||||
Subproject commit 10a18463d51c68e436267fe6154f1216b0351918
|
Loading…
Reference in a new issue