10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-09-27 12:00:56 +02:00

Merge branch 'master' of github.com:scemama/quantum_package

This commit is contained in:
Anthony Scemama 2019-01-04 18:35:19 +01:00
commit cb0ac6956c
9 changed files with 31 additions and 11 deletions

View File

@ -11,10 +11,13 @@ BUILDDIR = build
help: help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile .PHONY: help Makefile auto
auto:
cd source ; python2 auto_generate.py
# Catch-all target: route all unknown targets to Sphinx using the new # Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile %: Makefile
cd source ; python2 auto_generate.py
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View File

@ -4,14 +4,17 @@
qp_test qp_test
======= =======
This command runs the consistency test of |qp|. The tests are run with the |Bats| shell testing environment. This command runs the consistency test of |qp|.
The tests are run with the |Bats| shell testing environment.
If the name of a test of its number is specified on the command line, only this
test will be run.
Usage Usage
----- -----
.. code:: bash .. code:: bash
qp_test [FLAGS] qp_test [FLAGS] [TEST]
Flags : Flags :
[-a] Run all the tests [-a] Run all the tests
[-v] Verbose mode: shows the output of the runs [-v] Verbose mode: shows the output of the runs

View File

@ -5,7 +5,7 @@
Runs all the possible tests using bats. Runs all the possible tests using bats.
Usage: Usage:
qp_test [-av] qp_test [-av] [TEST]
Options: Options:
-v verbose output -v verbose output
@ -34,6 +34,9 @@ def main(arguments):
number, _ = f.split('.',1) number, _ = f.split('.',1)
l_bats.append( (int(number), os.path.join(dirname,f)) ) l_bats.append( (int(number), os.path.join(dirname,f)) )
if arguments["TEST"]:
os.environ["TEST"] = arguments["TEST"]
if arguments["-a"]: if arguments["-a"]:
for (dirname, _, filenames) in os.walk(QP_SRC, followlinks=False) : for (dirname, _, filenames) in os.walk(QP_SRC, followlinks=False) :
if "IRPF90_temp" not in dirname: if "IRPF90_temp" not in dirname:
@ -55,12 +58,12 @@ def main(arguments):
print "" print ""
if arguments["-v"]: if arguments["-v"]:
p1 = subprocess.Popen(["python2", "bats_to_sh.py", bats_file], \ p1 = subprocess.Popen(["python2", "bats_to_sh.py", bats_file], \
stdout=subprocess.PIPE) stdout=subprocess.PIPE, env=os.environ)
p2 = subprocess.Popen(["bash"], stdin=p1.stdout) p2 = subprocess.Popen(["bash"], stdin=p1.stdout, env=os.environ)
_, _ = os.waitpid(p2.pid,0) _, _ = os.waitpid(p2.pid,0)
_, _ = os.waitpid(p1.pid,0) _, _ = os.waitpid(p1.pid,0)
else: else:
subprocess.check_call(["bats", bats_file]) subprocess.check_call(["bats", bats_file], env=os.environ)

View File

@ -29,7 +29,7 @@ function run() {
@test "[Cu(NH3)4]2+" { @test "[Cu(NH3)4]2+" {
qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]" qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]"
run cu_nh3_4_2plus.ezfio -1862.98687225779 -1862.68821075043 run cu_nh3_4_2plus.ezfio -1862.98685486633 -1862.68819645070
} }
@test "C2H2" { @test "C2H2" {
@ -70,7 +70,7 @@ function run() {
@test "CH4" { @test "CH4" {
qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]" qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]"
run ch4.ezfio -40.2403957502264 -39.8433160343413 run ch4.ezfio -40.2403916878857 -39.8433229646061
} }
@test "CO2" { @test "CO2" {

View File

@ -44,3 +44,14 @@ function test_exe() {
fi fi
} }
run_only_test() {
if [[ "$BATS_TEST_DESCRIPTION" != "$1" ]] && [[ "$BATS_TEST_NUMBER" -ne "$1" ]]; then
skip
fi
}
setup() {
if [[ -n $TEST ]] ; then
run_only_test $TEST
fi
}

View File

@ -13,7 +13,7 @@ for i in raw_data:
if i == "@": if i == "@":
inside = True inside = True
elif i == "{" and inside and level == 0: elif i == "{" and inside and level == 0:
new_i = "" new_i = "\nsetup\n"
elif i == "}" and inside and level == 1: elif i == "}" and inside and level == 1:
inside = False inside = False
new_i = "" new_i = ""