summaryrefslogtreecommitdiff
path: root/tests/farm/annotate
diff options
context:
space:
mode:
Diffstat (limited to 'tests/farm/annotate')
-rw-r--r--tests/farm/annotate/annotate_dir.py7
-rw-r--r--tests/farm/annotate/gold/white.py,cover33
-rw-r--r--tests/farm/annotate/gold_anno_dir/a___init__.py,cover0
-rw-r--r--tests/farm/annotate/gold_anno_dir/a_a.py,cover5
-rw-r--r--tests/farm/annotate/gold_anno_dir/b___init__.py,cover0
-rw-r--r--tests/farm/annotate/gold_anno_dir/b_b.py,cover3
-rw-r--r--tests/farm/annotate/gold_anno_dir/multi.py,cover5
-rw-r--r--tests/farm/annotate/gold_multi/a/__init__.py,cover0
-rw-r--r--tests/farm/annotate/gold_multi/a/a.py,cover5
-rw-r--r--tests/farm/annotate/gold_multi/b/__init__.py,cover0
-rw-r--r--tests/farm/annotate/gold_multi/b/b.py,cover2
-rw-r--r--tests/farm/annotate/gold_multi/multi.py,cover5
-rw-r--r--tests/farm/annotate/gold_v24/white.py,cover33
-rw-r--r--tests/farm/annotate/run.py7
-rw-r--r--tests/farm/annotate/run_multi.py7
-rw-r--r--tests/farm/annotate/src/a/__init__.py0
-rw-r--r--tests/farm/annotate/src/a/a.py5
-rw-r--r--tests/farm/annotate/src/b/__init__.py0
-rw-r--r--tests/farm/annotate/src/b/b.py3
-rw-r--r--tests/farm/annotate/src/multi.py5
-rw-r--r--tests/farm/annotate/src/white.py33
21 files changed, 158 insertions, 0 deletions
diff --git a/tests/farm/annotate/annotate_dir.py b/tests/farm/annotate/annotate_dir.py
new file mode 100644
index 00000000..3e37f9ed
--- /dev/null
+++ b/tests/farm/annotate/annotate_dir.py
@@ -0,0 +1,7 @@
+copy("src", "run")
+run("""
+ coverage -e -x multi.py
+ coverage -a -d out_anno_dir
+ """, rundir="run")
+compare("run/out_anno_dir", "gold_anno_dir", "*,cover", left_extra=True)
+clean("run")
diff --git a/tests/farm/annotate/gold/white.py,cover b/tests/farm/annotate/gold/white.py,cover
new file mode 100644
index 00000000..36b0b993
--- /dev/null
+++ b/tests/farm/annotate/gold/white.py,cover
@@ -0,0 +1,33 @@
+ # A test case sent to me by Steve White
+
+> def f(self):
+! if self==1:
+! pass
+! elif self.m('fred'):
+! pass
+! elif (g==1) and (b==2):
+! pass
+! elif self.m('fred')==True:
+! pass
+! elif ((g==1) and (b==2))==True:
+! pass
+! else:
+! pass
+
+> def g(x):
+> if x == 1:
+> a = 1
+! else:
+! a = 2
+
+> g(1)
+
+> def h(x):
+- if 0: #pragma: no cover
+- pass
+> if x == 1:
+! a = 1
+> else:
+> a = 2
+
+> h(2)
diff --git a/tests/farm/annotate/gold_anno_dir/a___init__.py,cover b/tests/farm/annotate/gold_anno_dir/a___init__.py,cover
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/gold_anno_dir/a___init__.py,cover
diff --git a/tests/farm/annotate/gold_anno_dir/a_a.py,cover b/tests/farm/annotate/gold_anno_dir/a_a.py,cover
new file mode 100644
index 00000000..d0ff3c0c
--- /dev/null
+++ b/tests/farm/annotate/gold_anno_dir/a_a.py,cover
@@ -0,0 +1,5 @@
+> def a(x):
+> if x == 1:
+> print("x is 1")
+! else:
+! print("x is not 1")
diff --git a/tests/farm/annotate/gold_anno_dir/b___init__.py,cover b/tests/farm/annotate/gold_anno_dir/b___init__.py,cover
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/gold_anno_dir/b___init__.py,cover
diff --git a/tests/farm/annotate/gold_anno_dir/b_b.py,cover b/tests/farm/annotate/gold_anno_dir/b_b.py,cover
new file mode 100644
index 00000000..90d076f1
--- /dev/null
+++ b/tests/farm/annotate/gold_anno_dir/b_b.py,cover
@@ -0,0 +1,3 @@
+> def b(x):
+> msg = "x is %s" % x
+> print(msg)
diff --git a/tests/farm/annotate/gold_anno_dir/multi.py,cover b/tests/farm/annotate/gold_anno_dir/multi.py,cover
new file mode 100644
index 00000000..2a5c59ce
--- /dev/null
+++ b/tests/farm/annotate/gold_anno_dir/multi.py,cover
@@ -0,0 +1,5 @@
+> import a.a
+> import b.b
+
+> a.a.a(1)
+> b.b.b(2)
diff --git a/tests/farm/annotate/gold_multi/a/__init__.py,cover b/tests/farm/annotate/gold_multi/a/__init__.py,cover
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/gold_multi/a/__init__.py,cover
diff --git a/tests/farm/annotate/gold_multi/a/a.py,cover b/tests/farm/annotate/gold_multi/a/a.py,cover
new file mode 100644
index 00000000..fb3f5435
--- /dev/null
+++ b/tests/farm/annotate/gold_multi/a/a.py,cover
@@ -0,0 +1,5 @@
+> def a(x):
+> if x == 1:
+> print "x is 1"
+! else:
+! print "x is not 1"
diff --git a/tests/farm/annotate/gold_multi/b/__init__.py,cover b/tests/farm/annotate/gold_multi/b/__init__.py,cover
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/gold_multi/b/__init__.py,cover
diff --git a/tests/farm/annotate/gold_multi/b/b.py,cover b/tests/farm/annotate/gold_multi/b/b.py,cover
new file mode 100644
index 00000000..a3f5daec
--- /dev/null
+++ b/tests/farm/annotate/gold_multi/b/b.py,cover
@@ -0,0 +1,2 @@
+> def b(x):
+> print "x is %s" % x
diff --git a/tests/farm/annotate/gold_multi/multi.py,cover b/tests/farm/annotate/gold_multi/multi.py,cover
new file mode 100644
index 00000000..2a5c59ce
--- /dev/null
+++ b/tests/farm/annotate/gold_multi/multi.py,cover
@@ -0,0 +1,5 @@
+> import a.a
+> import b.b
+
+> a.a.a(1)
+> b.b.b(2)
diff --git a/tests/farm/annotate/gold_v24/white.py,cover b/tests/farm/annotate/gold_v24/white.py,cover
new file mode 100644
index 00000000..bbd8d428
--- /dev/null
+++ b/tests/farm/annotate/gold_v24/white.py,cover
@@ -0,0 +1,33 @@
+ # A test case sent to me by Steve White
+
+> def f(self):
+! if self==1:
+! pass
+! elif self.m('fred'):
+! pass
+! elif (g==1) and (b==2):
+! pass
+! elif self.m('fred')==True:
+! pass
+! elif ((g==1) and (b==2))==True:
+! pass
+> else:
+! pass
+
+> def g(x):
+> if x == 1:
+> a = 1
+! else:
+! a = 2
+
+> g(1)
+
+> def h(x):
+- if 0: #pragma: no cover
+- pass
+> if x == 1:
+! a = 1
+> else:
+> a = 2
+
+> h(2)
diff --git a/tests/farm/annotate/run.py b/tests/farm/annotate/run.py
new file mode 100644
index 00000000..c645f21c
--- /dev/null
+++ b/tests/farm/annotate/run.py
@@ -0,0 +1,7 @@
+copy("src", "out")
+run("""
+ coverage -e -x white.py
+ coverage -a white.py
+ """, rundir="out")
+compare("out", "gold", "*,cover")
+clean("out")
diff --git a/tests/farm/annotate/run_multi.py b/tests/farm/annotate/run_multi.py
new file mode 100644
index 00000000..4e8252ed
--- /dev/null
+++ b/tests/farm/annotate/run_multi.py
@@ -0,0 +1,7 @@
+copy("src", "out_multi")
+run("""
+ coverage -e -x multi.py
+ coverage -a
+ """, rundir="out_multi")
+compare("out_multi", "gold_multi", "*,cover")
+clean("out_multi")
diff --git a/tests/farm/annotate/src/a/__init__.py b/tests/farm/annotate/src/a/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/src/a/__init__.py
diff --git a/tests/farm/annotate/src/a/a.py b/tests/farm/annotate/src/a/a.py
new file mode 100644
index 00000000..c2583d1e
--- /dev/null
+++ b/tests/farm/annotate/src/a/a.py
@@ -0,0 +1,5 @@
+def a(x):
+ if x == 1:
+ print("x is 1")
+ else:
+ print("x is not 1")
diff --git a/tests/farm/annotate/src/b/__init__.py b/tests/farm/annotate/src/b/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/farm/annotate/src/b/__init__.py
diff --git a/tests/farm/annotate/src/b/b.py b/tests/farm/annotate/src/b/b.py
new file mode 100644
index 00000000..625a5490
--- /dev/null
+++ b/tests/farm/annotate/src/b/b.py
@@ -0,0 +1,3 @@
+def b(x):
+ msg = "x is %s" % x
+ print(msg)
diff --git a/tests/farm/annotate/src/multi.py b/tests/farm/annotate/src/multi.py
new file mode 100644
index 00000000..19a6200c
--- /dev/null
+++ b/tests/farm/annotate/src/multi.py
@@ -0,0 +1,5 @@
+import a.a
+import b.b
+
+a.a.a(1)
+b.b.b(2)
diff --git a/tests/farm/annotate/src/white.py b/tests/farm/annotate/src/white.py
new file mode 100644
index 00000000..ecbbd25a
--- /dev/null
+++ b/tests/farm/annotate/src/white.py
@@ -0,0 +1,33 @@
+# A test case sent to me by Steve White
+
+def f(self):
+ if self==1:
+ pass
+ elif self.m('fred'):
+ pass
+ elif (g==1) and (b==2):
+ pass
+ elif self.m('fred')==True:
+ pass
+ elif ((g==1) and (b==2))==True:
+ pass
+ else:
+ pass
+
+def g(x):
+ if x == 1:
+ a = 1
+ else:
+ a = 2
+
+g(1)
+
+def h(x):
+ if 0: #pragma: no cover
+ pass
+ if x == 1:
+ a = 1
+ else:
+ a = 2
+
+h(2)