From d6f4135d6e7450a2001688da6d1915e60e9b2bf6 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 28 Dec 2016 15:58:44 +0100 Subject: [PATCH 1/2] travis --- .idea/misc.xml | 2 +- .travis.yml | 18 +++++++++++++ app/build.gradle | 2 +- .../test/info/nightscout/utils/RoundTest.java | 27 +++++++++++++++++++ wear/build.gradle | 2 +- wear/wear.iml | 16 +++++------ 6 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 .travis.yml create mode 100644 app/src/test/info/nightscout/utils/RoundTest.java diff --git a/.idea/misc.xml b/.idea/misc.xml index fbb68289f4..5d19981032 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..8429db4b11 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: android +jdk: oraclejdk8 +env: + matrix: + - ANDROID_TARGET=android-23 ANDROID_ABI=x86 +android: + components: + - platform-tools + - tools + - build-tools-25.0.2 + - android-23 + - extra-google-m2repository + - extra-android-m2repository + - extra-google-google_play_services + +script: + # Unit Test + - ./gradlew test \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 21b5236a26..aee236a796 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -37,7 +37,7 @@ def generateGitBuild = { -> android { compileSdkVersion 23 - buildToolsVersion "23.0.3" + buildToolsVersion "25.0.2" defaultConfig { applicationId "info.nightscout.androidaps" diff --git a/app/src/test/info/nightscout/utils/RoundTest.java b/app/src/test/info/nightscout/utils/RoundTest.java new file mode 100644 index 0000000000..91bce62014 --- /dev/null +++ b/app/src/test/info/nightscout/utils/RoundTest.java @@ -0,0 +1,27 @@ +package info.nightscout.utils; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class RoundTest { + + @Test + public void roundTo() { + assertEquals( 0.55d, Round.roundTo(0.54d, 0.05d), 0.00000001d ); + assertEquals( 1d, Round.roundTo(1.49d, 1d), 0.00000001d ); + } + + @Test + public void floorTo() { + assertEquals( 0.5d, Round.floorTo(0.54d, 0.05d), 0.00000001d ); + assertEquals( 1d, Round.floorTo(1.59d, 1d), 0.00000001d ); + } + + @Test + public void ceilTo() { + assertEquals( 0.6d, Round.ceilTo(0.54d, 0.1d), 0.00000001d ); + assertEquals( 2d, Round.ceilTo(1.49999d, 1d), 0.00000001d ); + } + +} \ No newline at end of file diff --git a/wear/build.gradle b/wear/build.gradle index 3906ab934a..97fb7b78c0 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.android.application' android { compileSdkVersion 23 - buildToolsVersion "23.0.3" + buildToolsVersion "25.0.2" defaultConfig { applicationId "info.nightscout.androidaps" diff --git a/wear/wear.iml b/wear/wear.iml index 008bad09ce..3128c10a22 100644 --- a/wear/wear.iml +++ b/wear/wear.iml @@ -106,14 +106,6 @@ - - - - - - - - @@ -122,6 +114,14 @@ + + + + + + + + From de4021ca3d6a0565934c38d097277f3fa2f1c5d3 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 28 Dec 2016 16:10:06 +0100 Subject: [PATCH 2/2] permission access for travis --- gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755