Skip to content

Commit 7c0bfa0

Browse files
committed
Add a Makefile that shows how to automate the tests to run on the simulator and/or device
1 parent 10662ca commit 7c0bfa0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
*.pidb
33
*.userprefs
4+
*.log
45
bin/
56
obj/

Makefile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
MDTOOL=/Applications/MonoDevelop.app/Contents/MacOS/mdtool
2+
MTOUCH=/Developer/MonoTouch/usr/bin/mtouch
3+
TOUCH_SERVER=./Touch.Server/bin/Debug/Touch.Server.exe
4+
5+
all: build-simulator build-device
6+
7+
run run-test: run-simulator run-device
8+
9+
$(TOUCH_SERVER):
10+
cd Touch.Server && xbuild
11+
12+
build-simulator:
13+
$(MDTOOL) -v build -t:Build "-c:Debug|iPhoneSimulator" Touch.Unit.sln
14+
15+
run-simulator: build-simulator Touch.Server
16+
rm -f sim-results.log
17+
mono --debug $(TOUCH_SERVER) --launchsim bin/iPhoneSimulator/Debug/TouchUnit.app -autoexit -logfile=sim-results.log
18+
cat sim-results.log
19+
20+
build-device:
21+
$(MDTOOL) -v build -t:Build "-c:Release|iPhone" Touch.Unit.sln
22+
23+
run-device: build-device
24+
$(MTOUCH) --installdev bin/iPhone/Release/TouchUnit.app
25+
# kill an existing instance (based on the bundle id)
26+
$(MTOUCH) --killdev com.xamarin.touch-unit
27+
rm -f dev-results.log
28+
mono --debug $(TOUCH_SERVER) --launchdev com.xamarin.touch-unit -autoexit -logfile=dev-results.log
29+
cat dev-results.log

0 commit comments

Comments
 (0)