preparing CI
This commit is contained in:
parent
6626593606
commit
afce91bd71
|
|
@ -87,5 +87,6 @@ src/spicelib/parser/inpptree-parser.h
|
|||
# Visual Studio Code user options files
|
||||
.vscode/
|
||||
|
||||
test_cases/diode/__pycache__/*
|
||||
test_cases/diode/test_osdi/*
|
||||
test_cases/diode/test_built_in/*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
FROM python:3.10.4-bullseye
|
||||
|
||||
# python installation
|
||||
RUN apt-get update && apt-get -y install bc bison flex libxaw7 libxaw7-dev libx11-6 libx11-dev libreadline8 libxmu6
|
||||
RUN apt-get update && apt-get -y install build-essential libtool gperf libxml2 libxml2-dev libxml-libxml-perl libgd-perl
|
||||
RUN apt-get update && apt-get -y install g++ gfortran make cmake libfl-dev libfftw3-dev
|
||||
|
||||
RUN pip install pytest numpy pandas
|
||||
|
|
@ -44,7 +44,8 @@ def create_shared_object():
|
|||
|
||||
|
||||
# specify location of Ngspice executable to be tested
|
||||
ngspice_path = "../../../debug/src/ngspice"
|
||||
ngspice_path = os.path.join(directory, "../../debug/src/ngspice")
|
||||
ngspice_path = os.path.abspath(ngspice_path)
|
||||
|
||||
|
||||
def test_ngspice():
|
||||
|
|
@ -62,7 +63,7 @@ def test_ngspice():
|
|||
dir_built_in = os.path.join(directory, "test_built_in")
|
||||
# remove old results:
|
||||
for directory_i in [dir_osdi, dir_built_in]:
|
||||
shutil.rmtree(directory_i)
|
||||
shutil.rmtree(directory_i, ignore_errors=True)
|
||||
|
||||
for directory_i in [dir_osdi, dir_built_in]:
|
||||
os.makedirs(directory_i, exist_ok=True)
|
||||
|
|
@ -88,24 +89,24 @@ def test_ngspice():
|
|||
)
|
||||
|
||||
# read DC simulation results
|
||||
dc_data_osdi = pd.read_csv(os.path.join(dir_osdi, "dc_sim.ngspice"), sep="\s+")
|
||||
dc_data_osdi = pd.read_csv(os.path.join(dir_osdi, "dc_sim.ngspice"), sep="\\s+")
|
||||
dc_data_built_in = pd.read_csv(
|
||||
os.path.join(dir_built_in, "dc_sim.ngspice"), sep="\s+"
|
||||
os.path.join(dir_built_in, "dc_sim.ngspice"), sep="\\s+"
|
||||
)
|
||||
|
||||
id_osdi = dc_data_osdi["i(vsense)"].to_numpy()
|
||||
id_built_in = dc_data_built_in["i(vsense)"].to_numpy()
|
||||
|
||||
# read AC simulation results
|
||||
ac_data_osdi = pd.read_csv(os.path.join(dir_osdi, "ac_sim.ngspice"), sep="\s+")
|
||||
ac_data_osdi = pd.read_csv(os.path.join(dir_osdi, "ac_sim.ngspice"), sep="\\s+")
|
||||
ac_data_built_in = pd.read_csv(
|
||||
os.path.join(dir_built_in, "ac_sim.ngspice"), sep="\s+"
|
||||
os.path.join(dir_built_in, "ac_sim.ngspice"), sep="\\s+"
|
||||
)
|
||||
|
||||
# read TR simulation results
|
||||
tr_data_osdi = pd.read_csv(os.path.join(dir_osdi, "tr_sim.ngspice"), sep="\s+")
|
||||
tr_data_osdi = pd.read_csv(os.path.join(dir_osdi, "tr_sim.ngspice"), sep="\\s+")
|
||||
tr_data_built_in = pd.read_csv(
|
||||
os.path.join(dir_built_in, "tr_sim.ngspice"), sep="\s+"
|
||||
os.path.join(dir_built_in, "tr_sim.ngspice"), sep="\\s+"
|
||||
)
|
||||
|
||||
# test simulation results
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
IMAGENAME="registry.gitlab.com/dospm/ngspice"
|
||||
TAG="latest"
|
||||
|
||||
docker build -t $IMAGENAME:$TAG .
|
||||
docker run -it --rm --user "$(id -u)":"$(id -g)" -v "${PWD}":/tmp $IMAGENAME:$TAG /bin/bash
|
||||
Loading…
Reference in New Issue