Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
ff33b05d
Commit
ff33b05d
authored
Dec 15, 2014
by
POTTIER Francois
Browse files
Cleanup and nicer output in bench/good/Makefile.
parent
e4d72f52
Changes
2
Hide whitespace changes
Inline
Side-by-side
bench/good/.gitignore
View file @
ff33b05d
*.ml
*.ml
*.mli
*.mli
*.result
*.result
*.out
*.automaton
*.automaton
*.conflicts
*.conflicts
failures
failures
...
...
bench/good/Makefile
View file @
ff33b05d
...
@@ -14,8 +14,8 @@ CAMLC := $(shell if ocamlfind ocamlc -v >/dev/null 2>&1 ; \
...
@@ -14,8 +14,8 @@ CAMLC := $(shell if ocamlfind ocamlc -v >/dev/null 2>&1 ; \
then
echo
ocamlc.opt
;
\
then
echo
ocamlc.opt
;
\
else
echo
ocamlc
;
fi
)
else
echo
ocamlc
;
fi
)
#
La convention de nommage des tests multi-grammaires
#
Some tests involve several input files. The naming convention for
#
est : /nom
/-[1-9].mly
#
these tests is /name
/-[1-9].mly
.
TESTS
=
$(
shell
ls
| egrep
'*([1]|[^2-9]
)
.mly'
)
TESTS
=
$(
shell
ls
| egrep
'*([1]|[^2-9]
)
.mly'
)
RESULTS
=
$(TESTS:.mly=.result)
RESULTS
=
$(TESTS:.mly=.result)
...
@@ -24,42 +24,49 @@ test: clean $(RESULTS)
...
@@ -24,42 +24,49 @@ test: clean $(RESULTS)
echo
WARNINGS:
;
\
echo
WARNINGS:
;
\
cat
warnings
;
\
cat
warnings
;
\
fi
fi
@
if
test
-e
failures
;
then
\
@
if
test
-e
failures
;
then
\
echo
FAILURES:
;
\
echo
FAILURES:
;
\
cat
failures
;
\
cat
failures
;
\
exit
1
;
\
exit
1
;
\
fi
fi
# The file %.result stores the output of menhir --only-preprocess.
# The file %.result stores the output of menhir --only-preprocess.
# The file %.expected stores its expected output.
# The file %.expected stores its expected output.
# The file %.out stores the output of menhir.
# (There is presently no expected output file.)
%.result
:
%.mly
%.result
:
%.mly
# Single-file or multi-file test?
@
if
echo
$<
|
grep
-e
"-1.mly"
&>
/dev/null;
then
\
@
if
echo
$<
|
grep
-e
"-1.mly"
&>
/dev/null;
then
\
export
BASE
=
`
echo
$<
|
sed
s/
"-1.mly"
/
""
/
`
;
\
export
BASE
=
`
echo
$<
|
sed
s/
"-1.mly"
/
""
/
`
;
\
export
FILES
=
`
echo
$$
BASE-[1-9].mly
`
;
\
export
FILES
=
`
echo
$$
BASE-[1-9].mly
`
;
\
export
CMD
=
"
$$
FILES --base
$$
BASE"
;
\
export
CMD
=
"
$$
FILES --base
$$
BASE"
;
\
else
\
else
\
export
FILES
=
"
$<
"
;
\
export
FILES
=
"
$<
"
;
\
export
BASE
=
`
echo
$<
|
sed
s/
".mly"
/
""
/
`
;
\
export
BASE
=
`
echo
$<
|
sed
s/
".mly"
/
""
/
`
;
\
export
CMD
=
"
$<
"
;
\
export
CMD
=
"
$<
"
;
\
fi
;
\
fi
;
\
$(SHELL)
-c
'
$(MENHIR)
--only-preprocess $$CMD >& $@'
;
\
$(SHELL)
-c
'
$(MENHIR)
--only-preprocess $$CMD >& $@'
;
\
if
[
x
$$
CREATE_EXPECTED
==
x
"1"
]
;
then
\
if
[
x
$$
CREATE_EXPECTED
==
x
"1"
]
;
then
\
cp
$@
$*
.expected
;
\
cp
$@
$*
.expected
;
\
fi
;
\
fi
;
\
if
test
-e
$*
.expected
;
then
\
if
test
-e
$*
.expected
;
then
\
if
diff
$@
$*
.expected
>
& /dev/null
;
then
\
if
diff
$@
$*
.expected
>
& /dev/null
;
then
\
if
$(MENHIR)
$$
CMD
>
& /dev/null
;
then
\
if
$(MENHIR)
$$
CMD
>
&
$*
.out
;
then
\
echo
"[OK]
$$
FILES"
;
\
echo
"[OK]
$$
FILES"
;
\
else
\
else
(
\
echo
"-> [KO]
$$
FILES:"
|
tee
-a
failures
;
\
echo
"-> [KO]
$$
FILES:"
;
\
echo
" menhir --only-preprocess succeeded,"
|
tee
-a
failures
;
\
echo
" menhir --only-preprocess succeeded,"
;
\
echo
" but menhir failed."
|
tee
-a
failures
;
\
echo
" but menhir failed."
;
\
fi
;
\
echo
" cat
$*
.out"
;
\
else
\
)
|
tee
-a
failures
;
\
echo
"-> [KO]
$$
FILES:"
|
tee
-a
failures
;
\
fi
;
\
echo
" menhir --only-preprocess produced unexpected output."
;
\
else
(
\
fi
;
\
echo
"-> [KO]
$$
FILES:"
;
\
echo
" menhir --only-preprocess produced wrong output."
;
\
echo
" diff
$*
.expected
$@
"
;
\
)
|
tee
-a
failures
;
\
fi
;
\
else
\
else
\
echo
"Warning: missing file:
$*
.expected"
|
tee
-a
warnings
;
\
echo
"Warning: missing file:
$*
.expected"
|
tee
-a
warnings
;
\
fi
;
\
fi
;
\
...
...
Write
Preview
Supports
Markdown
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