forked from jenglish/ssptool
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
117 lines (95 loc) · 2.3 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#
# Makefile -- master task runner.
#
# Type `make` or `make help` for list of available targets.
# `make qa` is the main one.
#
NMBIN = ./node_modules/.bin
SSPTOOL = node $(CURDIR)/main.js
LINTABLE = \
'*.js' \
'lib/**/*.js' \
'commands/*.js' \
'test/*.js' \
default :: help
help :: pre-help usage post-help
usage ::
@echo "make qa"
TESTDATADIR = examples/test/opencontrols
DEMODATADIR = examples/demo/opencontrols
examples/%/opencontrols :
@echo "Getting $* data..."
(cd examples/$* ; compliance-masonry get)
clean ::
-rm -rf examples/*/opencontrols
test-prep ::
( cd examples/test ; compliance-masonry get )
usage ::
@echo "make test-prep"
css ::
$(NMBIN)/lessc less/style.less > public/css/style.css
$(NMBIN)/lessc less/doc-style.less > public/css/doc-style.css
usage ::
@echo "make css"
qa :: lint
lint ::
@echo "Linting..."
@$(NMBIN)/eslint $(LINTABLE)
usage ::
@echo "make lint"
lint-fix ::
$(NMBIN)/eslint --fix $(LINTABLE)
qa :: test
test :: $(TESTDATADIR)
test ::
@echo "Testing..."
@$(NMBIN)/mocha -R dot
usage ::
@echo "make test"
qa :: jsdoc
jsdoc ::
@echo "Running jsdoc..."
@$(NMBIN)/jsdoc -c .jsdoc.json -r lib -d jsdocs
usage ::
@echo "make jsdoc"
demo : $(DEMODATADIR)
cd examples/demo ; \
$(SSPTOOL) validate ; \
$(SSPTOOL) refcheck ; \
$(SSPTOOL) server
usage ::
@echo "make demo"
demo-ssp :: $(DEMODATADIR)
cd examples/demo; \
$(SSPTOOL) document ssp > SSP.html ;
usage ::
@echo "make demo-ssp"
clean ::
-rm -f examples/demo/SSP.html
test-server : $(TESTDATADIR)
(cd examples/test ; node test-server.js)
usage ::
@echo "make test-server"
TD = examples/test
qa :: regtest
regtest :: $(TESTDATADIR)
regtest ::
@echo "CLI regression tests..."
@cd ${TD} ; $(SSPTOOL) document doc1 > /dev/null \
@cd ${TD} ; $(SSPTOOL) list | diff - regtest/list.expect
@cd ${TD} ; $(SSPTOOL) validate 2>&1 | diff - regtest/validate.expect
@cd ${TD} ; $(SSPTOOL) refcheck 2>&1 | diff - regtest/refcheck.expect
@cd ${TD} ; $(SSPTOOL) report completion profile=FredRAMP-low \
2>&1 | diff - regtest/report.expect \
;
usage ::
@echo "make regtest"
-include local.mk
pre-help post-help ::
@echo ""
# QA success notification - must be last
qa ::
@echo "================================"
@echo "=== all QA checks passed ==="
@echo "================================"
#*EOF*