Starting to use Uniglot for hooks standardization.
This commit is contained in:
BIN
tests/__pycache__/test_bashlib.cpython-310-pytest-7.1.2.pyc
Normal file
BIN
tests/__pycache__/test_bashlib.cpython-310-pytest-7.1.2.pyc
Normal file
Binary file not shown.
BIN
tests/__pycache__/test_hooks.cpython-310-pytest-7.1.2.pyc
Normal file
BIN
tests/__pycache__/test_hooks.cpython-310-pytest-7.1.2.pyc
Normal file
Binary file not shown.
BIN
tests/__pycache__/test_imports.cpython-310-pytest-7.1.2.pyc
Normal file
BIN
tests/__pycache__/test_imports.cpython-310-pytest-7.1.2.pyc
Normal file
Binary file not shown.
15
tests/test.csharp
Normal file
15
tests/test.csharp
Normal 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
8
tests/test_hooks.py
Normal 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
26
tests/test_imports.py
Normal 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
|
Reference in New Issue
Block a user