From 9f4375014770e7218eb164a4aa62b3fa9b1659bb Mon Sep 17 00:00:00 2001 From: Michael Bentley Date: Mon, 29 Jan 2018 17:03:49 -0700 Subject: [PATCH 1/3] Add the missing file --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 280a1b06..b5bd3822 100644 --- a/Makefile +++ b/Makefile @@ -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/ From d945a07f602205c2aabd7d7e8ce0dc1c470e696c Mon Sep 17 00:00:00 2001 From: Michael Bentley Date: Mon, 29 Jan 2018 17:22:49 -0700 Subject: [PATCH 2/3] Add test for the install --- tests/flit_install/Makefile | 19 ++++++++++ tests/flit_install/tst_install_runthrough.py | 39 ++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/flit_install/Makefile create mode 100644 tests/flit_install/tst_install_runthrough.py diff --git a/tests/flit_install/Makefile b/tests/flit_install/Makefile new file mode 100644 index 00000000..27649460 --- /dev/null +++ b/tests/flit_install/Makefile @@ -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 $< diff --git a/tests/flit_install/tst_install_runthrough.py b/tests/flit_install/tst_install_runthrough.py new file mode 100644 index 00000000..ae29e414 --- /dev/null +++ b/tests/flit_install/tst_install_runthrough.py @@ -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) From b7f5e75f64b556387198ef6c5b37afb63fcfe82f Mon Sep 17 00:00:00 2001 From: Michael Bentley Date: Mon, 29 Jan 2018 17:29:13 -0700 Subject: [PATCH 3/3] update version to v2.0-alpha.3 --- scripts/flitcli/config/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/flitcli/config/version.txt b/scripts/flitcli/config/version.txt index 25758033..605ce39b 100644 --- a/scripts/flitcli/config/version.txt +++ b/scripts/flitcli/config/version.txt @@ -1 +1 @@ -v2.0-alpha.2 +v2.0-alpha.3