Archived
1
0

add test target in main makefile

This commit is contained in:
Jeff Becker 2017-09-24 08:18:56 -04:00
parent dee8c005fd
commit 69fac43124
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
5 changed files with 21 additions and 7 deletions

View File

@ -6,6 +6,8 @@ CONTRIB_JS=$(REPO)/contrib/js/contrib
LOCAL_JS=$(REPO)/contrib/js/nntpchan LOCAL_JS=$(REPO)/contrib/js/nntpchan
VENDOR_JS=$(REPO)/contrib/js/vendor VENDOR_JS=$(REPO)/contrib/js/vendor
SRND_DIR=$(REPO)/contrib/backends/srndv2 SRND_DIR=$(REPO)/contrib/backends/srndv2
NNTPCHAND_DIR=$(REPO)/contrib/backends/nntpchand
NNTPCHAN_DAEMON_DIR=$(REPO)/contrib/backends/nntpchan-daemon
SRND=$(REPO)/srndv2 SRND=$(REPO)/srndv2
GOROOT=$(shell go env GOROOT) GOROOT=$(shell go env GOROOT)
GO=$(GOROOT)/bin/go GO=$(GOROOT)/bin/go
@ -35,6 +37,15 @@ $(SRND):
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR)
cp $(SRND_DIR)/srndv2 $(SRND) cp $(SRND_DIR)/srndv2 $(SRND)
test: test-go test-native
test-go:
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) test
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAND_DIR) test
test-native:
GOROOT=$(GOROOT) $(MAKE) -C $(NNTPCHAN_DAEMON_DIR) test
clean: clean:
rm -f $(SRND) $(JS) rm -f $(SRND) $(JS)
GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) clean GOROOT=$(GOROOT) $(MAKE) -C $(SRND_DIR) clean

View File

@ -42,10 +42,10 @@ $(TOOLS): $(TOOL_SRC)
$(CXX) $(CXXFLAGS) $< $(LIB) $(LD_FLAGS) -o $@ $(CXX) $(CXXFLAGS) $< $(LIB) $(LD_FLAGS) -o $@
build-test: $(LIB) build-test: $(LIB)
$(CXX) -o test $(CXXFLAGS) test.cpp $(LIB) $(LD_FLAGS) $(CXX) -o $(REPO)/test $(CXXFLAGS) test.cpp $(LIB) $(LD_FLAGS)
test: build-test test: build-test
./test $(REPO)/test
%.o: src/%.cpp %.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $(CXX) $(CXXFLAGS) -c -o $@

View File

@ -5,7 +5,10 @@ all: clean build
build: nntpchand build: nntpchand
nntpchand: nntpchand:
GOPATH=$(REPO) go build -v GOROOT=$(GOROOT) GOPATH=$(REPO) go build -v
test:
GOROOT=$(GOROOT) GOPATH=$(REPO) go test ./...
clean: clean:
GOPATH=$(REPO) go clean -v GOPATH=$(REPO) go clean -v

View File

@ -4,10 +4,10 @@ package main
import ( import (
log "github.com/Sirupsen/logrus" log "github.com/Sirupsen/logrus"
"github.com/majestrate/srndv2/lib/config"
"github.com/majestrate/srndv2/lib/nntp"
"github.com/majestrate/srndv2/lib/store"
"net" "net"
"nntpchan/lib/config"
"nntpchan/lib/nntp"
"nntpchan/lib/store"
) )
func main() { func main() {

View File

@ -17,4 +17,4 @@ clean:
GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) clean -v GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) clean -v
test: test:
GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) test -v srnd GOPATH=$(REPO) GOROOT=$(GOROOT) $(GO) test srnd