diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
new file mode 100644
index 000000000..4fb21ba27
--- /dev/null
+++ b/tests/AndroidManifest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/build.properties b/tests/build.properties
new file mode 100644
index 000000000..da0e730c5
--- /dev/null
+++ b/tests/build.properties
@@ -0,0 +1,18 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+# 'source.dir' for the location of your java source folder and
+# 'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+# 'key.store' for the location of your keystore and
+# 'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+tested.project.dir=../
diff --git a/tests/build.xml b/tests/build.xml
new file mode 100644
index 000000000..52538703e
--- /dev/null
+++ b/tests/build.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/default.properties b/tests/default.properties
new file mode 100644
index 000000000..4686f7f8d
--- /dev/null
+++ b/tests/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-9
diff --git a/tests/proguard.cfg b/tests/proguard.cfg
new file mode 100644
index 000000000..12dd0392c
--- /dev/null
+++ b/tests/proguard.cfg
@@ -0,0 +1,36 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+ native ;
+}
+
+-keepclasseswithmembernames class * {
+ public (android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembernames class * {
+ public (android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers enum * {
+ public static **[] values();
+ public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+ public static final android.os.Parcelable$Creator *;
+}
diff --git a/tests/src/com/fsck/k9/activity/AccountsTest.java b/tests/src/com/fsck/k9/activity/AccountsTest.java
new file mode 100644
index 000000000..54a5d3670
--- /dev/null
+++ b/tests/src/com/fsck/k9/activity/AccountsTest.java
@@ -0,0 +1,21 @@
+package com.fsck.k9;
+
+import android.test.ActivityInstrumentationTestCase2;
+import com.fsck.k9.activity.Accounts;
+/**
+ * This is a simple framework for a test of an Application. See
+ * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
+ * how to write and extend Application tests.
+ *
+ * To run this test, you can type:
+ * adb shell am instrument -w \
+ * -e class com.fsck.k9.activity.AccountsTest \
+ * com.fsck.k9.tests/android.test.InstrumentationTestRunner
+ */
+public class AccountsTest extends ActivityInstrumentationTestCase2 {
+
+ public AccountsTest() {
+ super("com.fsck.k9", Accounts.class);
+ }
+
+}
diff --git a/test/com/fsck/k9/activity/MessageReferenceTest.java b/tests/src/com/fsck/k9/activity/MessageReferenceTest.java
similarity index 100%
rename from test/com/fsck/k9/activity/MessageReferenceTest.java
rename to tests/src/com/fsck/k9/activity/MessageReferenceTest.java
diff --git a/test/com/fsck/k9/helper/Utility_quoteAtoms.java b/tests/src/com/fsck/k9/helper/Utility_quoteAtoms.java
similarity index 95%
rename from test/com/fsck/k9/helper/Utility_quoteAtoms.java
rename to tests/src/com/fsck/k9/helper/Utility_quoteAtoms.java
index 994362c2d..372c5c0f4 100644
--- a/test/com/fsck/k9/helper/Utility_quoteAtoms.java
+++ b/tests/src/com/fsck/k9/helper/Utility_quoteAtoms.java
@@ -1,62 +1,62 @@
-package com.fsck.k9.helper;
-
-import junit.framework.TestCase;
-
-public class Utility_quoteAtoms extends TestCase
-{
- public void testNoQuote() {
- // Alpha
- noQuote("a");
- noQuote("aa");
- noQuote("aaa aaa");
-
- // Numeric
- noQuote("1");
- noQuote("12");
- noQuote("123 456");
-
- // Alpha Numeric
- noQuote("abc 123");
-
- // Specials
- noQuote("!");
- noQuote("#");
- noQuote("$");
- noQuote("%");
- noQuote("&");
- noQuote("'");
- noQuote("*");
- noQuote("+");
- noQuote("-");
- noQuote("/");
- noQuote("=");
- noQuote("?");
- noQuote("^");
- noQuote("_");
- noQuote("`");
- noQuote("{");
- noQuote("|");
- noQuote("}");
- noQuote("~");
-
- // Combos
- noQuote("bob barker! #1!");
- noQuote("!");
- noQuote("#!");
- noQuote("{|}");
- noQuote("'-=+=-'");
- }
-
- public void testQuote() {
- assertEquals("\"bob s. barker\"", quote("bob s. barker"));
- assertEquals("\":(\"", quote(":("));
- }
-
- private void noQuote(final String s) {
- assertEquals(s, Utility.quoteAtoms(s));
- }
-
- private String quote(final String s) {
- return Utility.quoteAtoms(s);
- }
-}
+package com.fsck.k9.helper;
+
+import junit.framework.TestCase;
+
+public class Utility_quoteAtoms extends TestCase
+{
+ public void testNoQuote() {
+ // Alpha
+ noQuote("a");
+ noQuote("aa");
+ noQuote("aaa aaa");
+
+ // Numeric
+ noQuote("1");
+ noQuote("12");
+ noQuote("123 456");
+
+ // Alpha Numeric
+ noQuote("abc 123");
+
+ // Specials
+ noQuote("!");
+ noQuote("#");
+ noQuote("$");
+ noQuote("%");
+ noQuote("&");
+ noQuote("'");
+ noQuote("*");
+ noQuote("+");
+ noQuote("-");
+ noQuote("/");
+ noQuote("=");
+ noQuote("?");
+ noQuote("^");
+ noQuote("_");
+ noQuote("`");
+ noQuote("{");
+ noQuote("|");
+ noQuote("}");
+ noQuote("~");
+
+ // Combos
+ noQuote("bob barker! #1!");
+ noQuote("!");
+ noQuote("#!");
+ noQuote("{|}");
+ noQuote("'-=+=-'");
+ }
+
+ public void testQuote() {
+ assertEquals("\"bob s. barker\"", quote("bob s. barker"));
+ assertEquals("\":(\"", quote(":("));
+ }
+
+ private void noQuote(final String s) {
+ assertEquals(s, Utility.quoteAtoms(s));
+ }
+
+ private String quote(final String s) {
+ return Utility.quoteAtoms(s);
+ }
+}