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
pub
frama-c
Commits
e9d5b1d9
Commit
e9d5b1d9
authored
Jul 01, 2020
by
Virgile Prevosto
Browse files
[tests] conditional run of preprocess_dos.c (only if unix2dos exists)
parent
6f3e9cfb
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
e9d5b1d9
...
@@ -55,6 +55,7 @@ autom4te.cache
...
@@ -55,6 +55,7 @@ autom4te.cache
/tests/journal/intra.byte
/tests/journal/intra.byte
/tests/misc/my_visitor_plugin/my_visitor.opt
/tests/misc/my_visitor_plugin/my_visitor.opt
/tests/misc/my_visitor.sav
/tests/misc/my_visitor.sav
/tests/spec/preprocess_dos.c
/tests/*/*.opt
/tests/*/*.opt
/tests/pdg/*.dot
/tests/pdg/*.dot
...
@@ -92,6 +93,8 @@ autom4te.cache
...
@@ -92,6 +93,8 @@ autom4te.cache
/doc/acsl/
/doc/acsl/
/doc/aorai/aorai-example.tgz
/doc/aorai/aorai-example/
/doc/aorai/frama-c-aorai-example.tgz
/doc/aorai/frama-c-aorai-example.tgz
/doc/aorai/frama-c-aorai-example
/doc/aorai/frama-c-aorai-example
/doc/aorai/main.pdf
/doc/aorai/main.pdf
...
...
Makefile
View file @
e9d5b1d9
...
@@ -2338,7 +2338,25 @@ PTESTS_SRC=ptests/ptests_config.ml ptests/ptests.ml
...
@@ -2338,7 +2338,25 @@ PTESTS_SRC=ptests/ptests_config.ml ptests/ptests.ml
# that does not contain a 'tests' dir
# that does not contain a 'tests' dir
PTESTS_CONFIG
:=
$(
shell
if
test
-d
tests
;
then
echo
tests/ptests_config
;
fi
)
PTESTS_CONFIG
:=
$(
shell
if
test
-d
tests
;
then
echo
tests/ptests_config
;
fi
)
ptests
:
bin/ptests.$(OCAMLBEST)$(EXE) $(PTESTS_CONFIG)
ifneq
("$(PTESTS_CONFIG)","")
GENERATED_TESTS
:=
tests/spec/preprocess_dos.c
else
GENERATED_TESTS
:=
endif
ifneq
("$(HAS_UNIX2DOS)","no")
tests/spec/preprocess_dos.c
:
tests/spec/preprocess_dos.c.in
$(SED)
-e
"s|@UNIX2DOS@|
$(UNIX2DOS)
|g"
\
-e
"s|@DONTRUN@||g"
\
$<
>
$@
else
tests/spec/preprocess_dos.c
:
tests/spec/preprocess_dos.c.in
$(SED)
-e
"s|@DONTRUN@|DONTRUN: no unix2dos found|g"
\
-e
"s|@UNIX2DOS|unix2dos|g"
\
$<
>
$@
endif
ptests
:
bin/ptests.$(OCAMLBEST)$(EXE) $(PTESTS_CONFIG) $(GENERATED_TESTS)
bin/ptests.byte$(EXE)
:
$(PTESTS_SRC)
bin/ptests.byte$(EXE)
:
$(PTESTS_SRC)
$(PRINT_LINKING)
$@
$(PRINT_LINKING)
$@
...
@@ -2350,7 +2368,7 @@ bin/ptests.opt$(EXE): $(PTESTS_SRC)
...
@@ -2350,7 +2368,7 @@ bin/ptests.opt$(EXE): $(PTESTS_SRC)
$(OCAMLOPT)
-I
ptests
-dtypes
-thread
-o
$@
\
$(OCAMLOPT)
-I
ptests
-dtypes
-thread
-o
$@
\
unix.cmxa threads.cmxa str.cmxa dynlink.cmxa
$^
unix.cmxa threads.cmxa str.cmxa dynlink.cmxa
$^
GENERATED
+=
ptests/ptests_config.ml tests/ptests_config
GENERATED
+=
ptests/ptests_config.ml tests/ptests_config
$(GENERATED_TESTS)
#######################
#######################
# Source distribution #
# Source distribution #
...
...
tests/spec/preprocess_dos.c
→
tests/spec/preprocess_dos.c
.in
View file @
e9d5b1d9
/* run.config*
/* run.config*
OPT: -cpp-command="@PTEST_DIR@/@PTEST_NAME@.sh %i %o" -cpp-frama-c-compliant -print
@DONTRUN@
OPT: -cpp-command="@PTEST_DIR@/@PTEST_NAME@.sh @UNIX2DOS@ %i %o" -cpp-frama-c-compliant -print
*/
*/
int main() {
int main() {
...
...
tests/spec/preprocess_dos.sh
View file @
e9d5b1d9
#!/bin/sh
#!/bin/sh
gcc
-C
-E
-I
.
-o
$
2
$
1
gcc
-C
-E
-I
.
-o
$
3
$
2
dos2unix
-q
$
2
$1
-q
$
3
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