This commit is contained in:
Vitor Santos Costa
2018-10-31 00:35:49 +00:00
parent a491f71cb0
commit 004bbef62b
7 changed files with 61 additions and 46 deletions

View File

@@ -107,6 +107,10 @@ option(Opt, _, Default) :-
%
% @param Option Term of the form Name(?Value).
option(Opt, Options) :- % make option processing stead-fast
atom(Opt),
!,
get_option(Opt, Options).
option(Opt, Options) :- % make option processing stead-fast
arg(1, Opt, OptVal),
nonvar(OptVal), !,
@@ -132,6 +136,10 @@ get_option(Opt, Options) :-
% the matching option from Options and unifying the remaining
% options with RestOptions.
select_option(Opt, Options0, Options) :- % stead-fast
atom(Opt),
!,
select_option(Opt, Options0, Options).
select_option(Opt, Options0, Options) :- % stead-fast
arg(1, Opt, OptVal),
nonvar(OptVal), !,

View File

@@ -422,7 +422,7 @@ valid_test_mode(Options0, Options) :-
test_mode(true(_)).
test_mode(all(_)).
test_mode(set(_)).
test_mode(fail(_)).
test_mode(fail).
test_mode(throws(_)).
@@ -509,7 +509,7 @@ verify_options([H|T], Pred) :-
test_option(Option) :-
test_set_option(Option), !.
test_option(true(_)).
test_option(fail(_)).
test_option(fail).
test_option(throws(_)).
test_option(all(_)).
test_option(set(_)).
@@ -889,7 +889,7 @@ run_test_6(Unit, Name, Line, Options, Body, Result) :-
option(set(Answer), Options), !, % set(Bindings)
nondet_test(set(Answer), Unit, Name, Line, Options, Body, Result).
run_test_6(Unit, Name, Line, Options, Body, Result) :-
option(fail(true), Options), !, % fail
option(fail, Options), !, % fail
unit_module(Unit, Module),
( setup(Module, test(Unit,Name,Line), Options)
-> statistics(runtime, [T0,_]),
@@ -1095,8 +1095,8 @@ setup(_,_,_).
% Call Goal in Module after applying goal expansion.
call_ex(Module, Goal) :-
(expand_goal(Goal,Module: GoalEx),
Module:GoalEx).
expand_goal(Module:Goal, GoalEx),
call(GoalEx).
%% cleanup(+Module, +Options) is det.
%