<commit_before>OPAM_DEPENDS=
         
setup_linux () {
  case "$OCAML_VERSION,$OPAM_VERSION" in
  4.02.1,1.2.0) ppa=avsm/ocaml42+opam12 ;;
  4.02.1,1.1.0) ppa=avsm/ocaml42+opam11 ;;
  4.01.0,1.2.0) ppa=avsm/ocaml41+opam12 ;;
  4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;;
  *) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
  esac

  export OPAMYES=1
  # We could in theory tell opam to init with a particular version of ocaml,
  # but this is much slower than using the ppa & apt
  opam init -a -y
  # TODO: Install js_of_ocaml and test the parser
  # opam install ${OPAM_DEPENDS}
  eval `opam config env`

  export FLOW_RUNTESTS_PARALLELISM=4
}

setup_osx () {
  case $OCAML_VERSION in
  4.02.1)
    brew update
    brew install ocaml ;;
  4.01.0) 
    brew install ocaml ;;
  *) echo Unknown $OCAML_VERSION; exit 1 ;;
  esac

  # TODO: Figure out how to get opam to run in travis.
  # 1.2.0 fails due to https://github.com/ocaml/opam/issues/1853
  # 1.1.0 fails due to :
  #  'opam init -a -y' failed.
  #  Fatal error:
  #  Sys_error("/Users/travis/.opam/repo/default/packages/ott/ott.0.21.2/opam: Too many open files")
}

case $TRAVIS_OS_NAME in
  osx) setup_osx ;;
linux) setup_linux ;;
esac

make
make test<commit_msg>A little more cleaning up<commit_after>OPAM_DEPENDS=
         
setup_linux () {
  case "$OCAML_VERSION,$OPAM_VERSION" in
  4.02.1,1.2.0) ppa=avsm/ocaml42+opam12 ;;
  4.02.1,1.1.0) ppa=avsm/ocaml42+opam11 ;;
  4.01.0,1.2.0) ppa=avsm/ocaml41+opam12 ;;
  4.01.0,1.1.0) ppa=avsm/ocaml41+opam11 ;;
  *) echo Unknown $OCAML_VERSION,$OPAM_VERSION; exit 1 ;;
  esac

  export OPAMYES=1
  # We could in theory tell opam to init with a particular version of ocaml,
  # but this is much slower than using the ppa & apt
  opam init -a -y
  # TODO: Install js_of_ocaml and test the parser
  # opam install ${OPAM_DEPENDS}
  eval `opam config env`

  # For some reason the Linux containers start killing the tests if too many
  # tests are run in parallel. Luckily we can easily configure that here
  export FLOW_RUNTESTS_PARALLELISM=4
}

setup_osx () {
  case $OCAML_VERSION in
  4.02.1)
    brew update
    brew install ocaml ;;
  4.01.0) 
    brew install ocaml ;;
  *) echo Unknown $OCAML_VERSION; exit 1 ;;
  esac

  # TODO: Figure out how to get opam to run in travis.
  # 1.2.0 fails due to https://github.com/ocaml/opam/issues/1853
  # 1.1.0 fails due to :
  #  'opam init -a -y' failed.
  #  Fatal error:
  #  Sys_error("/Users/travis/.opam/repo/default/packages/ott/ott.0.21.2/opam: Too many open files")
}

case $TRAVIS_OS_NAME in
  osx) setup_osx ;;
linux) setup_linux ;;
esac

make
make test
{'fraction_non_alphanumeric': 0.11879297173414821, 'fraction_numerical': 0.053475935828877004, 'mean_word_length': 3.150554675118859, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4349619', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1066, 'n_words': 284}