-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
138c54d
commit 675c3e9
Showing
1 changed file
with
72 additions
and
0 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,72 @@ | ||
#!/bin/bash | ||
|
||
# The format of commands (i.e tests/node/commands.txt) must always contain a new line at the end | ||
|
||
loc="$(dirname "$0")/tests" | ||
|
||
echo "NodeJS tests" | ||
export LOADER_SCRIPT_PATH="$loc/node" | ||
echo "Npm Test" | ||
metacall npm install metacall > out.txt | ||
if [ $? -eq 1 ]; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
cat out.txt | ||
echo "Successful!!" | ||
echo "Node metacall test" | ||
cat "$loc/node/commands.txt" | metacall > out.txt | ||
if [ $? -eq 1 ]; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
if ! grep -q "366667" out.txt; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
cat out.txt | ||
echo "Successful!!" | ||
|
||
echo "Python tests" | ||
export LOADER_SCRIPT_PATH="$loc/python" | ||
|
||
PYTHONHOME="$(dirname "$0")/metacall/runtimes/python" | ||
PIP_TARGET="$PYTHONHOME/Pip" | ||
PATH="$PYTHONHOME:$PYTHONHOME/Scripts:$PATH" | ||
"$PYTHONHOME/python" -m pip install --upgrade --force-reinstall pip | ||
|
||
echo "Pip Test" | ||
metacall pip install metacall > out.txt | ||
if [ $? -eq 1 ]; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
cat out.txt | ||
echo "Successful!!" | ||
echo "Python metacall test" | ||
cat "$loc/python/commands.txt" | metacall > out.txt | ||
if [ $? -eq 1 ]; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
if ! grep -q "Hello World" out.txt; then | ||
cat out.txt | ||
echo "Test suite failed" | ||
rm out.txt | ||
exit 1 | ||
fi | ||
cat out.txt | ||
echo "Successful!!" | ||
|
||
rm out.txt | ||
exit 0 |