Created
June 28, 2011 18:37
-
-
Save 8th-Light-Blog/1051833 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blog Title: Up and running with TDD on Android (Part 2) | |
Author: Colin Jones | |
Date: July 11th, 2009 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd .. | |
$ ant debug && adb install -r bin/TicTacToe-debug.apk | |
$ cd tests | |
$ ant debug && adb install -r bin/TicTacToe-debug.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ adb shell am instrument -w com.colinwjones.tests/android.test.InstrumentationTestRunner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
com.colinwjones.TicTacToeTest: | |
Failure in testNewGameButtonExists: | |
junit.framework.AssertionFailedError: expected:<new game> but was:<> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Button android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:id="@+id/new_button" | |
android:text="New Game" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd .. | |
$ ant debug && adb install -r bin/TicTacToe-debug.apk | |
$ cd tests | |
$ ant debug && adb install -r bin/TicTacToe-debug.apk | |
$ adb shell am instrument -w com.colinwjones.tests/android.test.InstrumentationTestRunner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test results for InstrumentationTestRunner=.. | |
Time: 1.009 | |
OK (2 tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="clean"> | |
<delete includeemptydirs="true"> | |
<fileset dir="bin" includes="**/*" /> | |
<fileset dir="tests/bin" includes="**/*" /> | |
</delete> | |
</target> | |
<target depends="clean, debug" name="test"> | |
<property environment="env" /> | |
<property name="android-tools" value="${env.ANDROID_TOOLS}" /> | |
<ant dir="tests" antfile="build.xml" inheritall="false" target="debug" /> | |
<exec executable="${android-tools}/adb" failonerror="true"> | |
<arg line="install -r bin/TicTacToe-debug.apk" /> | |
</exec> | |
<exec executable="${android-tools}/adb" failonerror="true"> | |
<arg line="install -r tests/bin/TicTacToe-debug.apk" /> | |
</exec> | |
<exec executable="${android-tools}/adb"> | |
<arg line="shell am instrument" /> | |
<arg value="-w" /> | |
<arg line="com.colinwjones.tests/android.test.InstrumentationTestRunner" /> | |
</exec> | |
</target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ant test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment