PKGBUILD updates and some testing fixes
This commit is contained in:
Binary file not shown.
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user