Commit e9d5b1d9 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[tests] conditional run of preprocess_dos.c (only if unix2dos exists)

parent 6f3e9cfb
......@@ -55,6 +55,7 @@ autom4te.cache
/tests/journal/intra.byte
/tests/misc/my_visitor_plugin/my_visitor.opt
/tests/misc/my_visitor.sav
/tests/spec/preprocess_dos.c
/tests/*/*.opt
/tests/pdg/*.dot
......@@ -92,6 +93,8 @@ autom4te.cache
/doc/acsl/
/doc/aorai/aorai-example.tgz
/doc/aorai/aorai-example/
/doc/aorai/frama-c-aorai-example.tgz
/doc/aorai/frama-c-aorai-example
/doc/aorai/main.pdf
......
......@@ -2338,7 +2338,25 @@ PTESTS_SRC=ptests/ptests_config.ml ptests/ptests.ml
# that does not contain a 'tests' dir
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)
$(PRINT_LINKING) $@
......@@ -2350,7 +2368,7 @@ bin/ptests.opt$(EXE): $(PTESTS_SRC)
$(OCAMLOPT) -I ptests -dtypes -thread -o $@ \
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 #
......
/* 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() {
......
#!/bin/sh
gcc -C -E -I. -o $2 $1
dos2unix -q $2
gcc -C -E -I. -o $3 $2
$1 -q $3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment