-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
42 lines (39 loc) · 2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
language: python
python: "3.6"
dist: xenial
sudo: required
before_script:
- sudo apt update
- sudo apt install -y autoconf imagemagick mercurial unzip
# configure imagemagick policies
- sudo sed -i -e 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read|write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml
# clone and install ghostscript
- git clone --depth 1 git://git.ghostscript.com/ghostpdl.git
- cd ghostpdl/ && bash autogen.sh && bash configure && make && sudo make install
- cd ../
script:
- echo "@ Executing tests..."
- cd bin/
- python tests/tests.py
# execute test conversion #1 (color and resize)
- echo "@@ Test pdf conversion 1 (color and resize)"
- sudo convert -density 100 tests/scanned/two_scanned_sheets.pdf -resize 594x841 converted.png
# execute test converion #2 (monochrome)
- echo "@@ Test pdf conversion 2 (monochrome)"
- sudo convert tests/scanned/two_scanned_sheets.pdf -threshold 90% converted.png
# execute normal run (include pdf to png conversion)
- echo "@@ Execute normal run (include pdf to png conversion)"
- python3 examQuestionnaireScanner.py tests/scanned/ tests/input_data/FormScanner_test_template.xtmpl tests/input_data/test_student_info.csv
- cat final_grades.csv | sort | sed 's/<//g' >> outputFile.txt
- cat tests/input_data/grades_final_expected.csv | sort | sed 's/>//g'>> expectedFile.txt
#- cat outputFile.txt
#- cat expectedFile.txt
- diff -s outputFile.txt expectedFile.txt
# execute fast run (skip pdf conversion)
- echo "@@ Execute fast run (skip pdf to png conversion)"
- python3 examQuestionnaireScanner.py --skip_pdf_conversion tests/converted_pngs tests/input_data/FormScanner_test_template.xtmpl tests/input_data/test_student_info.csv
- cat final_grades.csv | sort | sed 's/<//g' >> outputFile.txt
- cat tests/input_data/grades_final_expected.csv | sort | sed 's/>//g'>> expectedFile.txt
#- cat outputFile.txt
#- cat expectedFile.txt
- diff -s outputFile.txt expectedFile.txt