Permalink
Browse files

Resolves #46 and adds tests

  • Loading branch information...
ihh committed Jan 18, 2018
1 parent cb8319f commit d1f8f836568edbbeed93053b6469905e5f42184a
Showing with 30 additions and 0 deletions.
  1. +6 −0 prolog/biomake/biomake.pl
  2. +3 −0 prolog/biomake/gnumake_parser.pl
  3. +2 −0 prolog/test/test.pl
  4. +1 −0 t/ref/deltest
  5. +1 −0 t/ref/deltest2
  6. +17 −0 t/target/Makefile.delete
@@ -568,6 +568,12 @@
member(ignore_errors_in_targets(TL),Opts),
member(T,TL),
!.
handle_error(T,Opts) :-
get_opt(delete_on_error,true,Opts),
exists_file(T),
report('Deleting ~w',[T],Opts),
delete_file(T),
fail.
handle_error(_,_) :-
halt_error.
@@ -373,6 +373,9 @@
axvar(true,Sx) --> xvar(Sx).
axvar(false,_) --> makefile_var_string_from_codes(_), opt_whitespace, "\n".
makefile_special_target(delete_on_error(true),Lines) -->
makefile_recipe(rule([".DELETE_ON_ERROR"],_,_),Lines).
makefile_special_target(queue(none),Lines) -->
makefile_recipe(rule([".NOTPARALLEL"],_,_),Lines).
@@ -95,6 +95,8 @@
run_test("-f Makefile.ignore","ignore"),
run_failure_test("-f Makefile.ignore_control","ignore_control"),
run_test("-f Makefile.ignore_all","ignore_all"),
run_test("-f Makefile.delete","deltest"),
run_test("-f Makefile.delete","deltest2"),
announce("AUTOMATIC VARIABLES"),
run_test("stem.echo"),
@@ -0,0 +1 @@
hello
@@ -0,0 +1 @@
mushroom
@@ -0,0 +1,17 @@
deltest: deltest-dep
(cat $< || echo mushroom) >$@
deltest2:
($(MAKE) $(addprefix -f ,$(MAKEFILE_LIST)) deltest2-dep || true)
(cat deltest2-dep || echo mushroom) >$@
deltest-dep deltest2-dep:
echo hello >$@
this_line_should_cause_an_error_wardrobe_elephant_postman
.DELETE_ON_ERROR:
.SECONDARY:
.IGNORE: deltest-dep

0 comments on commit d1f8f83

Please sign in to comment.