forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][test] Rewrote test using command substitution to work with li…
…t internal shell syntax (llvm#105902) This patch rewrites a test that uses command substitution `$()` and the `stat` command, which are not supported by lit's internal shell. Instead of using this syntax to perform the file size comparison done in this test, a Python script is used instead to perform the same operation. Fixes llvm#102384.
- Loading branch information
1 parent
7284e0f
commit 4caf019
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This program takes in two file path arguments in the form 'compare-file-size.py file1 file2' | ||
# Returns true if the file size of the file1 is smaller than the file size of file2 | ||
|
||
import argparse | ||
import os | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
|
||
parser.add_argument("file1", type=str) | ||
parser.add_argument("file2", type=str) | ||
|
||
args = parser.parse_args() | ||
|
||
return os.path.getsize(args.file1) < os.path.getsize(args.file2) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters