Register all existing tests through the new engine

I removed the '.out' extension for now to preserve the test output file names and avoid a million file renames.

This makes the patch easier to read, and we can do the rename easily in another patch afterwards, without mixing with semantic changes.

(beautiful script àlarrache:
```bash
for f in */*/output/*; do
  target_base=${f##*/}
  target_base=${target_base%%.*}
  echo $f | awk -F. '{
    f=$1"."$2; if ($4 == "") { mode=$3; id=$3 } else { scope="-s "$3; mode=$4; id=$3"."$4}
    printf "\n```catala-test {id=\"%s\"}\ncatala %s %s\n```\n",id,mode,scope;
  }' >> $(dirname $f)/../${target_base}.*; done
```
This commit is contained in:
Louis Gesbert 2022-07-08 16:23:09 +02:00
parent 66a7d2f7a3
commit 2e5050481d
146 changed files with 692 additions and 33 deletions

View File

@ -338,7 +338,7 @@ let collect_all_ninja_build
let expected_output_file =
expected_output.output_dir
^ Filename.basename expected_output.tested_filename
^ "." ^ expected_output.id ^ ".out"
^ "." ^ expected_output.id
in
let vars =
[

View File

@ -39,3 +39,19 @@ declaration scope Duration:
scope Duration:
definition i equals 10 day /^ 0 day
```
```catala-test {id="Dec.Interpret"}
catala Interpret -s Dec
```
```catala-test {id="Duration.Interpret"}
catala Interpret -s Duration
```
```catala-test {id="Int.Interpret"}
catala Interpret -s Int
```
```catala-test {id="Money.Interpret"}
catala Interpret -s Money
```

View File

@ -11,3 +11,7 @@ scope A:
definition y equals 4 - 2 - -2
definition z equals 200 / 2 * 4 - 50 / - (5 - 20 / 2)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -9,3 +9,7 @@ scope A:
definition list equals [0; 5; 6; 7; 1; 64; 12]
definition list_high_count equals number for m in list of (m >=$ $7)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -20,3 +20,11 @@ scope B:
definition y equals sum money for m in a.x of (m +$ $1)
definition z equals number for m in a.x of (m >=$ $8.95)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="B.Interpret"}
catala Interpret -s B
```

View File

@ -24,3 +24,11 @@ scope B:
definition argmax equals content maximum money initial S { -- id: -1 --income: $0 } for m in a.x of (m.income *$ 2.0)
definition argmin equals content minimum money initial S { -- id: -1 --income: $20 } for m in a.x of (m.income +$ $5)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="B.Interpret"}
catala Interpret -s B
```

View File

@ -9,3 +9,7 @@ scope A:
definition x equals [0; 1; 2] ++ [3; 4; 5; 6]
definition y equals x ++ ([7; 8; 9] ++ [10])
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -16,3 +16,11 @@ scope B:
definition y equals filter for m in a.x of (m >=$ $4.95)
definition z equals map for m in a.x of (m >=$ $4.95)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="B.Interpret"}
catala Interpret -s B
```

View File

@ -1,4 +1,4 @@
[RESULT] Computation successful! Results:
[RESULT] x =
[S {"id"= 0; "income"= $0.00}; S {"id"= 1; "income"= $9.00};
S {"id"= 2; "income"= $5.20}]
[S {"id"= 0; "income"= $0.00}; S {"id"= 1; "income"= $9.00};
S {"id"= 2; "income"= $5.20}]

View File

@ -20,3 +20,11 @@ scope B:
definition y equals exists m in a.x such that m = 9
definition z equals for all m in a.x we have m > 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="B.Interpret"}
catala Interpret -s B
```

View File

@ -8,6 +8,6 @@ scope TestXorWithInt:
definition test_var equals 10 xor 20
```
```catala-test { id = "bad" }
catala Typecheck -s TestXorWithInt
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -11,6 +11,14 @@ scope TestBool:
definition foo under condition bar < 0 consequence equals false
```
```catala-test { id = "interpret"}
```catala-test {id="Dcalc"}
catala Dcalc
```
```catala-test {id="TestBool.Interpret"}
catala Interpret -s TestBool
```
```catala-test {id="Scopelang"}
catala Scopelang
```

