| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
PATH := ${CURDIR}/..:${CURDIR}:${PATH} |
| 6 |
SHELL = sh # Do not introduce bashisms! |
| 7 |
CVS = cvs |
| 8 |
DIFF = diff -u -a |
| 9 |
CVS_FAST_EXPORT = ../cvs-fast-export $(OPTS) |
| 10 |
PYTHON = python3 |
| 11 |
|
| 12 |
check: test |
| 13 |
|
| 14 |
.SUFFIXES: .tst .repo .testrepo .checkout .dot .fi ,v |
| 15 |
|
| 16 |
.tst.repo: |
| 17 |
$(PYTHON) $< |
| 18 |
.repo.checkout: |
| 19 |
$(CVS) -d :local:${CURDIR}/$*.repo -Q checkout module && mv module $*.checkout |
| 20 |
.repo.dot: |
| 21 |
find $</module -name '*,v' | $(CVS_FAST_EXPORT) -g >$*.dot |
| 22 |
.repo.fi: |
| 23 |
find $</module -name '*,v' | $(CVS_FAST_EXPORT) >$*.dot |
| 24 |
.testrepo.checkout: |
| 25 |
$(CVS) -d :local:${CURDIR}/$*.testrepo -Q checkout module && mv module $*.checkout |
| 26 |
.testrepo.dot: |
| 27 |
find $</module -name '*,v' | $(CVS_FAST_EXPORT) -g >$*.dot |
| 28 |
.testrepo.fi: |
| 29 |
find $</module -name '*,v' | $(CVS_FAST_EXPORT) >$*.fi |
| 30 |
,v.dot: |
| 31 |
$(CVS_FAST_EXPORT) -g $< >$*.dot |
| 32 |
|
| 33 |
test: s_regress m_regress r_regress i_regress t_regress c_regress sporadic |
| 34 |
@echo "No diff output is good news." |
| 35 |
|
| 36 |
rebuild: s_rebuild m_rebuild r_rebuild i_rebuild t_rebuild |
| 37 |
|
| 38 |
testlist: |
| 39 |
@grep '^##' *.tst *.py *.sh |
| 40 |
|
| 41 |
|
| 42 |
neutralize.map: |
| 43 |
@echo "$${USER:-root} = foo <foo> -0500" >neutralize.map |
| 44 |
|
| 45 |
TESTLOADS := $(shell ls -1 *.tst | sed '/.tst/s///') |
| 46 |
TESTOPTS = -T -A neutralize.map --reposurgeon |
| 47 |
s_rebuild: neutralize.map |
| 48 |
@-for file in $(TESTLOADS); do \ |
| 49 |
echo "Remaking $${file}.chk"; \ |
| 50 |
$(MAKE) --quiet $${file}.repo; \ |
| 51 |
find $${file}.repo/module -name '*,v' | $(CVS_FAST_EXPORT) $(TESTOPTS) >$${file}.chk 2>&1; \ |
| 52 |
done; |
| 53 |
s_regress: neutralize.map |
| 54 |
@echo "== Dump regressions ==" |
| 55 |
@-for file in $(TESTLOADS); do \ |
| 56 |
legend=$$( ( grep -a '##' $${file}.tst || echo ' ## (no description)' ) | sed 's/## //' ); \ |
| 57 |
$(MAKE) --quiet $${file}.repo; \ |
| 58 |
find $${file}.repo/module -name '*,v' | $(CVS_FAST_EXPORT) $(TESTOPTS) 2>&1 | tapdiffer "$${legend}" $${file}.chk; \ |
| 59 |
done |
| 60 |
|
| 61 |
MASTERS := $(shell ls -1 *,v | sed '/,v/s///') |
| 62 |
m_rebuild: |
| 63 |
@-for file in $(MASTERS); do \ |
| 64 |
echo "Remaking $${file}.chk"; \ |
| 65 |
$(CVS_FAST_EXPORT) $${file},v >$${file}.chk 2>&1; \ |
| 66 |
done; |
| 67 |
m_regress: |
| 68 |
@echo "== Master-parsing regressions ==" |
| 69 |
@-for file in $(MASTERS); do \ |
| 70 |
legend=$$(sed <$${file},v -n -e '/^comment[ ]*@# \(.*\)@;/s//\1/p'); \ |
| 71 |
$(CVS_FAST_EXPORT) $${file},v 2>&1 | tapdiffer "$${legend}" $${file}.chk; \ |
| 72 |
done |
| 73 |
|
| 74 |
INCREMENTAL=twobranch |
| 75 |
THRESHOLD=104000 |
| 76 |
i_rebuild: neutralize.map |
| 77 |
@-for file in $(INCREMENTAL); do \ |
| 78 |
echo "Remaking $${file}.inc-chk"; \ |
| 79 |
$(MAKE) --quiet $${file}.repo; \ |
| 80 |
find $${file}.repo/module -name '*,v' | $(CVS_FAST_EXPORT) -T -A neutralize.map -i $(THRESHOLD) >$${file}.inc-chk 2>&1; \ |
| 81 |
done; |
| 82 |
i_regress: neutralize.map |
| 83 |
@echo "== Incremental-dump regressions ==" |
| 84 |
@-for file in $(INCREMENTAL); do \ |
| 85 |
legend=$$( ( grep -a '##' $${file}.tst || echo ' ## (no description)') | sed 's/## //' ); \ |
| 86 |
$(MAKE) --quiet $${file}.repo; \ |
| 87 |
find $${file}.repo/module -name '*,v' | $(CVS_FAST_EXPORT) -T -i $(THRESHOLD) -A neutralize.map 2>&1 | tapdiffer "$${legend}" $${file}.inc-chk; \ |
| 88 |
done |
| 89 |
|
| 90 |
REDUCED=oldhead |
| 91 |
r_rebuild: neutralize.map |
| 92 |
@-for file in $(REDUCED); do \ |
| 93 |
echo "Remaking $${file}.chk"; \ |
| 94 |
find $${file}.testrepo/module -name '*,v' | $(CVS_FAST_EXPORT) $(TESTOPTS) >$${file}.chk 2>&1; \ |
| 95 |
done; |
| 96 |
r_regress: neutralize.map |
| 97 |
@echo "== Repo regressions ==" |
| 98 |
@-for repo in $(REDUCED); do \ |
| 99 |
legend=$$( ( grep -a '##' $${repo}.testrepo/README || echo ' ## (no description)') | sed 's/## //' ); \ |
| 100 |
find $${repo}.testrepo/module -name '*,v' | $(CVS_FAST_EXPORT) $(TESTOPTS) 2>&1 | tapdiffer "$${legend}" $${repo}.chk; \ |
| 101 |
done |
| 102 |
|
| 103 |
PYTESTS=t9601 t9602 t9603 t9604 t9605 |
| 104 |
PATHSTRIP = sed -e '/\/.*tests/s//tests/' |
| 105 |
t_regress: |
| 106 |
@echo "== Pathological cases ==" |
| 107 |
@for pytest in $(PYTESTS); do \ |
| 108 |
legend=$$( ( grep -a '##' $${pytest}.py || echo ' ## (no description)') | sed 's/## //' ); \ |
| 109 |
$(PYTHON) $${pytest}.py 2>&1 | $(PATHSTRIP) | tapdiffer "$${legend}" $${pytest}.err; \ |
| 110 |
done |
| 111 |
t_rebuild: |
| 112 |
@for pytest in $(PYTESTS); do \ |
| 113 |
echo "Remaking $${pytest}.err "; \ |
| 114 |
$(PYTHON) $${pytest}.py 2>&1 | $(PATHSTRIP) >$${pytest}.err; \ |
| 115 |
done |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
CT = at.repo basic.repo daughterbranch.repo exec.repo expand.repo \ |
| 124 |
hack[123].repo longrev.repo postbranch.repo tagbug.repo \ |
| 125 |
twobranch.repo |
| 126 |
CD = oldhead.testrepo t9603.testrepo t9604.testrepo t9605.testrepo \ |
| 127 |
vendor.testrepo |
| 128 |
c_regress: |
| 129 |
@echo "== Conversion checks ==" |
| 130 |
@for ct in $(CT); do $(MAKE) --quiet $$ct; cvsconvert -q -n $$ct; done |
| 131 |
@for cd in $(CD); do cvsconvert -q -n $$cd; done |
| 132 |
|
| 133 |
UNSTRIPPED = $(shell ls issue22.txt,v t9601.testrepo/module/* at.repo/module/*) |
| 134 |
z_regress: |
| 135 |
@echo "== Reductions ==" |
| 136 |
@for rtest in $(UNSTRIPPED); do \ |
| 137 |
base=`basename $${rtest}`; \ |
| 138 |
echo " $${base}"; \ |
| 139 |
cvsstrip <$${rtest} | $(DIFF) reductions/$${base}.reduced -; \ |
| 140 |
done |
| 141 |
z_rebuild: |
| 142 |
@for rtest in $(UNSTRIPPED); do \ |
| 143 |
base=`basename $${rtest}`; \ |
| 144 |
echo "Remaking $${base}.reduced "; \ |
| 145 |
cvsstrip <$${rtest} >reductions/$${base}.reduced; \ |
| 146 |
done |
| 147 |
|
| 148 |
sporadic: |
| 149 |
@echo "== Sporadic tests ==" |
| 150 |
@sh incremental.sh |
| 151 |
|
| 152 |
clean: |
| 153 |
rm -fr neutralize.map *.checkout *.repo *.pyc *.dot *.git *.git.fi |