-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass environment in all CMake calls and add UTs (#236)
- Loading branch information
Showing
6 changed files
with
621 additions
and
25 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 |
---|---|---|
|
@@ -243,6 +243,7 @@ subparser | |
Subproc | ||
subtopology | ||
sys | ||
symlink | ||
tcanham | ||
Tcp | ||
td | ||
|
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
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
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
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,36 @@ | ||
#!/usr/bin/env python | ||
""" Fake CMake script for testing purposes | ||
This script can be added to the front of the path to echo what arguments are sent to CMake allowing for tests that are | ||
slightly closer to integration tests without involving the entirety of F Prime. | ||
""" | ||
import sys | ||
import os | ||
from pathlib import Path | ||
import json | ||
|
||
if __name__ == "__main__": | ||
print("[INFO] Running echoer program (stdout)") | ||
print("[INFO] Running echoer program (stderr)", file=sys.stderr) | ||
executable_path = Path(sys.argv[0]) | ||
for i in range(0, 100): | ||
output_file_path = ( | ||
executable_path.parent / f"faux-{executable_path.name}-{i}.json" | ||
) | ||
if not output_file_path.exists(): | ||
with open(output_file_path, "w") as output_file: | ||
json.dump( | ||
{ | ||
"arguments": sys.argv, | ||
"cwd": str(Path.cwd()), | ||
"environment": dict(os.environ), | ||
}, | ||
output_file, | ||
) | ||
break | ||
else: | ||
print( | ||
f"[ERROR] Too many invocations of: {executable_path.name}", file=sys.stderr | ||
) | ||
sys.exit(1) | ||
sys.exit(0) |
Oops, something went wrong.