Compare commits
	
		
			3 commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fba5551bb3 | |||
| 85671a076c | |||
| da35bf4bcf | 
					 2 changed files with 11 additions and 4 deletions
				
			
		
							
								
								
									
										13
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -3,6 +3,12 @@ OUT=my-log
 | 
				
			||||||
GOBIN=$(shell go env GOBIN)
 | 
					GOBIN=$(shell go env GOBIN)
 | 
				
			||||||
COVEROUT=cover.out
 | 
					COVEROUT=cover.out
 | 
				
			||||||
COVERHTML=cover.html
 | 
					COVERHTML=cover.html
 | 
				
			||||||
 | 
					OPEN=xdg-open
 | 
				
			||||||
 | 
					OS=$(shell uname -s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(OS),Darwin)
 | 
				
			||||||
 | 
					OPEN=open
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: help
 | 
					.PHONY: help
 | 
				
			||||||
help: ## Show help for documented recipes
 | 
					help: ## Show help for documented recipes
 | 
				
			||||||
| 
						 | 
					@ -23,7 +29,8 @@ test: ## Test application and generate coverage report
 | 
				
			||||||
	$(MAKE) clean
 | 
						$(MAKE) clean
 | 
				
			||||||
	$(MAKE) $(COVEROUT)
 | 
						$(MAKE) $(COVEROUT)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(COVEROUT): $(SOURCES) fmt
 | 
					$(COVEROUT): $(SOURCES)
 | 
				
			||||||
 | 
						$(MAKE) fmt
 | 
				
			||||||
	go test ./... -race -cover -coverprofile $@
 | 
						go test ./... -race -cover -coverprofile $@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$(COVERHTML): $(COVEROUT)
 | 
					$(COVERHTML): $(COVEROUT)
 | 
				
			||||||
| 
						 | 
					@ -33,8 +40,8 @@ $(COVERHTML): $(COVEROUT)
 | 
				
			||||||
report: $(COVERHTML) ## Generate a coverage report
 | 
					report: $(COVERHTML) ## Generate a coverage report
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: open-report
 | 
					.PHONY: open-report
 | 
				
			||||||
open-report: report ## Open the coverage report in the default browser
 | 
					open-report: $(COVERHTML) ## Open the coverage report in the default browser
 | 
				
			||||||
	xdg-open $(COVERHTML)
 | 
						$(OPEN) $<
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.PHONY: build
 | 
					.PHONY: build
 | 
				
			||||||
build: $(OUT) ## Builds the application
 | 
					build: $(OUT) ## Builds the application
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -211,7 +211,7 @@ func (s *AppendTestSuite) TestConfLoadErr() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (s *AppendTestSuite) TestMkdirErr() {
 | 
					func (s *AppendTestSuite) TestMkdirErr() {
 | 
				
			||||||
	// Don't run this test as root
 | 
						// Don't run this test as root
 | 
				
			||||||
	config.Overrides["input.path"] = "/root/my-logs-test"
 | 
						config.Overrides["input.path"] = "/var/my-logs-test"
 | 
				
			||||||
	defer func(path string) {
 | 
						defer func(path string) {
 | 
				
			||||||
		config.Overrides["input.path"] = path
 | 
							config.Overrides["input.path"] = path
 | 
				
			||||||
	}(s.dir)
 | 
						}(s.dir)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue