Explorar o código

Added remove step in tests to force rebuild

Found by user iamscottmoyers, this was an interesting bug with the test
system. If the new test.c file is generated fast enough, it may not have
a new timestamp and not get recompiled.

To fix, we can remove the specific files that need to be rebuilt (lfs and
test.o).
Christopher Haster %!s(int64=8) %!d(string=hai) anos
pai
achega
3ef4847434
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      tests/test.py

+ 8 - 0
tests/test.py

@@ -21,9 +21,17 @@ def generate(test):
         else:
             lines.append(line)
 
+    # Create test file
     with open('test.c', 'w') as file:
         file.write(template.format(tests='\n'.join(lines)))
 
+    # Remove build artifacts to force rebuild
+    try:
+        os.remove('test.o')
+        os.remove('lfs')
+    except OSError:
+        pass
+
 def compile():
     os.environ['CFLAGS'] = os.environ.get('CFLAGS', '') + ' -Werror'
     subprocess.check_call(['make', '--no-print-directory', '-s'], env=os.environ)