Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
dist: focal

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- wget
- pkg-config

cache:
directories:
- $HOME/.cache/apt

before_install:
- echo "Installing C++ and Python"
- sudo apt-get update && sudo apt-get install -y --no-install-recommends --no-install-suggests build-essential g++ python-dev python3-dev python3-pip libc-dev python3-venv openmpi-bin libopenmpi-dev libomp-dev lammps
- sudo apt-get install gsl-bin libgsl0-dev libboost-all-dev imagemagick-6.q16 inkscape
- cp /var/cache/apt/archives/*.deb $HOME/.cache/apt/
- export BOOST_LIBDIR=/usr/lib/x86_64-linux-gnu/
- rm Gemfile.lock

jobs:
include:
- stage: test
script:
- sed -i 's/%use/#%use/' bin/nanobind-frontend.ipynb
- sed -i 's/import hublib.use/#import hublib.use/' bin/nanobind-frontend.ipynb
#- sed -i 's/0000/000/' bin/infiles/in.lammps.template
- sed -i 's/lmp_g++/lmp/' bin/Makefile
- make all
- cd bin && ./test.sh
name: test
20 changes: 20 additions & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

python3 -m venv ENV

source ENV/bin/activate

pip install hublib
pip install jupyterlab
pip install testbook
pip install widgetsnbextension
pip install svgwrite
pip install pypng
pip install pytest
pip install matplotlib
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension

export ENVIRON_CONFIG_DIRS=","
pytest test || exit 1

33 changes: 33 additions & 0 deletions bin/test/nanobind_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import testbook
import os
from datetime import datetime
import subprocess

DEFAULT_EPSILON = 1
DEFAULT_CONCENTRATION= 9
DEFAULT_NCOMPLEXES = 108
DEFAULT_WALLSPACING = 100
DEFAULT_TIMEINMILS = 275

@testbook.testbook('nanobind-frontend.ipynb', execute=True)
def test_runPreprocessor(tb):
t0 = datetime.now()
func = tb.ref("runPreprocessor")
func(DEFAULT_EPSILON, DEFAULT_CONCENTRATION, DEFAULT_NCOMPLEXES, DEFAULT_WALLSPACING, DEFAULT_TIMEINMILS)
logf = "./preprocessor.log"
assert os.path.exists(logf) == 1
t1 = datetime.fromtimestamp(os.path.getmtime(logf))
assert (t1>t0)
os.remove(logf)

'''
def test_backend():
retcode1, retstr = subprocess.getstatusoutput("make run-preprocessor")
assert (retcode1 == 0)
retcode2, retstr = subprocess.getstatusoutput("time lmp < ./in.lammps")
#assert (retcode2 == 0)
print (retstr)
mk1 = "Total # of neighbors"
mk2 = "Ave neighs/atom"
assert ((mk1 in retstr) and (mk2 in retstr))
'''