[Lunar-commits] <lconnman> lconnman: add test

Samuel Verstraete samuel.verstraete at gmail.com
Sun Oct 16 23:28:10 CEST 2011


commit 9d766826c2b0a3eec63661ee18356af0cb15e4f6
Author: Samuel Verstraete <samuel.verstraete at gmail.com>
Date:   Sun Oct 16 23:28:10 2011 +0200

    lconnman: add test
---
 src/Makefile      |    7 +++++++
 src/lconnman.vala |    4 ++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index 419a747..629befa 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,5 @@
 VALAFILES=service.vala connmanmanager.vala lconnman.vala
+TESTVALAFILES=service.vala connmanmanager.vala test.vala gui/curseslist.vala gui/enums.vala
 VALAFILES+=gui/curseslist.vala gui/enums.vala
 #PFX=/home/pancake/prg/racu/tmp
 #CFLAGS=-I${PFX}/include/ncurses
@@ -9,10 +10,14 @@ VALAPKGS=--vapidir .
 VALAPKGS+=--pkg curses --pkg gio-2.0
 
 BIN=lconnman
+TESTBIN=test
 
 all:
 	valac -g -o ${BIN} ${VALAFILES} ${VALAPKGS} -X -lncurses
 
+test:
+	valac -g -o ${TESTBIN} ${TESTVALAFILES} ${VALAPKGS} -X -lncurses
+
 vapi:
 	valac --vapi lconnman.vapi --library=lconnman ${VALAFILES} ${VALAPKGS} -X -lncurses
 
@@ -25,3 +30,5 @@ allc:
 
 clean:
 	rm -f w/*.c *.c main a.out ${BIN}
+
+
diff --git a/src/lconnman.vala b/src/lconnman.vala
index d822eff..1a7aeb0 100644
--- a/src/lconnman.vala
+++ b/src/lconnman.vala
@@ -15,7 +15,10 @@ int main() {
   //enable up and down keys
   d.keypad(true);
   string[] services =  get_r_services();
+
+
   CursesList cw = new CursesList(services, Orientation.Vertical, Alignment.Top, COLS, LINES - 4);
+  services = get_r_services();
   string[] buttons = new string[4];
   buttons[0] = "configure";
   buttons[1] = "connect";
@@ -23,6 +26,7 @@ int main() {
   buttons[3] = "exit";
   CursesList buttonBox = new CursesList(buttons, Orientation.Horizontal, Alignment.Bottom, COLS, 5);
 
+
   string action = "";
   int c;
   while(action != "quit" && action != "exit"){


More information about the Lunar-commits mailing list