필자는 쓰기 파일을 잘 작성하지 않았습니다. 하지만 GNUMAKE 기반 테스트 하네스를 작성할 필요가 있습니다. 나는 약간의 연구를했지만 유용한 것을 찾을 수 없었다. 그래서 어디서부터 시작해야할지 모르겠습니다.GNUMAKE 기반 testharness 작성하는 방법
다음TEST_SUITE_DIR:=testSuite
#Get all test names with path & extention
TEST_SCRIPTS_WITH_PATH:=$(wildcard $(TEST_SUITE_DIR)/*.txt)
#Test name with out path and extention
TEST_SCRIPT_NAME:=$(notdir $(patsubst %.txt,%,$(TEST_SCRIPTS_WITH_PATH)))
vpath %.txt $(TEST_SUITE_DIR)
TEST_LOG_FILE:=$(TEST_SCRIPT_NAME)OutPutFile.txt
#This is the program ./bin/programName being tested
PUT:=man
#Test requrements:
#1) Each test in /testSuite dir should have its own logFile
#2) Each testout will be checked against a goldenout file in /goldenOutput dir to see
# if the expected resuls match with the test output
# #3) If the test & golden output file hasnt been modified, we do not want to run that test so
# we can save time
# #4) STDERR should be redirected to a stderr.log
#5) During the regression, if a test failed, test name should be written into the regressionReport.log
.PHONY: clean test
test:
for i in $(TEST_SCRIPTS_WITH_PATH); do \
echo $$i; \
$(PUT) `head -n 1 $$i` > $$iOutPutFile.txt; \
done
#$(foreach i, $(TEST_SCRIPTS_WITH_PATH), $(PUT) `head -n 1 $($i)` > $($i)OutPutFile.txt)
#$(PUT) `head -n 1 $(TEST_SCRIPTS) ` > $(TEST_SCRIPTS)logFile.log
clean:
rm -f *.d $(OBJ_DIR)/*.o $(PROG)
-include *.d
는, 나는 당신이 뭘 하려는지 이해가 확실하지 않다
date
1 회의 테스트를 수행했습니다. 하나 이상의 시험에 이것을 어떻게 사용합니까? 내 회귀가 내가 원하는 방식대로 작동하려면 몇 가지 요구 사항을 더 추가해야했습니다. 어떤 도움이라도 대단히 감사하겠습니다. 당신이 말할 수 있듯이, 저는 C, C++ 프로그래머입니다. 이것은 나에게 그리스어 같다. – usustarr