Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2018-01-29 18:43:49 +0300
committerChristopher Haster <chaster@utexas.edu>2018-01-30 03:37:41 +0300
commit3ef4847434bbf9e8224000c3a76fe3dff90ee250 (patch)
tree94ccfcc0609024405a29b61d6c4586dce375fce2 /tests
parentf694b14afb37cd467deeb7867809a5083fd23bb9 (diff)
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).
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test.py b/tests/test.py
index aa125c7..fcbb826 100755
--- a/tests/test.py
+++ b/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)