Skip to content

Commit

Permalink
set_is_unit_test/2 will now correctly set options.
Browse files Browse the repository at this point in the history
* Previously, set_is_unit_test/2 would only process the argument 'false'
  and leave options it sets unchanged. This was mainly a problem on
  windows where the option 'load' was left to 'show', causing the entire
  Metta $corelib to be echoed to the terminal while loading it to
  memory. The present commit fixes that.
* Part of oingoing work to address trueagi-io#227.
  • Loading branch information
stassa committed Dec 26, 2024
1 parent 16d278b commit 5374675
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions prolog/metta_lang/metta_interp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@
'is-symbol'(X):- symbol(X).
%:- (is_mettalog->switch_to_mettalog;switch_to_mettarust).

set_is_unit_test(false):-
forall(option_value_def(A,B),set_option_value_interp(A,B)),
set_option_value_interp('trace-on-test',false),
set_option_value_interp('trace-on-fail',false),
set_option_value_interp('load',silent),
set_option_value_interp('test',false),
!.
set_is_unit_test(TF):-
forall(option_value_def(A,B),set_option_value_interp(A,B)),
set_option_value_interp('trace-on-test',false),
Expand All @@ -600,6 +607,7 @@
set_option_value_interp('trace-on-exec',TF),
set_option_value_interp('trace-on-eval',TF),*/
% if_t( \+ TF , set_prolog_flag(debug_on_interrupt,true)),
% TODO: what is this cutting here?
!.

:- meta_predicate fake_notrace(0).
Expand Down

0 comments on commit 5374675

Please sign in to comment.