matrix:
  include:
    - language: c
      sudo: required
      compiler: gcc
      env:
      - VALGRIND_TEST_ON=1
      before_install:
      - sudo apt-get install -qq valgrind
      - sudo apt-get update
      - sudo apt-get install python2.7
      script:
      - make
      - sudo python setup.py install
      - python test/test.py
      - python test/test_oldindex.py
      - source test/test_c.sh  # valgrind test is applied when VALGRIND_TEST_ON=1
      - source test/test_c_oldindex.sh  # test for old index
    - language: c
      sudo: required
      compiler: gcc
      env:
      - VALGRIND_TEST_ON=1
      before_install:
      - sudo apt-get install -qq valgrind
      - sudo apt-get update
      - sudo apt-get install python3.6
      script:
      - make
      - sudo python setup.py install
      - python test/test.py
      - python test/test_oldindex.py
      - source test/test_c.sh  # valgrind test is applied when VALGRIND_TEST_ON=1
      - source test/test_c_oldindex.sh  # test for old index

matrix:
  include:
    - language: c
      sudo: required
      compiler: gcc
      env:
      - VALGRIND_TEST_ON=1
      before_install:
      - sudo apt-get install -qq valgrind
      - sudo apt-get update
      - sudo apt-get install python2.7
      script:
      - make
      - sudo python setup.py install
      - python test/test.py
      - python test/test_oldindex.py
      - source test/test_c.sh  # valgrind test is applied when VALGRIND_TEST_ON=1
      - source test/test_c_oldindex.sh  # test for old index
    - language: c
      sudo: required
      compiler: gcc
      env:
      - VALGRIND_TEST_ON=1
      before_install:
      - sudo apt-get install -qq valgrind
      - sudo apt-get update
      - sudo apt-get install python3.5
      script:
      - make
      - sudo python setup.py install
      - python test/test.py
      - python test/test_oldindex.py

Use 3.5 and only run c tests in 2.7 block
Use 3.5 and only run c tests in 2.7 block