View File

@ -7,3 +7,7 @@ declaration scope TestBool:
scope TestBool:
definition foo equals true and not false and false = false
```
```catala-test {id="TestBool.Interpret"}
catala Interpret -s TestBool
```

View File

@ -13,3 +13,7 @@ scope TestXor:
definition t_xor_f equals true xor false
definition f_xor_f equals false xor false
```
```catala-test {id="TestXor.Interpret"}
catala Interpret -s TestXor
```

View File

@ -9,3 +9,7 @@ declaration scope DayByMonth:
scope DayByMonth:
definition d equals 1 day /^ 2 month
```
```catala-test {id="DayByMonth.Interpret"}
catala Interpret -s DayByMonth
```

View File

@ -39,3 +39,19 @@ declaration scope Ge:
scope Ge:
definition d equals 1 month >=^ 2 day
```
```catala-test {id="Ge.Interpret"}
catala Interpret -s Ge
```
```catala-test {id="Gt.Interpret"}
catala Interpret -s Gt
```
```catala-test {id="Le.Interpret"}
catala Interpret -s Le
```
```catala-test {id="Lt.Interpret"}
catala Interpret -s Lt
```

View File

@ -27,3 +27,7 @@ scope A:
definition m2 equals (2 month) *^ 3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -11,3 +11,7 @@ scope A:
definition y equals |2002-09-30|
definition z equals x -@ y
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -13,3 +13,7 @@ scope A:
definition z equals 654265429805103220650980650.5705405106540
definition a equals x /. (y *. (x +. y) *. (x *. x *. z *. z))
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -1,6 +1,6 @@
[RESULT] Computation successful! Results:
[RESULT] a =
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
-0.000000000000000000000000000000000000000000000000000000000078695580959228473468…
[RESULT] x = 84.64866565265689623
[RESULT] y = -4.3682977870532065498
[RESULT] z = 654265429805103220650980650.570540510654

View File

@ -13,3 +13,7 @@ scope A:
definition x1 equals round_decimal of x
definition y1 equals round_decimal of y
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -11,3 +11,7 @@ scope A:
definition y equals 4.368297
definition z equals x /. y
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -10,3 +10,7 @@ scope A:
definition y equals 1.0 +. (x /. 100.0)
assertion y = 1.04
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -8,3 +8,7 @@ scope A:
definition x under condition true consequence equals 1
definition x under condition true consequence equals 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -8,3 +8,7 @@ declaration scope A:
scope A:
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -11,3 +11,7 @@ scope A:
definition x under condition y = 3 consequence equals 1
definition x under condition y = 4 consequence equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -13,3 +13,7 @@ declaration scope A:
scope A:
definition e equals Case1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -14,3 +14,7 @@ scope A:
definition y equals match x with pattern
-- anything : 31
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -17,3 +17,7 @@ scope A:
-- Case3 : false
-- Case3 : true
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -6,3 +6,7 @@ declaration enumeration Foo:
declaration scope Bar:
internal foo content Foo
```
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -15,3 +15,7 @@ scope A:
-- Case1 of i : i = 0
-- Case2 of b : b
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -35,3 +35,11 @@ scope Middle_case:
-- anything : 31
-- Case1 : 42
```
```catala-test {id="First_case.Interpret"}
catala Interpret -s First_case
```
```catala-test {id="Middle_case.Interpret"}
catala Interpret -s Middle_case
```

View File

