-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
70 lines (50 loc) · 1.48 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
PYTHON=python
INTERPRET=interpreterext.py
INTERPRETGC=interpreterextgc.py
PROGRAMEXT=programext.py
PROGRAMEXTGC=programextgc.py
TEST_DIR=test
TEST_OUTPUT_DIR1=$(TEST_DIR)/output1
TEST_ANSWER_DIR1=$(TEST_DIR)/answers1
TEST_INPUT_DIR1=$(TEST_DIR)/SampleInputs1
TEST_OUTPUT_DIR2=$(TEST_DIR)/output2
TEST_ANSWER_DIR2=$(TEST_DIR)/answers2
TEST_INPUT_DIR2=$(TEST_DIR)/SampleInputs2
TESTER1=runtest1.py
TESTER2=runtest2.py
RUN_TEST1=$(PYTHON) $(TEST_DIR)/$(TESTER1)
RUN_TEST2=$(PYTHON) $(TEST_DIR)/$(TESTER2)
LINT_FILE=pylint.rc
FUNC1=$(TEST_INPUT_DIR1)/recLen.p
FUNC2=$(TEST_INPUT_DIR1)/iterList.p
.PHONY : clean test lint build view-part1 view-part2 view-func1 view-func2
lint: clean
-pylint $(INTERPRET) $(PROGRAMEXT) --rcfile $(TEST_DIR)/$(LINT_FILE)
-pychecker $(INTERPRET) $(PROGRAMEXT)
# This is the idea... but it needs to be cleaned up to handle a growing number of tests
test-part1: clean
@$(RUN_TEST1)
@echo "Checking answers"
@diff $(TEST_ANSWER_DIR1) $(TEST_OUTPUT_DIR1)
test-part2: clean
@$(RUN_TEST2)
@echo "Checking answers"
@diff $(TEST_ANSWER_DIR2) $(TEST_OUTPUT_DIR2)
test: test-part1 test-part2
clean:
@rm -f *.pyc *.out parsetab.py
@rm -rf $(TEST_OUTPUT_DIR1)
@rm -rf $(TEST_OUTPUT_DIR2)
view-part1 : clean
@more $(INTERPRET) $(PROGRAMEXT)
view-part2 : clean
@more $(INTERPRETGC) $(PROGRAMEXTGC)
view-func1: clean
@more $(FUNC1)
view-func2: clean
@more $(FUNC2)
build : clean
run-part1: clean
@$(PYTHON) $(INTERPRET)
run-part2: clean
@$(PYTHON) $(INTERPRETGC)