The golden-files shouldn't contain my username.

The tool tests wouldn't have passed anywhere else. There are still
some instances to fix.
This commit is contained in:
Andrew Hamilton 2016-09-30 09:47:58 +02:00
parent d684f0b42b
commit 6c58d305bb
5 changed files with 38 additions and 30 deletions

View file

@ -1,6 +1,6 @@
===SORRY!===
Two terms in a row across lines (missing semicolon or comma?)
at /home/ahamilton/code/vigil/golden-files/./input/perl6.p6:30
at /tmp/vigil/golden-files/./input/perl6.p6:30
------> say 'Hello from Perl 6!'⏏<EOL>
expecting any of:
infix
@ -11,6 +11,6 @@ at /home/ahamilton/code/vigil/golden-files/./input/perl6.p6:30
statement modifier loop
Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?)
at /home/ahamilton/code/vigil/golden-files/./input/perl6.p6:11
at /tmp/vigil/golden-files/./input/perl6.p6:11
------> regex ⏏http-verb {

View file

@ -1,6 +1,6 @@
===SORRY!===
Two terms in a row across lines (missing semicolon or comma?)
at /home/ahamilton/code/vigil/golden-files/./input/perl6.pl:30
at /tmp/vigil/golden-files/./input/perl6.pl:30
------> say 'Hello from Perl 6!'⏏<EOL>
expecting any of:
infix
@ -11,6 +11,6 @@ at /home/ahamilton/code/vigil/golden-files/./input/perl6.pl:30
statement modifier loop
Other potential difficulties:
Useless declaration of a has-scoped method in mainline (did you mean 'my regex http-verb'?)
at /home/ahamilton/code/vigil/golden-files/./input/perl6.pl:11
at /tmp/vigil/golden-files/./input/perl6.pl:11
------> regex ⏏http-verb {

View file

@ -7,6 +7,6 @@ FUNCTIONS
hi()
FILE
/home/ahamilton/code/vigil/golden-files/input/hi3.py
/tmp/vigil/golden-files/input/hi3.py

View file

@ -4,7 +4,7 @@ NAME
hi
FILE
/home/ahamilton/code/vigil/golden-files/input/hi.py
/tmp/vigil/golden-files/input/hi.py
FUNCTIONS
hi()

View file

@ -5,6 +5,7 @@
import contextlib
import os
import subprocess
import unittest
import unittest.mock
@ -15,6 +16,7 @@ import tools
os.environ["TZ"] = "GMT"
VIGIL_ROOT = os.path.dirname(__file__)
TMP_ROOT = "/tmp/vigil"
def widget_to_string(widget):
@ -38,7 +40,7 @@ def result_path(tool, input_filename):
def run_tool(tool, input_filename):
with chdir(os.path.join(VIGIL_ROOT, "golden-files")):
with chdir(os.path.join(TMP_ROOT, "golden-files")):
return tool(os.path.join(".", "input", input_filename))
@ -209,4 +211,10 @@ class LruCacheWithEvictionTestCase(unittest.TestCase):
if __name__ == "__main__":
os.makedirs(TMP_ROOT, exist_ok=True)
subprocess.check_call(["sudo", "mount", "--bind", VIGIL_ROOT, TMP_ROOT])
try:
golden.main()
finally:
subprocess.check_call(["sudo", "umount", "--lazy", TMP_ROOT])
os.rmdir(TMP_ROOT)