submodules: update belle-sip and linphone and fix liblinphone tester

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-28 10:42:58 +02:00
parent 4c315e566c
commit 6ae8d5fbec
5 changed files with 28 additions and 21 deletions

4
.gitignore vendored
View file

@ -38,3 +38,7 @@ tests/*$py.class
tests/build.xml
tests/project.properties
ant_password.properties
liblinphone_tester/liblinphonetester_*
liblinphone_tester/tests.output
tests/linphonetester_*
tests/tests.output

View file

@ -23,9 +23,10 @@ public class LogsActivity extends Activity {
@Override
public void run() {
String path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String res_path = mLogsActivity.getFilesDir().getAbsolutePath()+"/config_files";
String write_path = mLogsActivity.getCacheDir().getPath();
tester = new TesterLogger(mLogsActivity);
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", path}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path}));
list.addAll(Arrays.asList(mArgs));
String[] array = list.toArray(new String[list.size()]);
tester.run(array);
@ -37,7 +38,7 @@ public class LogsActivity extends Activity {
});
}
}
private static String join(String [] array, String separator) {
String ret = "";
for(int i = 0; i < array.length; ++i) {
@ -48,7 +49,7 @@ public class LogsActivity extends Activity {
}
return ret;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -75,7 +76,7 @@ public class LogsActivity extends Activity {
getMenuInflater().inflate(R.menu.activity_logs, menu);
return true;
}
public void addLog(int level, String message) {
mLogs += message;
((TextView)findViewById(R.id.textView1)).append(message);
@ -86,7 +87,7 @@ public class LogsActivity extends Activity {
finish();
}
}
public void done() {
}
}

View file

@ -16,28 +16,28 @@ public class TestUnit extends AndroidTestCase {
private String mSuite;
private String mTest;
static Boolean isAssetCopied=false;
public TestUnit(String suite, String test) {
mSuite = suite;
mTest = test;
setName(suite + "/" + test);
}
public TestUnit(String name) {
String[] tab = name.split("/");
String[] tab = name.split("/");
mSuite = tab[0];
mTest = tab[1];
setName(name);
}
static public void copyAssetsFromPackage(Context ctx) throws IOException {
copyAssetsFromPackage(ctx,"config_files");
}
public static void copyAssetsFromPackage(Context ctx,String fromPath) throws IOException {
new File(ctx.getFilesDir().getPath()+"/"+fromPath).mkdir();
for (String f :ctx.getAssets().list(fromPath)) {
String current_name=fromPath+"/"+f;
InputStream lInputStream;
@ -50,8 +50,8 @@ public class TestUnit extends AndroidTestCase {
continue;
}
FileOutputStream lOutputStream = new FileOutputStream(new File(ctx.getFilesDir().getPath()+"/"+current_name));//ctx.openFileOutput (fromPath+"/"+f, 0);
int readByte;
byte[] buff = new byte[8048];
while (( readByte = lInputStream.read(buff)) != -1) {
@ -75,13 +75,15 @@ public class TestUnit extends AndroidTestCase {
protected void tearDown() throws Exception {
super.tearDown();
}
@Override
protected void runTest() {
String path = getContext().getFilesDir().getPath()+"/config_files";
String res_path = getContext().getFilesDir().getPath()+"/config_files";
String write_path = getContext().getCacheDir().getPath();
Tester tester = new Tester();
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", path, "--suite", mSuite, "--test", mTest}));
List<String> list = new LinkedList<String>(Arrays.asList(new String[]{"tester", "--verbose", "--resource-dir", res_path, "--writable-dir", write_path, "--suite", mSuite, "--test", mTest}));
String[] array = list.toArray(new String[list.size()]);
Assert.assertTrue(tester.run(array) == 0);
}
}
}

@ -1 +1 @@
Subproject commit 07233a793594081d5aafc0c6bb14d389dffbfac0
Subproject commit 6e76dabb7632e0f58e9c43b2cc86ada5f486c761

@ -1 +1 @@
Subproject commit 46547098cc1f24a394d6aa7c4e7823226ecab0fe
Subproject commit 9244a017373d9ddec9170257fec324fb82cb0800