aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/test/program.lux
blob: 5600c323dabc36100fbe3edd1bc1e9dc9f3ca280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(.module:
  [lux #*
   ["_" test (#+ Test)]
   [abstract
    [monad (#+ do)]]
   [control
    ["." io]
    [parser
     [cli (#+ program:)]]]
   [data
    ["." error]]
   [math
    ["r" random]]]
  [spec
   ["." compositor (#+ Runner Definer)
    [generation
     ["." primitive]
     ["." structure]
     ["." reference]
     ["." case]
     ["." function]
     ["." common]]]]
  {1
   ["." /]}
  ## [test
  ##  [luxc
  ##   [lang
  ##    [translation
  ##     ## ["_.T" jvm]
  ##     ## ["_.T" js]
  ##     ## ["_.T" lua]
  ##     ## ["_.T" ruby]
  ##     ## ["_.T" python]
  ##     ## ["_.T" r]
  ##     ## ["_.T" scheme]
  ##     ## ["_.T" common-lisp]
  ##     ## ["_.T" php]
  ##     ]]]]
  )

(def: (test runner definer)
  (-> Runner Definer Test)
  ($_ _.and
      (primitive.spec runner)
      (structure.spec runner)
      (reference.spec runner definer)
      (case.spec runner)
      (function.spec runner)
      (common.spec runner)
      ))

(program: args
  (<| io.io
      _.run!
      ## (_.times 100)
      (_.seed 1985013625126912890)
      (do r.monad
        [_ (wrap [])
         #let [?runner,definer (io.run (do io.monad
                                         [platform /.jvm]
                                         (compositor.executors platform
                                                               /.bundle
                                                               /.expander
                                                               /.program)))]]
        (case ?runner,definer
          (#error.Success [runner definer])
          (..test runner definer)

          (#error.Failure error)
          (_.fail error)))))