-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (47 loc) · 1.7 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
# Makefile
NAME= whatsthere
EXECUTABLE= ./$(NAME)/$(NAME).py
BUGREPORT= $(EXECUTABLE).log
TESTFILES= ./tests/testfiles
LOG= ./tests/test.log
WRITE= echo "\n\n"
TOLOG= >> $(LOG)
all: clean init testfiles test
# Install requirements
init:
pip3 install -r requirements.txt
# Create testfiles with different filenames, extensions and sizes
testfiles:
./tests/extmaker.py $(TESTFILES)/ 5
# Test all default program functions
test:
$(WRITE) "default testing\n" $(TOLOG)
$(EXECUTABLE) $(TOLOG)
$(WRITE) "wrong directory name test\n" $(TOLOG)
$(EXECUTABLE) asdf $(TOLOG)
$(EXECUTABLE) -1 $(TOLOG)
$(WRITE) "wrong option name test\n" $(TOLOG)
$(EXECUTABLE) ./. wrong_option 99 $(TOLOG)
$(WRITE) "testfiles subdirectory testing\n" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) total 99 $(TOLOG)
$(WRITE) "testfiles subdirectory / display only three most important\n" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) total 3 $(TOLOG)
$(WRITE) "testfiles subdirectory / display entries\n" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) entries 99 $(TOLOG)
$(WRITE) "testfiles subdirectory / display directories\n" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) dirs 99 $(TOLOG)
$(WRITE) "testfiles subdirectory / display files\n" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) files 99 $(TOLOG)
$(WRITE) "testfiles subdirectory / display extensions" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) sizes 99 $(TOLOG)
$(WRITE) "testfiles subdirectory / display extensons with debug information" $(TOLOG)
$(EXECUTABLE) $(TESTFILES) entries 99 -d $(TOLOG)
$(WRITE) "Adding the program's log file to the test report" $(TOLOG)
cat $(BUGREPORT) $(TOLOG)
less $(LOG)
clean:
rm -rf $(LOG)
rm -rf $(BUGREPORT)
rm -rf $(TESTFILES)
# Executed by default
.PHONY: clean init testfiles test