Permalink
Browse files

testing and buiding finally actually working...along with creating/im…

…porting subpackages
  • Loading branch information...
1 parent a1050bb commit 5b370f6206f64d782cae052706638d3d26e1d371 @Inspiravetion committed Feb 26, 2014
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,9 @@
+package main
+
+import (
+ "rrg/server"
+)
+
+func main() {
+ server.Start()
+}
View
@@ -1,8 +1,13 @@
+TEST_DIRS = $(wildcard ./src/rrg/*)
+
all:
- go build ./src/RRG/Server.go
+ go build ./Server.go
+
+everything:
+ go build -a ./Server.go
linux:
- GOOS="linux" GOARCH="amd64" go build -o prod/Server-linux-amd64 ./src/RRG/Server.go
+ GOOS="linux" GOARCH="amd64" go build -o prod/Server-linux-amd64 ./Server.go
test:
- cd ./src/RRG; GOPATH=$(shell python -c "import os,sys; print os.path.realpath(sys.argv[1])" $PWD/..); ../../bin/goconvey
+ go test -v $(TEST_DIRS)
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
@@ -1,10 +1,11 @@
-package main
+package server
import (
"github.com/codegangsta/martini"
)
-func main() {
+func Start() {
+
m := martini.Classic()
m.Get("/", func() string {
@@ -20,4 +21,5 @@ func main() {
})
m.Run()
+
}
@@ -0,0 +1,23 @@
+package server_test
+
+import (
+ . "github.com/smartystreets/goconvey/convey"
+ "testing"
+)
+
+func TestSpec(t *testing.T) {
+ var x int
+
+ // Only pass t into top-level Convey calls
+ Convey("Given some integer with a starting value", t, func() {
+ x = 1
+
+ Convey("When the integer is incremented", func() {
+ x++
+
+ Convey("The value should be greater by one", func() {
+ So(x, ShouldEqual, 2)
+ })
+ })
+ })
+}
Binary file not shown.
Binary file not shown.

0 comments on commit 5b370f6

Please sign in to comment.