# --------------
# Test CI for Fr
# --------------

.test-exe:
  script:
    # test the compiled executables
    - cd ${CI_PROJECT_DIR}/data
    - FrChannels test.gwf
    - FrCheck -i test.gwf
    - FrCopy -i test.gwf -o copy.gwf
    - FrDiff -i1 test.gwf -i2 copy.gwf -t D1 -d 1
    - FrDump -i test.gwf -t D1
    - FrCopy -i test.gwf -o copy2.gwf -f 0 -l 1 -r 10
    - FrTrend -s 1 -p trend- -d 5 -c D1 -f 925484670 -l 925484680 copy2.gwf
    - cd ${CI_PROJECT_DIR}

.test-python:
  script:
    # test the python bindings
    - cd ${CI_PROJECT_DIR}/test
    - python3 -m pytest -ra -v
    - cd ${CI_PROJECT_DIR}

.test:
  variables:
    # we need the git repo to test things
    GIT_STRATEGY: fetch
  stage: test
  script:
    - !reference [".test-exe", script]
    - !reference [".test-python", script]
