Author: Richard Plangger <[email protected]>
Branch: vmprof-native
Changeset: r90077:f4f98e95445a
Date: 2017-02-13 11:59 +0100
http://bitbucket.org/pypy/pypy/changeset/f4f98e95445a/
Log: check that vmprof/vmprof-python is in sync with pypy repo (as done
for cffi), not having this test diverges the two code bases
diff --git a/rpython/rlib/rvmprof/test/test_file.py
b/rpython/rlib/rvmprof/test/test_file.py
new file mode 100644
--- /dev/null
+++ b/rpython/rlib/rvmprof/test/test_file.py
@@ -0,0 +1,26 @@
+import os
+import urllib2, py
+from os.path import join
+
+
+def github_raw_file(repo, path, branch='master'):
+ return
"https://raw.githubusercontent.com/{repo}/{branch}/{path}".format(**dict(
+ repo=repo, path=path, branch=branch
+ ))
+
+
+def test_same_file():
+ for root, dirs, files in os.walk('rpython/rlib/rvmprof/src/shared'):
+ for file in files:
+ if not (file.endswith(".c") or file.endswith(".h")):
+ continue
+ url = github_raw_file("vmprof/vmprof-python", "src/%s" % file)
+ source = urllib2.urlopen(url).read()
+ #
+ dest = py.path.local(join(root, file)).read()
+ if source != dest:
+ raise AssertionError("%s was updated, but changes were"
+ "not copied over to PyPy" % url)
+ else:
+ print("%s matches" % url)
+ break # do not walk dirs
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit