From f87754436824539e4429be2e7c18287bc68494fe Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 18 Apr 2023 15:56:04 +0200 Subject: [PATCH] Remove optimizations for big tests --- compiler/catala_utils/cli.ml | 2 +- compiler/shared_ast/expr.ml | 5 ++-- compiler/shared_ast/program.ml | 1 + ...ts_calcul_al_accession_propriete.catala_fr | 2 +- .../tests/tests_calcul_al_locatif.catala_fr | 4 +-- .../tests_calcul_al_logement_foyer.catala_fr | 2 +- ...s_calcul_apl_accession_propriete.catala_fr | 8 +++--- .../tests/tests_calcul_apl_locatif.catala_fr | 18 ++++++------ .../tests_calcul_apl_logement_foyer.catala_fr | 10 +++---- .../tests/tests_calculette_globale.catala_fr | 2 +- .../tests/tests_eligibilite_apl.catala_fr | 2 +- .../tests_allocations_familiales.catala_fr | 28 +++++++++---------- .../tests/tests_ouverture_droits.catala_fr | 2 +- 13 files changed, 43 insertions(+), 43 deletions(-) diff --git a/compiler/catala_utils/cli.ml b/compiler/catala_utils/cli.ml index b552252e..1b84a5dc 100644 --- a/compiler/catala_utils/cli.ml +++ b/compiler/catala_utils/cli.ml @@ -490,7 +490,7 @@ let time_marker ppf () = format_with_style [ANSITerminal.Bold; ANSITerminal.black] ppf - (Printf.sprintf "[TIME] %.0fms@\n" delta) + (Format.sprintf "[TIME] %.0fms@\n" delta) (** Prints [\[DEBUG\]] in purple on the terminal standard output *) let debug_marker ppf () = diff --git a/compiler/shared_ast/expr.ml b/compiler/shared_ast/expr.ml index 5e78365f..3507a2b4 100644 --- a/compiler/shared_ast/expr.ml +++ b/compiler/shared_ast/expr.ml @@ -779,9 +779,8 @@ let make_app ?(decl_ctx = None) e args pos = match decl_ctx with | None -> assert false | Some decl_ctx -> - Errors.raise_error - "INTERNAL ERROR: wrong type: found %a while expecting either \ - an Arrow or Any" + Errors.raise_internal_error + "wrong type: found %a while expecting either an Arrow or Any" (Print.typ decl_ctx) fty.ty))) (List.map Marked.get_mark (e :: args)) in diff --git a/compiler/shared_ast/program.ml b/compiler/shared_ast/program.ml index f4a48c73..104ec64e 100644 --- a/compiler/shared_ast/program.ml +++ b/compiler/shared_ast/program.ml @@ -74,6 +74,7 @@ let to_expr p main_scope = res let equal p p' = + (* TODO: include toplevel definitions in this program comparison. *) let ss = all_scopes p.code_items in let ss' = all_scopes p'.code_items in diff --git a/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr b/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr index 5e7f5e35..5f3fcee3 100644 --- a/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_accession_propriete.catala_fr @@ -44,7 +44,7 @@ $ catala Interpret -s Exemple1 [RESULT] montant = 96.48 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 96.48 € ``` diff --git a/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr index b5060c22..8d980244 100644 --- a/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_locatif.catala_fr @@ -102,12 +102,12 @@ $ catala Interpret -s Exemple2 --disable_warnings ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 345.73 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 352.77 € ``` diff --git a/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr index 563a6bbf..9b3bfd67 100644 --- a/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_al_logement_foyer.catala_fr @@ -36,7 +36,7 @@ $ catala Interpret -s CasTest1 --disable_warnings [RESULT] montant = 76.38 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 76.38 € ``` diff --git a/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr index 72b59a4f..7b00ce04 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_accession_propriete.catala_fr @@ -168,22 +168,22 @@ $ catala Interpret -s Exemple4 --disable_warnings [RESULT] montant = 118.59 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 181.91 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 67.34 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 181.91 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 118.59 € ``` diff --git a/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr index ad8c75fd..42dfa889 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_locatif.catala_fr @@ -332,47 +332,47 @@ $ catala Interpret -s Exemple9 --disable_warnings [RESULT] montant = 210.06 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 0.00 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple2 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 352.77 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple3 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 321.61 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple4 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 0.00 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple5 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple5 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 311.56 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple6 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple6 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 0.00 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple7 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple7 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 153.77 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple8 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple8 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 11.06 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple9 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple9 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 210.06 € ``` diff --git a/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr b/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr index c829ac66..486b4e3d 100644 --- a/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr +++ b/examples/aides_logement/tests/tests_calcul_apl_logement_foyer.catala_fr @@ -157,27 +157,27 @@ $ catala Interpret -s CasTest5 --disable_warnings [RESULT] montant = 129.65 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 12.06 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest2 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest2 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 23.12 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest3 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest3 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 154.78 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest4 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest4 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 154.78 € ``` ```catala-test-inline -$ catala Interpret_Lcalc -s CasTest5 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s CasTest5 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant = ESome 129.65 € ``` diff --git a/examples/aides_logement/tests/tests_calculette_globale.catala_fr b/examples/aides_logement/tests/tests_calculette_globale.catala_fr index 66340cf5..18e96792 100644 --- a/examples/aides_logement/tests/tests_calculette_globale.catala_fr +++ b/examples/aides_logement/tests/tests_calculette_globale.catala_fr @@ -98,7 +98,7 @@ $ catala Interpret -s Exemple1 [RESULT] éligibilité = true ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] montant_versé = ESome 246.23 € [RESULT] éligibilité = ESome true diff --git a/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr b/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr index 9af48cf3..d36435ab 100644 --- a/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr +++ b/examples/aides_logement/tests/tests_eligibilite_apl.catala_fr @@ -260,7 +260,7 @@ $ catala Typecheck [RESULT] Typechecking successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Exemple1 --avoid_exceptions [RESULT] Computation successful! Results: [RESULT] éligible = ESome true ``` diff --git a/examples/allocations_familiales/tests/tests_allocations_familiales.catala_fr b/examples/allocations_familiales/tests/tests_allocations_familiales.catala_fr index 220cecea..464a215e 100644 --- a/examples/allocations_familiales/tests/tests_allocations_familiales.catala_fr +++ b/examples/allocations_familiales/tests/tests_allocations_familiales.catala_fr @@ -423,58 +423,58 @@ $ catala Interpret -s Test13 --disable_warnings [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test1 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test2 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test2 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test3 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test3 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test4 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test4 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test5 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test5 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test6 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test6 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test7 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test7 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test8 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test8 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test9 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test9 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test10 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test10 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test11 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test11 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test12 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test12 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test13 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test13 --avoid_exceptions [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test13 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test13 --avoid_exceptions [RESULT] Computation successful! ``` diff --git a/examples/allocations_familiales/tests/tests_ouverture_droits.catala_fr b/examples/allocations_familiales/tests/tests_ouverture_droits.catala_fr index a34fe79b..16b197ca 100644 --- a/examples/allocations_familiales/tests/tests_ouverture_droits.catala_fr +++ b/examples/allocations_familiales/tests/tests_ouverture_droits.catala_fr @@ -65,6 +65,6 @@ $ catala Interpret -s Test1 --disable_warnings [RESULT] Computation successful! ``` ```catala-test-inline -$ catala Interpret_Lcalc -s Test1 --avoid_exceptions --optimize +$ catala Interpret_Lcalc -s Test1 --avoid_exceptions [RESULT] Computation successful! ```