Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
77276960
Commit
77276960
authored
Sep 24, 2015
by
POTTIER Francois
Browse files
Turned coverage.sh into Makefile entries. This allows parallel execution.
parent
391f3d05
Changes
2
Hide whitespace changes
Inline
Side-by-side
bench/good/.gitignore
View file @
77276960
...
...
@@ -6,3 +6,5 @@
*.conflicts
failures
warnings
*.log
lr.csv
bench/good/Makefile
View file @
77276960
.PHONY
:
clean test expected
.PHONY
:
clean test expected
list
# Note that there is potential confusion between src/_stage1/menhir
# and src/_stage2/menhir. Here, we use the latter (built by "make
...
...
@@ -102,3 +102,38 @@ clean:
rm
-f
*
.ml
*
.mli
*
.conflicts
*
.automaton
rm
-f
*
.out failures warnings
# ------------------------------------------------------------------------------
# Testing LRijkstra, that is, menhir --list-errors.
TIMEOUT
:=
2
PARALLEL
:=
-j4
SINGLE
=
$(
shell
ls
*
.mly | egrep
-v
'.*-([1-9]
)
.mly'
)
%.log
:
%.mly
@
echo
"Now dealing with:
$<
"
|
tee
-a
$@
@
if
(
timeout
$(TIMEOUT)
$(MENHIR)
--list-errors
-la
2
--lalr
$<
)
>>
$@
2>&1
;
then
\
echo
"
$<
: success."
|
tee
-a
$@
;
\
else
\
echo
"
$<
: TIMEOUT."
|
tee
-a
$@
;
\
fi
list
:
# Compile Menhir.
# make -C $(SRC) clean
make
-C
$(SRC)
bootstrap
# Remove any leftover output files.
rm
-f
*.log
lr.csv
# Print the header of lr.csv. (This should be kept in sync with LRijkstra.ml.)
echo
"grammar,terminals,nonterminals,size,states,trie,facts,edges,time,heap"
>
lr.csv
# Try every grammar. (Only the single-file grammars, that is.)
# This can proceed in parallel, for a reasonable number of processes.
# Each process appends one line of data to lr.csv when it finishes.
# Hopefully the final content of lr.csv will be a reasonable interleaving
# of these lines.
@
$(MAKE)
$(PARALLEL)
$(patsubst
%.mly,%.log,$(SINGLE))
# Finished.
@ echo "Number of grammars that could not be handled in $(TIMEOUT) seconds
:
"
@
grep
TIMEOUT
*
.log |
wc
-l
@
echo
"Number of grammars that were successfully handled:"
@
tail
-n
+2 lr.csv |
wc
-l
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment