mirror of https://github.com/Nonannet/copapy.git
ci fixed
This commit is contained in:
parent
f44771e5c6
commit
919b2c9c70
|
|
@ -32,14 +32,8 @@ jobs:
|
|||
python -m pip install --upgrade pip
|
||||
python -m pip install -e .
|
||||
|
||||
- name: Build ops obj file
|
||||
run: bash build_ops_obj.sh
|
||||
|
||||
- name: Build runner
|
||||
run: |
|
||||
mkdir bin
|
||||
gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror src/runner/runmem2.c -Wall -O3 -o bin/runmem2
|
||||
x86_64-w64-mingw32-gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror src/runner/runmem2.c -Wall -O3 -o bin/runmem2.exe
|
||||
- name: Build ops obj file and runner
|
||||
run: bash build.sh
|
||||
|
||||
#- name: Lint code with flake8
|
||||
# run: flake8
|
||||
|
|
@ -47,8 +41,8 @@ jobs:
|
|||
#- name: Type checking with mypy
|
||||
# run: mypy
|
||||
|
||||
#- name: Run tests with pytest
|
||||
# run: pytest
|
||||
- name: Run tests with pytest
|
||||
run: pytest
|
||||
|
||||
- name: Upload obj files
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
|
|||
3
build.sh
3
build.sh
|
|
@ -7,3 +7,6 @@ gcc -c src/copapy/stencils.c -o src/copapy/obj/stencils_x86_64.o
|
|||
gcc -c src/copapy/stencils.c -O1 -o src/copapy/obj/stencils_x86_64_O1.o
|
||||
gcc -c src/copapy/stencils.c -O2 -o src/copapy/obj/stencils_x86_64_O2.o
|
||||
gcc -c src/copapy/stencils.c -O3 -o src/copapy/obj/stencils_x86_64_O3.o
|
||||
|
||||
gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror -g src/runner/runmem2.c -o bin/runmem2
|
||||
#x86_64-w64-mingw32-gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror src/runner/runmem2.c -Wall -O3 -o bin/runmem2.exe
|
||||
5
test.sh
5
test.sh
|
|
@ -4,5 +4,6 @@ echo "Compile..."
|
|||
python tests/test_compile.py
|
||||
echo "Run..."
|
||||
echo "-----------------------------------"
|
||||
gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror -g src/runner/runmem2.c -o runmem2
|
||||
./runmem2 test.copapy
|
||||
mkdir bin -p
|
||||
gcc -Wall -Wextra -Wconversion -Wsign-conversion -Wshadow -Wstrict-overflow -Werror -g src/runner/runmem2.c -o bin/runmem2
|
||||
./bin/runmem2 test.copapy
|
||||
|
|
@ -1,6 +1,13 @@
|
|||
from copapy import Write, const
|
||||
import copapy as rc
|
||||
import subprocess
|
||||
|
||||
def run_command(command: list[str], encoding: str = 'utf8') -> str:
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||
output, error = process.communicate()
|
||||
|
||||
assert error is None, f"Error occurred: {error.decode(encoding)}"
|
||||
return output.decode(encoding)
|
||||
|
||||
def test_compile():
|
||||
c1 = const(1.11)
|
||||
|
|
@ -18,7 +25,12 @@ def test_compile():
|
|||
|
||||
print('#', il.print())
|
||||
|
||||
il.to_file('test.copapy')
|
||||
il.to_file('./bin/test.copapy')
|
||||
|
||||
result = run_command(['./bin/runmem2', 'test.copapy'])
|
||||
print(result)
|
||||
|
||||
assert 'Return value: 0' in result
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in New Issue