Major overhaul getting started

This commit is contained in:
DarkFeather 2018-11-05 15:35:32 -06:00
parent 67f773bb45
commit d4a1aabfdc
12 changed files with 167 additions and 55 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
./helloworld
./helloworld.class
./helloworld.exe

View File

@ -1,45 +1,13 @@
INSTALLER != curl -s https://aninix.net/foundation/installer-test.bash | /bin/bash compile: c cs java bash php perl python
all: c csharp java bash php hack perl
echo Done;
compile:
[ -f helloworld.c ]
install: compile install: compile
@echo This project cannot be installed. @echo This project cannot be installed.
test: all test: compile
python3 -m pytest
clean: clean:
@echo Nothing to do. cat .gitignore | xargs -n 1 rm -Rf
c: helloworld.c /usr/bin/gcc
gcc -o helloworld helloworld.c
./helloworld
rm ./helloworld
java: helloworld.java /usr/bin/java /usr/bin/javac
javac helloworld.java
java helloworld
rm helloworld.class
bash: helloworld.bash /usr/bin/bash
bash helloworld.bash
php: helloworld.php /usr/bin/php
php helloworld.php
hack: helloworld.php /usr/bin/hhvm
hhvm --php helloworld.php
perl: helloworld.pl /usr/bin/perl
perl ./helloworld.pl
csharp: helloworld.csharp /usr/bin/mono /usr/bin/mcs
mcs helloworld.csharp
mono helloworld.exe
rm helloworld.exe
diff: diff:
@echo Nothing to do. @echo Nothing to do.
@ -49,3 +17,27 @@ reverse:
checkperm: checkperm:
@echo Nothing to do. @echo Nothing to do.
c: helloworld.c /usr/bin/gcc
gcc -o helloworld helloworld.c
java: helloworld.java /usr/bin/java /usr/bin/javac
javac helloworld.java
bash: helloworld.bash /usr/bin/bash
#bash helloworld.bash
php: helloworld.php /usr/bin/php
#php helloworld.php
#hack: helloworld.php /usr/bin/hhvm
#hhvm --php helloworld.php
perl: helloworld.pl /usr/bin/perl
#perl ./helloworld.pl
python: helloworld.py /usr/bin/python3
#python3 ./helloworld.py
cs: helloworld.cs /usr/bin/mono /usr/bin/mcs
mcs helloworld.cs

46
PKGBUILD Normal file
View File

@ -0,0 +1,46 @@
# Maintainer: Shikoba Kage <darkfeather@aninix.net>
pkgname=cryptoworkbench
pkgver=0.1.ac4a8cb406377081eb1c1de2a3abe482508d6f57
pkgver() {
printf "0.1.""$(git rev-parse HEAD)"
}
pkgrel=1
epoch=
pkgdesc="AniNIX::CryptoWorkbench \\\\ Simple Cryptography Utility"
arch=("x86_64")
url="https://aninix.net/foundation/CryptoWorkbench"
license=('custom')
groups=()
depends=('mono>=5.0.0' 'curl' 'grep' 'bash>=4.4' 'git>=2.13')
makedepends=('make>=4.2')
checkdepends=()
optdepends=()
provides=('cryptoworkbench')
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=()
noextract=()
md5sums=()
validpgpkeys=()
prepare() {
git pull
}
build() {
make -C ..
}
check() {
printf 'quit\n\n' | make -C "${srcdir}/.." test
}
package() {
export pkgdir="${pkgdir}"
make -C .. install
install -D -m644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

1
README Normal file
View File

@ -0,0 +1 @@
This project is enabled for AniNIX::Foundation. You can check it out remotely with the git package. It is intended to display example source for all of our projects.

View File

@ -1,2 +0,0 @@
This project is enabled for AniNIX::Bazaar. You can check it out remotely with the bzr package.
Project URL is bzr://bazaar.aninix.net/HelloWorld

View File

@ -1,2 +1,22 @@
#!/usr/bin/bash #!/usr/bin/bash
printf "Hello world!\n"
# File: helloworld.bash
#
# Description: This file exemplifies printing 'Hello world!' in bash.
#
# Package: AniNIX::Foundation/HelloWorld
# Copyright: WTFPL
#
# Author: DarkFeather <darkfeather@aninix.net>
### <summary>
### Prints 'Hello world!'
### </summary>
function helloWorld() {
printf "Hello world!\n"
}
## MAIN
if [ `echo "$0" | egrep '(^|/)helloworld.bash'` ]; then
helloWorld
fi

View File

@ -1,6 +1,27 @@
#include <stdio.h> #include <stdio.h>
/*
* File: helloworld.c
*
* Description: This file exemplifies printing 'Hello world!' in C.
*
* Package: AniNIX::Foundation/HelloWorld
* Copyright: WTFPL
*
* Author: DarkFeather <darkfeather@aninix.net>
*/
static char * message = "Hello world!";
/// <summary>
/// Prints 'Hello world!'
/// </summary>
void HelloWorld() {
printf("%s\n",message);
}
// MAIN
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
printf("Hello world!\n"); HelloWorld();
return 0; return 0;
} }

View File

@ -1,9 +1,31 @@
using System; using System;
/*
* File: helloworld.cs
*
* Description: This file exemplifies printing 'Hello world!' in C#.
*
* Package: AniNIX::Foundation/HelloWorld
* Copyright: WTFPL
*
* Author: DarkFeather <darkfeather@aninix.net>
*/
namespace AniNIX { namespace AniNIX {
class HelloWorld {
public static void Main(string[] args) { public sealed class HelloWorld {
/// <summary>
/// Print 'Hello world!'
/// </summary>
public static void PrintHelloWorld() {
Console.WriteLine("Hello world!"); Console.WriteLine("Hello world!");
} }
// Main
public static void Main(string[] args) {
HelloWorld.PrintHelloWorld();
return;
}
} }
} }

View File

@ -1,9 +0,0 @@
using System;
namespace AniNIX {
class HelloWorld {
public static void Main(string[] args) {
Console.WriteLine("Hello world!");
}
}
}

3
helloworld.py Normal file
View File

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

Binary file not shown.

15
tests/test_unit.py Normal file
View File

@ -0,0 +1,15 @@
import os
import re
import shutil
def checkOutput(output):
for line in output.split('\n'):
if line == 'Hello world!': return True
return False
def test_c():
print(os.getcwd())
fh = os.popen("./helloworld", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and checkOutput(output)