-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check_path.py test to verify existing path elements are maintained
- Loading branch information
Showing
3 changed files
with
45 additions
and
5 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,34 @@ | ||
#!/usr/bin/env python3 | ||
# Given a previous path check that the current path | ||
# contains all the same elements in the same order | ||
# with no elements removed. | ||
|
||
import os | ||
import sys | ||
|
||
|
||
old_path = sys.argv[1].split(os.pathsep) | ||
new_path = os.environ['PATH'].split(os.pathsep) | ||
|
||
paths_added = [p for p in new_path if p not in old_path] | ||
paths_preserved = [p for p in new_path if p in old_path] | ||
|
||
print('verifying path elemnts have been preserved') | ||
print('old: %s' % old_path) | ||
print('new: %s' % new_path) | ||
|
||
for p in old_path: | ||
if p not in paths_preserved: | ||
print('path not reserved: ' + p) | ||
sys.exit(1) | ||
|
||
# Check that ordering matches too. | ||
if old_path != paths_preserved: | ||
print('preserved paths don\'t match original path:') | ||
print('old:') | ||
for p in old_path: | ||
print(' - ' + p) | ||
print('preserved:') | ||
for p in paths_preserved: | ||
print(' - ' + p) | ||
sys.exit(1) |
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
:: equivilent of test.sh as windows bat file | ||
set PATH=%PATH%;%PYTHON_BIN% | ||
@CALL emsdk install latest | ||
@CALL emsdk activate latest | ||
@CALL emsdk_env.bat --build=Release | ||
@CALL python -c "import sys; print(sys.executable)" | ||
@CALL emcc.bat -v | ||
set OLD_PATH=%PATH% | ||
CALL emsdk install latest | ||
CALL emsdk activate latest | ||
CALL emsdk_env.bat --build=Release | ||
CALL python -c "import sys; print(sys.executable)" | ||
CALL emcc.bat -v | ||
:: Check that no path elements were removed | ||
CALL python scripts/check_path.py "%OLD_PATH%" |
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