@ -27,3 +27,7 @@ scope B:
definition x equals Case2
definition y equals x with pattern Case3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -17,3 +17,7 @@ scope A:
definition x equals Case1
definition y equals x with pattern Case3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -16,3 +16,7 @@ scope A:
definition x equals Case1
definition y equals x with pattern Case3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -14,3 +14,7 @@ scope A:
definition x equals Case1 content 2
definition y equals x with pattern Case3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -20,3 +20,7 @@ scope A:
-- Case3 : false
-- Case4 : true
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -16,3 +16,7 @@ scope A:
-- Case2 : 42
-- anything : 31
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -20,3 +20,7 @@ scope A:
-- F.Case1 of i : i
-- Case2 : 3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -15,3 +15,7 @@ scope A:
definition y equals x with pattern Case1
definition z equals x with pattern Case2
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -15,3 +15,7 @@ scope A:
-- Case1 of i : 42
-- Case2 : 43
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -35,3 +35,11 @@ scope Simple_case_2:
-- Case1 of i : i
-- anything : 31
```
```catala-test {id="Simple_case_2.Interpret"}
catala Interpret -s Simple_case_2
```
```catala-test {id="Simple_case.Interpret"}
catala Interpret -s Simple_case
```

View File

@ -12,3 +12,7 @@ scope A:
exception
definition x equals 2
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -12,3 +12,7 @@ scope A:
exception base_y
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -17,3 +17,7 @@ scope A:
exception exception_x
definition x equals 2
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -8,3 +8,7 @@ scope A:
exception
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -18,3 +18,7 @@ scope A:
exception
definition y equals 3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -9,3 +9,7 @@ scope A:
exception base_y
definition y equals 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -14,3 +14,7 @@ scope A:
exception base_x
definition x equals 2
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -17,3 +17,7 @@ scope A:
definition y equals 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -11,3 +11,7 @@ scope A:
exception base_x
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -15,3 +15,7 @@ scope A:
exception exception_x
definition x equals 2
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -45,3 +45,7 @@ scope Benefit:
definition benefit under condition person.disabled consequence equals $2000
```
```catala-test {id="Benefit.Interpret"}
catala Interpret -s Benefit
```

View File

@ -18,3 +18,7 @@ scope A:
definition z equals 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -13,3 +13,7 @@ scope A:
exception
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -19,3 +19,7 @@ scope A:
exception base
definition x under condition z = 0 consequence equals 0
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -16,3 +16,7 @@ scope A:
exception
definition y equals 3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -10,3 +10,7 @@ scope A:
exception
definition x equals 1
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -16,3 +16,7 @@ scope A:
definition y equals 3
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -20,3 +20,11 @@ scope R:
definition s.f of x equals x + x * x
definition r equals s.out
```
```catala-test {id="R.Interpret"}
catala Interpret -s R
```
```catala-test {id="S.Interpret"}
catala Interpret -s S
```

View File

@ -7,3 +7,7 @@ declaration scope RecursiveFunc:
scope RecursiveFunc:
definition f of x equals f of x + 1
```
```catala-test {id="RecursiveFunc.Interpret"}
catala Interpret -s RecursiveFunc
```

View File

@ -20,3 +20,7 @@ scope R:
definition s.f of x equals x + x * x
definition r equals s.out
```
```catala-test {id="R.Interpret"}
catala Interpret -s R
```

View File

@ -14,3 +14,6 @@ scope A:
scope B:
assertion a.a = 1
```
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -14,3 +14,6 @@ scope B:
definition a.a equals 0
assertion a.a = 0
```
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -7,3 +7,6 @@ declaration scope A:
scope A:
definition a equals 0
```
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -13,3 +13,6 @@ scope A:
scope B:
assertion a.a = 0
```
```catala-test {id="Typecheck"}
catala Typecheck
```

View File

@ -16,3 +16,11 @@ scope A:
definition e equals b + c + d + 1
definition f equals e + 1
```
```catala-test {id="A.Dcalc"}
catala Dcalc -s A
```
```catala-test {id="A.Typecheck"}
catala Typecheck -s A
```

View File

@ -14,3 +14,10 @@ scope A:
scope B:
assertion a.y = 1
```
```catala-test {id="B.Dcalc"}
catala Dcalc -s B
```
```catala-test {id="B.Interpret"}
catala Interpret -s B
```

View File

@ -19,3 +19,11 @@ scope B:
definition a.b equals 2
assertion a.c = 1
```
```catala-test {id="B.Dcalc"}
catala Dcalc -s B
```
```catala-test {id="B.Typecheck"}
catala Typecheck -s B
```

View File

@ -26,3 +26,15 @@ Even after `Catala` code block:
```c
int main(void) { return 0; }
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -26,3 +26,15 @@ Even after `Catala` code block:
```c
int main(void) { return 0; }
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -26,3 +26,15 @@ Even after `Catala` code block:
```c
int main(void) { return 0; }
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -27,3 +27,11 @@ scope S:
scope S2:
definition b equals B
```
```catala-test {id="S2.Interpret"}
catala Interpret -s S2
```
```catala-test {id="S.Interpret"}
catala Interpret -s S
```

