test_task:
  env:
    ELVISH_TEST_TIME_SCALE: 20
  go_modules_cache:
    fingerprint_script: cat go.sum
    folder: $GOPATH/pkg/mod
  matrix:
    - name: Test on gccgo
      container:
        image: debian:unstable-slim
      setup_script:
        - apt-get -y update
        - apt-get -y install ca-certificates gccgo-go
      env:
        # gccgo doesn't support race test
        TEST_FLAG: ""
    - name: Test on FreeBSD
      freebsd_instance:
        image_family: freebsd-12-1
      setup_script: pkg install -y go
      env:
        GOPATH: $HOME/go
        TEST_FLAG: -race
  go_version_script: go version
  test_script: go test $TEST_FLAG ./...
