Skip to content

Commit

Permalink
Merge pull request #113 from PRUNERS/devel
Browse files Browse the repository at this point in the history
Hotfix for v2.0-alpha.2: install was missing sqlite table file
  • Loading branch information
mikebentley15 authored Jan 30, 2018
2 parents fd7e7a5 + b7f5e75 commit 4b70e12
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ install: $(TARGET)
install -m 0644 $(DATA_DIR)/custom.mk $(PREFIX)/share/flit/data/
install -m 0644 $(DATA_DIR)/main.cpp $(PREFIX)/share/flit/data/
install -m 0644 $(DATA_DIR)/tests/Empty.cpp $(PREFIX)/share/flit/data/tests/
install -m 0644 $(DATA_DIR)/db/tables-psql.sql $(PREFIX)/share/flit/data/db/
install -m 0644 $(DATA_DIR)/db/tables-sqlite.sql $(PREFIX)/share/flit/data/db/
install -m 0644 $(CONFIG_DIR)/version.txt $(PREFIX)/share/flit/config/
install -m 0644 $(CONFIG_DIR)/flit-default.toml.in $(PREFIX)/share/flit/config/
install -m 0644 $(LITMUS_TESTS) $(PREFIX)/share/flit/litmus-tests/
Expand Down
2 changes: 1 addition & 1 deletion scripts/flitcli/config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.0-alpha.2
v2.0-alpha.3
19 changes: 19 additions & 0 deletions tests/flit_install/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
RUNNER := python3
SRC := $(wildcard tst_*.py)
RUN_TARGETS := $(SRC:%.py=run_%)

.PHONY: check help clean build run_%
check: $(TARGETS) $(RUN_TARGETS)

help:
@echo "Makefile for running tests on FLiT framework"
@echo " help print this help documentation and exit"
@echo " build just compile the targets"
@echo " check run tests and print results to the console"
@echo " clean remove all generated files"

build:
clean:

run_% : %.py
@python $<
39 changes: 39 additions & 0 deletions tests/flit_install/tst_install_runthrough.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'''
Tests FLiT's capabilities to run simple commands on an installation
The tests are below using doctest
Let's now make a temporary directory and install there. Here we are simply
testing that the following command complete without error.
>>> import glob
>>> import os
>>> import subprocess as subp
>>> with th.tempdir() as temp_dir:
... _ = subp.check_call(['make', '-C', os.path.join(th.config.lib_dir, '..'),
... 'install', 'PREFIX=' + temp_dir],
... stdout=subp.DEVNULL, stderr=subp.DEVNULL)
... flit = os.path.join(temp_dir, 'bin', 'flit')
... _ = subp.check_call([flit, 'init', '-C', os.path.join(temp_dir, 'sandbox')],
... stdout=subp.DEVNULL, stderr=subp.DEVNULL)
... _ = subp.check_call(['mkdir', '-p', os.path.join(temp_dir, 'sandbox', 'obj'),
... os.path.join(temp_dir, 'sandbox', 'results')],
... stdout=subp.DEVNULL, stderr=subp.DEVNULL)
... _ = subp.check_call(['make', '-C', os.path.join(temp_dir, 'sandbox'),
... '--touch', 'run'],
... stdout=subp.DEVNULL, stderr=subp.DEVNULL)
... os.chdir(os.path.join(temp_dir, 'sandbox'))
... _ = subp.check_call([flit, 'import'] + glob.glob('results/*.csv'),
... stdout=subp.DEVNULL, stderr=subp.DEVNULL)
'''

# Test setup before the docstring is run.
import sys
before_path = sys.path[:]
sys.path.append('..')
import test_harness as th
sys.path = before_path

if __name__ == '__main__':
from doctest import testmod
failures, tests = testmod()
sys.exit(failures)

0 comments on commit 4b70e12

Please sign in to comment.