this repo has no description
at main 38 lines 886 B view raw
1#! /bin/bash 2 3# ./corpus.sh scans all .cmti and .cmt, and optionally .cmi files, in the 4# current opam switch. For each one, it runs odoc compile, which triggers the 5# odoc parser on every comment found. If any errors or warnings are reported by 6# the parser, they will be written to stderr. 7# 8# A corpus of .cmt[i] files is typically installed with something like 9# 10# opam install lwt --criteria='+count(solution)' 11# 12# 13# Typical usage is somehing like: 14# 15# ./corpus.sh > results.txt 2>&1 16 17SWITCH=$(opam config var prefix) 18 19CMTI=$(find $SWITCH/lib -name '*.cmti') 20CMT=$(find $SWITCH/lib -name '*.cmt') 21# CMI=$(find $SWITCH/lib -name '*.cmi') 22 23mkdir -p _build/ 24 25function apply_odoc 26{ 27 FILES=$1 28 29 for FILE in $FILES 30 do 31 echo $FILE 32 odoc compile --package corpus -o _build/file.odoc $FILE 2>&1 33 done 34} 35 36apply_odoc "$CMTI" 37apply_odoc "$CMT" 38# apply_odoc "$CMI"