View File

@ -11,3 +11,7 @@ scope A:
definition y equals $8548,650.96
definition z equals (x *$ y)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -10,3 +10,7 @@ scope A:
definition y equals $0.3
assertion x = y
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -11,3 +11,7 @@ scope A:
definition y equals $8548,650.96
definition z equals $250,000,000 *$ ((x /$ y) *. 0.2 %)
```
```catala-test {id="A.Interpret"}
catala Interpret -s A
```

View File

@ -17,3 +17,7 @@ scope S:
definition b equals B { -- y: true -- z: 0.0}
definition a equals A { -- x: 0 -- y : b }
```
```catala-test {id="S.Interpret"}
catala Interpret -s S
```

View File

@ -9,3 +9,7 @@ scope A:
definition x equals [0; 5]
definition y under condition (number of x) > 0 consequence equals true
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -10,3 +10,7 @@ scope A:
definition y under condition (number of x) >= 0 consequence equals true
definition y under condition (number of x) = 1 consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -12,3 +12,7 @@ scope A:
definition y under condition get_year of x >= 2015 and get_year of x < 2020 consequence equals true
definition y under condition get_year of x > 2020 consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -12,3 +12,7 @@ scope A:
definition y under condition get_year of x >= 2015 and get_year of x <= 2020 consequence equals true
definition y under condition get_year of x >= 2020 consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -11,3 +11,7 @@ scope A:
definition y under condition x >=@ |2015-01-01| and x <@ |2020-01-01| consequence equals true
definition y under condition x >=@ |2020-01-01| consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -12,3 +12,7 @@ scope A:
definition y under condition x >=@ |2015-01-01| and x <@ |2020-01-01| consequence equals true
definition y under condition x >=@ |2020-01-01| consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -9,3 +9,7 @@ scope A:
definition x equals 94 day
definition y under condition (x +^ x) >^ 100 day consequence equals true
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -10,3 +10,7 @@ scope A:
definition y under condition (x +^ x) >=^ 100 day consequence equals true
definition y under condition (x +^ x) <=^ 100 day consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -20,3 +20,7 @@ scope A:
definition x under condition match y with pattern -- A of a: true -- B of b: false consequence equals 0
definition x under condition match y with pattern -- A of a: false -- B of b: false consequence equals 1
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -20,3 +20,7 @@ scope A:
definition x under condition match y with pattern -- A of a: true -- B of b: false consequence equals 0
definition x under condition match y with pattern -- A of a: true -- B of b: true consequence equals 1
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -13,3 +13,7 @@ scope A:
definition x equals C1
definition y under condition x = C1 consequence equals 1
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -15,3 +15,7 @@ scope A:
definition y under condition x = C2 consequence equals 2
definition y under condition x = C2 consequence equals 3
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -18,3 +18,7 @@ scope A:
-- Case1 of i : false
-- Case2 : true consequence equals 2
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -18,3 +18,7 @@ scope A:
-- Case1 of i : false
-- Case2 : true consequence equals 4
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -13,3 +13,7 @@ scope A:
definition y under condition x >=$ $10,000 and x <$ $100,000 consequence equals true
definition y under condition x >=$ $100,000 consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -14,3 +14,7 @@ scope A:
definition y under condition x >=$ $10,000 and x <$ $100,000 consequence equals true
definition y under condition x >=$ $100,000 consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -15,3 +15,6 @@ scope A:
definition y under condition x >= 0 consequence equals 1
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -14,3 +14,6 @@ scope A:
definition y under condition x >= 2 consequence equals 1
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -120,3 +120,7 @@ scope Amount:
consequence equals
80 * number_of_advisors
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -9,3 +9,7 @@ scope A:
definition x equals 1.
definition y under condition x >. 1./.3. consequence equals true
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

View File

@ -10,3 +10,7 @@ scope A:
definition y under condition x >=. 1./.3. consequence equals true
definition y under condition x <=. 1./.3. consequence equals false
```
```catala-test {id="Proof"}
catala Proof --disable_counterexamples
```

Some files were not shown because too many files have changed in this diff Show More