Commit 2afeb1ee authored by dougliu's avatar dougliu
Browse files

Add functionality to put test files in a separate directory

parent f5b8b4ee
......@@ -26,6 +26,9 @@ IDENTIFIER = EEC50281EEC50281EEC50281EEC50281EEC50281
# Change EXECUTABLE to match the command name given in the project spec.
EXECUTABLE = executable
# Change TEST_DIR to match the directory for storing test cases.
TEST_DIR = .
# The following line looks for a project's main() in files named project*.cpp,
# executable.cpp (substituted from EXECUTABLE above), or main.cpp
PROJECTFILE = $(or $(wildcard project*.cpp $(EXECUTABLE).cpp), main.cpp)
......@@ -63,6 +66,7 @@ OBJECTS = $(SOURCES:%.cpp=%.o)
# name of the tarball created for submission
PARTIAL_SUBMITFILE = partialsubmit.tar.gz
FULL_SUBMITFILE = fullsubmit.tar.gz
FULL_SUBMITFILE_UNCOMP = fullsubmit.tar
# name of the perf data file, only used by the clean target
PERF_FILE = perf.data*
......@@ -154,11 +158,15 @@ $(PARTIAL_SUBMITFILE): $(PARTIAL_SUBMITFILES)
# make fullsubmit.tar.gz - cleans, runs dos2unix, creates tarball
# including test files
FULL_SUBMITFILES=$(filter-out $(TESTSOURCES), \
$(wildcard Makefile *.h *.hpp *.cpp test*.txt))
TEST_FILES=$(wildcard $(TEST_DIR)/test*.txt)
FULL_SUBMITFILES=$(PARTIAL_SUBMITFILES) $(TEST_FILES)
$(FULL_SUBMITFILE): $(FULL_SUBMITFILES)
rm -f $(PARTIAL_SUBMITFILE) $(FULL_SUBMITFILE)
COPYFILE_DISABLE=true tar -vczf $(FULL_SUBMITFILE) $(FULL_SUBMITFILES)
COPYFILE_DISABLE=true tar -cvf $(FULL_SUBMITFILE_UNCOMP) $(PARTIAL_SUBMITFILES)
cd $(TEST_DIR) \
&& COPYFILE_DISABLE=true tar -rvf ../$(FULL_SUBMITFILE_UNCOMP) test*.txt \
&& cd ..
gzip $(FULL_SUBMITFILE_UNCOMP)
@echo !!! Final submission prepared, test files included... READY FOR GRADING !!!
# shortcut for make submit tarballs
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment