-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
27 lines (18 loc) · 849 Bytes
/
tests.py
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
import subprocess
subprocess.call(['g++ -fprofile-arcs -ftest-coverage -fPIC -O0 calculator.c -o calculator'], shell=True)
def test_add():
subprocess.call(['./calculator 1 + 1'], shell=True)
subprocess.call(['gcovr -r . -o add.txt'], shell=True)
subprocess.call(['rm *.gcno'], shell=True)
def test_sub():
subprocess.call(['./calculator 1 - 1'], shell=True)
subprocess.call(['gcovr -r . -o sub.txt'], shell=True)
subprocess.call(['rm *.gcno'], shell=True)
def test_multiply():
subprocess.call(['./calculator 1 _ 1'], shell=True)
subprocess.call(['gcovr -r . -o mul.txt'], shell=True)
subprocess.call(['rm *.gcno'], shell=True)
def test_div():
subprocess.call(['./calculator 1 / 1'], shell=True)
subprocess.call(['gcovr -r . -o div.txt'], shell=True)
subprocess.call(['rm *.gcno'], shell=True)