test exec: waiting exit event after exec cmd
[src/xds/xds-server.git] / Makefile
index 07357f3..f7f7a9a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -120,7 +120,11 @@ xds: scripts tools/syncthing/copytobin
        @cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/$(TARGET)$(EXT) -ldflags "$(GO_LDFLAGS) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" -gcflags "$(GO_GCFLAGS)" .
 
 test: tools/glide
-       go test --race $(shell $(LOCAL_TOOLSDIR)/glide novendor)
+ifndef name
+       go test --race ./test -v
+else
+       go test --race ./test -v -run $(name)
+endif
 
 vet: tools/glide
        go vet $(shell $(LOCAL_TOOLSDIR)/glide novendor)
@@ -149,7 +153,7 @@ webapp: webapp/install
 
 webapp/install:
        (cd webapp && npm install)
-       @if [ -d ${DESTDIR}/usr ]; then rmdir ${DESTDIR}/usr; fi
+       @[ -d ${DESTDIR}/usr ] && { echo "Removing unwanted ${DESTDIR}/usr directory"; rm -rf ${DESTDIR}/usr; } || true
 
 .PHONY: scripts
 scripts:
@@ -163,9 +167,9 @@ conffile:
 
 .PHONY: install
 install:
-       @test -e $(LOCAL_BINDIR)/xds-server$(EXT) -a -d webapp/dist || { echo "Please execute first: make all\n"; exit 1; }
-       @test -d $(LOCAL_BINDIR)/xds-utils || { echo "Please execute first: make all\n"; exit 1; }
-       @test -e $(LOCAL_BINDIR)/syncthing$(EXT) -a -e $(LOCAL_BINDIR)/syncthing-inotify$(EXT) || { echo "Please execute first: make all\n"; exit 1; }
+       @test -e $(LOCAL_BINDIR)/xds-server$(EXT) -a -d webapp/dist || { echo "Please execute first: make all"; exit 1; }
+       @test -d $(LOCAL_BINDIR)/xds-utils || { echo "Please execute first: make all"; exit 1; }
+       @test -e $(LOCAL_BINDIR)/syncthing$(EXT) -a -e $(LOCAL_BINDIR)/syncthing-inotify$(EXT) || { echo "Please execute first: make all"; exit 1; }
        mkdir -p $(DESTDIR) \
                && cp -a $(LOCAL_BINDIR)/* $(DESTDIR)
        mkdir -p $(DESTDIR_WWW) \