SeattleTestbed / utf

Unit Test Framework for SeattleTestbed
MIT License
1 stars 9 forks source link

Rename Repy-based tests to `.r2py` #76

Open aaaaalbert opened 8 years ago

aaaaalbert commented 8 years ago

We have a bunch of Repy-based unit test cases whose filenames still end in .py. (This file extension used to be a requirement by utf.py, but isn't anymore.) The file extension is technically irrelevant to utf.py anyway, as #pragma repy is the actual signal that a test case should run in a sandbox. However, it's good to signal this to the human reader in a simple way too.

Let's clean this up in all of our repos, and rename all Repy-based tests to .r2py!

lukpueh commented 8 years ago

This could come in handy:


# Iterate through unit test files in current directory and subdirectories
# where filename starts with "ut_" ends with ".py" and file contains "#pragma repy"
# and change the extension from ".py" to ".r2py"
# Latter uses Shell Parameter Expansion
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion

for fullfilename in `grep -lr "#pragma repy" --include ut_*\.py .`; do mv $fullfilename "${fullfilename%.*}.r2py"; done