PKGBUILD updates and some testing fixes

This commit is contained in:
DarkFeather
2019-04-15 14:53:57 -05:00
parent d4a1aabfdc
commit 4310ab7323
8 changed files with 82 additions and 27 deletions

View File

@@ -2,14 +2,64 @@ import os
import re
import shutil
def checkOutput(output):
for line in output.split('\n'):
if line == 'Hello world!': return True
return False
# c cs java bash php perl python
def CheckOutput(output):
return output == 'Hello world!\n'
def test_c():
print(os.getcwd())
fh = os.popen("./helloworld", mode='r', buffering=-1)
fh = os.popen("make c &>/dev/null; ./helloworld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and checkOutput(output)
assert retcode == None and CheckOutput(output)
def test_cs():
print(os.getcwd())
fh = os.popen("make cs &>/dev/null; mono ./HelloWorld.exe", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_java():
print(os.getcwd())
fh = os.popen("make java &>/dev/null; java helloworld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_bash():
print(os.getcwd())
fh = os.popen("bash ./helloworld.bash", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_bash():
print(os.getcwd())
fh = os.popen("bash ./helloworld.bash", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_perl():
print(os.getcwd())
fh = os.popen("perl ./helloworld.pl", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_php():
print(os.getcwd())
fh = os.popen("php ./helloworld.php", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)
def test_python():
print(os.getcwd())
fh = os.popen("python3 ./helloworld.py", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and CheckOutput(output)