Starting to use Uniglot for hooks standardization.

This commit is contained in:
2022-04-30 23:14:56 -05:00
parent ce2e2d3863
commit f034d627a6
17 changed files with 234 additions and 11 deletions

15
tests/test.csharp Normal file
View File

@@ -0,0 +1,15 @@
using AniNIX.Shared;
namespace AniNIX.Uniglot {
/// Test class
public class Test {
/// <summary>
/// The default function
/// </summary>
static int Main(string[] args) {
return 0;
}
}
}

8
tests/test_hooks.py Normal file
View File

@@ -0,0 +1,8 @@
import os
import pytest
def test_hooks_exec():
fh = os.popen("find Hooks -type f -exec ls -l {} \\; | egrep ^-rw-")
output = fh.read()
retcode = fh.close()
assert retcode == 256 and output == ''

26
tests/test_imports.py Normal file
View File

@@ -0,0 +1,26 @@
import os
import pytest
def test_bash_import():
fh = os.popen("/bin/bash -c 'source Bash/header; [ `declare -F | wc -l` -eq `egrep -c ^function\\ Bash/header` ]'", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None
def test_c_import():
fh = os.popen("gcc -o tests/c.out C/ll.h", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and os.path.isfile('tests/c.out')
def test_csharp_import():
fh = os.popen("/bin/bash -c 'mcs -out:tests/csharp.out CSharp/*.csharp tests/test.csharp'", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None and os.path.isfile('tests/csharp.out')
def test_remove_outs():
fh = os.popen("/bin/bash -c 'rm -Rf tests/*.out'", mode='r', buffering=-1)
output = fh.read()
retcode = fh.close()
assert retcode == None