Makefile, tests/bonsai/scrut.mk: cleanup
This commit is contained in:
		
							parent
							
								
									941f931f8b
								
							
						
					
					
						commit
						9b699d7298
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							@ -114,7 +114,7 @@ build/bin/false: src/false.c build
 | 
			
		||||
 | 
			
		||||
.PHONY: fileis
 | 
			
		||||
fileis: build/bin/fileis
 | 
			
		||||
build/bin/fileis: src/fileis.rs build
 | 
			
		||||
build/bin/fileis: src/fileis.rs build rustlibs
 | 
			
		||||
	$(RUSTC) $(RUSTFLAGS) $(RUSTLIBS) -o $@ src/fileis.rs
 | 
			
		||||
 | 
			
		||||
.PHONY: fop
 | 
			
		||||
 | 
			
		||||
@ -8,20 +8,20 @@
 | 
			
		||||
 | 
			
		||||
.PRAGMA: command_comment
 | 
			
		||||
 | 
			
		||||
.PHONY: scrut_tests
 | 
			
		||||
scrut_tests: scrut_help scrut_options
 | 
			
		||||
.PHONY: fileis_tests 
 | 
			
		||||
fileis_tests: fileis_help fileis_options
 | 
			
		||||
 | 
			
		||||
.PHONY: scrut_help
 | 
			
		||||
scrut_help: $(BIN)/scrut
 | 
			
		||||
	! $(BIN)/scrut -h
 | 
			
		||||
.PHONY: fileis_help
 | 
			
		||||
fileis_help: $(BIN)/fileis
 | 
			
		||||
	! $(BIN)/fileis -h
 | 
			
		||||
 | 
			
		||||
.PHONY: scrut_options
 | 
			
		||||
# scrut tests file attributes, but files of a certain attribute aren't
 | 
			
		||||
.PHONY: fileis_options
 | 
			
		||||
# fileis tests file attributes, but files of a certain attribute aren't
 | 
			
		||||
# guaranteed to be present on a system. This test checks all of the files in
 | 
			
		||||
# harakit and, if test(1p) says a file matches a certain attribute, then checks
 | 
			
		||||
# scrut.
 | 
			
		||||
# fileis.
 | 
			
		||||
# opts are space-delimited (for command splitting), sel is not
 | 
			
		||||
scrut_options: $(BIN)/scrut
 | 
			
		||||
fileis_options: $(BIN)/fileis
 | 
			
		||||
	set -e; \
 | 
			
		||||
	opts="b c d e f g k p r s u w x L S"; \
 | 
			
		||||
	sel=; \
 | 
			
		||||
@ -30,12 +30,12 @@ scrut_options: $(BIN)/scrut
 | 
			
		||||
			for opt in $$opts; \
 | 
			
		||||
				do if ! printf "%s\n" $$sel | grep $$opt >/dev/null; then \
 | 
			
		||||
					if test -$$opt "$$f"; then \
 | 
			
		||||
						if ! $(BIN)/scrut -$$opt "$$f"; \
 | 
			
		||||
							then printf "[!!] scrut -%s failed on %s.\n" \
 | 
			
		||||
						if ! $(BIN)/fileis -$$opt "$$f"; \
 | 
			
		||||
							then printf "[!!] fileis -%s failed on %s.\n" \
 | 
			
		||||
								$$opt "$$f"; \
 | 
			
		||||
						fi; \
 | 
			
		||||
						sel="$$sel$$opt"; \
 | 
			
		||||
						printf "[OK] Tested scrut -%s using %s\n" \
 | 
			
		||||
						printf "[OK] Tested fileis -%s using %s\n" \
 | 
			
		||||
							$$opt "$$f"; \
 | 
			
		||||
					fi; \
 | 
			
		||||
				fi; \
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user