-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from PRUNERS/devel
Hotfix for v2.0-alpha.2: install was missing sqlite table file
- Loading branch information
Showing
4 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v2.0-alpha.2 | ||
v2.0-alpha.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 $< |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |