소스 검색

add test for return code passthrough

Jan Klemkow 6 년 전
부모
커밋
68aff5cc7e
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      Makefile

+ 6 - 1
Makefile

@@ -2,8 +2,13 @@ CFLAGS += -std=c99 -pedantic -Wall -Wextra
 LDLIBS += -lutil
 CPPFLAGS += -D_DEFAULT_SOURCE
 
-.PHONY: all clean
+.PHONY: all clean test
 
 all: scroll
 clean:
 	rm -f scroll
+
+test: scroll
+	# return code passthrough of childs
+	./scroll /usr/bin/true  && if [ $$? -ne 0 ]; then exit 1; fi
+	./scroll /usr/bin/false || if [ $$? -ne 1 ]; then exit 1; fi