File: dune

package info (click to toggle)
ocaml-multicoretests 0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,520 kB
  • sloc: ml: 8,909; awk: 66; ansic: 23; makefile: 11; sh: 1
file content (81 lines) | stat: -rw-r--r-- 2,007 bytes parent folder | download | duplicates (2)
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
71
72
73
74
75
76
77
78
79
80
81
(env
 (debug-runtime
  (link_flags :standard -runtime-variant=d)
  (env-vars
   (MCTUTILS_TRUNCATE 50)))
 (_
  (env-vars
   (MCTUTILS_TRUNCATE 50)))
)

(vendored_dirs qcheck)

;; make `dune build` target a recursive default target
(alias
 (name default)
 (package multicoretests)
 (deps (alias src/default)))

; The main test alias
(alias
 (name testsuite)
 (package multicoretests)
 (deps
  (alias_rec src/runtest)))

; The internal tests alias
(alias
 (name internaltests)
 (package multicoretests)
 (deps
  (alias_rec test/runtest)))

; The aliases to control what is run in CI
; It can either be the full test suite, or focus on a single test
(alias
 (name ci)
 (package multicoretests)
 (deps
  (alias_rec %{env:DUNE_CI_ALIAS=testsuite})))
  ; (alias_rec focusedtest)))

; @focusedtest
; repeat a single test a couple of times
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; A rule to repeat the test executable given as dependency a couple of
; times and report at the end whether this worked

; To change the test to repeat, change the source of the `copy`:
(rule
 (copy src/io/lin_tests_domain.exe focusedtest.exe))

(rule
 (alias focusedtest)
 (package multicoretests)
 (deps focusedtest.exe)
 (enabled_if (<> %{os_type} Win32))
 (action
  (no-infer
   (progn
    (write-file hoped "")
    (write-file failed-runs "")
    (bash
     "for i in `seq 20`; do echo Starting $i-th run; if ! ./focusedtest.exe -v ; then echo $i >> failed-runs; fi; done")
    ; edit the previous line to focus on a particular seed
    (diff failed-runs hoped)))))

(rule
 (alias focusedtest)
 (package multicoretests)
 (deps focusedtest.exe)
 (enabled_if (= %{os_type} Win32))
 (action
  (no-infer
   (progn
    (write-file hoped "")
    (write-file failed-runs "")
    (run cmd /q /c
     "for %G in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20) do (echo Starting %G-th run && focusedtest.exe -v || echo %G >> failed-runs)")
    ; edit the previous line to focus on a particular seed
    (diff failed-runs hoped)))))