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

7
.gitignore vendored
View File

@ -1,3 +1,4 @@
./helloworld helloworld
./helloworld.class helloworld.class
./helloworld.exe HelloWorld.exe
tests/__pycache__/*

View File

@ -22,7 +22,9 @@ namespace AniNIX {
Console.WriteLine("Hello world!"); Console.WriteLine("Hello world!");
} }
// Main /// <summary>
/// Code entry point
/// </summary>
public static void Main(string[] args) { public static void Main(string[] args) {
HelloWorld.PrintHelloWorld(); HelloWorld.PrintHelloWorld();
return; return;

View File

@ -1,7 +1,9 @@
compile: c cs java bash php perl python compile: c cs java bash php perl python
pkgdirname != basename `git config remote.origin.url` | sed 's/.git$$//'
install: compile install: clean
@echo This project cannot be installed. mkdir -p ${pkgdir}/opt/aninix/${pkgdirname}/
rsync -avz --exclude=Makefile --exclude=LICENSE --exclude=.git* --exclude=README . * ${pkgdir}/opt/aninix/${pkgdirname}/
test: compile test: compile
python3 -m pytest python3 -m pytest
@ -39,5 +41,5 @@ perl: helloworld.pl /usr/bin/perl
python: helloworld.py /usr/bin/python3 python: helloworld.py /usr/bin/python3
#python3 ./helloworld.py #python3 ./helloworld.py
cs: helloworld.cs /usr/bin/mono /usr/bin/mcs cs: HelloWorld.cs /usr/bin/mono /usr/bin/mcs
mcs helloworld.cs mcs HelloWorld.cs

View File

@ -1,21 +1,21 @@
# Maintainer: Shikoba Kage <darkfeather@aninix.net> # Maintainer: Shikoba Kage <darkfeather@aninix.net>
pkgname=cryptoworkbench pkgname=aninix-helloworld
pkgver=0.1.ac4a8cb406377081eb1c1de2a3abe482508d6f57 pkgver=0.1.1
pkgver() { pkgver() {
printf "0.1.""$(git rev-parse HEAD)" printf "0.1.""$(git rev-parse HEAD)"
} }
pkgrel=1 pkgrel=1
epoch= epoch=
pkgdesc="AniNIX::CryptoWorkbench \\\\ Simple Cryptography Utility" pkgdesc="AniNIX::HelloWorld \\\\ Sample HelloWorld Source"
arch=("x86_64") arch=("x86_64")
url="https://aninix.net/foundation/CryptoWorkbench" url="https://aninix.net/foundation/HelloWorld"
license=('custom') license=('custom')
groups=() groups=()
depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4' 'git>=2.13') depends=('bash>=4.4')
makedepends=('make>=4.2') makedepends=('make>=4.2' 'mono>5.0.0' 'php' 'perl' 'java-environment' 'python>=3.7' 'gcc')
checkdepends=() checkdepends=()
optdepends=() optdepends=()
provides=('cryptoworkbench') provides=('aninix-helloworld')
conflicts=() conflicts=()
replaces=() replaces=()
backup=() backup=()
@ -36,7 +36,7 @@ build() {
} }
check() { check() {
printf 'quit\n\n' | make -C "${srcdir}/.." test make -C "${srcdir}/.." test
} }
package() { package() {

View File

@ -12,11 +12,11 @@
### <summary> ### <summary>
### Prints 'Hello world!' ### Prints 'Hello world!'
### </summary> ### </summary>
function helloWorld() { function main() {
printf "Hello world!\n" printf "Hello world!\n"
} }
## MAIN ## MAIN
if [ `echo "$0" | egrep '(^|/)helloworld.bash'` ]; then if [ `basename "$0"` == "helloworld.bash" ]; then
helloWorld main
fi fi

View File

@ -1,3 +1,3 @@
#!/usr/bin/python3 #!/usr/bin/python3
print('Hello World!\n'); print('Hello world!');

View File

@ -2,14 +2,64 @@ import os
import re import re
import shutil import shutil
def checkOutput(output): # c cs java bash php perl python
for line in output.split('\n'):
if line == 'Hello world!': return True def CheckOutput(output):
return False return output == 'Hello world!\n'
def test_c(): def test_c():
print(os.getcwd()) 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() output = fh.read()
retcode = fh.close() 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)