forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
input1.i:9 Kernels/diff_u/variable = u | ||
1 match found. |
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,28 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
import subprocess | ||
|
||
if len(sys.argv) < 2: | ||
print("Usage:\nhit_wrapper.py gold_output [hit arguments]\n") | ||
|
||
MOOSE_DIR = os.getenv('MOOSE_DIR', os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', '..', '..'))) | ||
hit = os.path.join(MOOSE_DIR, 'framework', 'contrib', 'hit', 'hit') | ||
if not os.path.exists(hit): | ||
print('Failed to locate hit executable.') | ||
sys.exit(1) | ||
|
||
gold_file = sys.argv[1] | ||
hit_args = sys.argv[2:] | ||
|
||
with open(gold_file, 'rb') as f: | ||
gold = f.read() | ||
|
||
out = subprocess.check_output([hit] + hit_args) | ||
|
||
if out == gold: | ||
sys.exit(0) | ||
|
||
print("Output:\n", out, "\ndoes not match gold:\n", gold) | ||
sys.exit(1) |
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,28 @@ | ||
# | ||
# This is not a valid MOOSE input, it is only used for testing the HIT command | ||
# line utility. | ||
# | ||
|
||
[Kernels] | ||
[diff_u] | ||
type = Diffusion | ||
variable = u | ||
[] | ||
[diff_v] | ||
type = Diffusion | ||
variable = v | ||
[] | ||
[] | ||
|
||
[BCs] | ||
[left] | ||
type = DirichletBC | ||
variable = u | ||
value = 0 | ||
[] | ||
[right] | ||
type = NeumannBC | ||
variable = v | ||
value = 0 | ||
[] | ||
[] |
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,10 @@ | ||
[Tests] | ||
[positive_pattern] | ||
type = RunCommand | ||
command = ./hit_wrapper.py gold/positive_pattern find Kernels/\*/variable=u input1.i' | ||
[] | ||
[negative_pattern] | ||
type = RunCommand | ||
command = ./hit_wrapper.py gold/positive_pattern find Kernels/\*/variable!=v input1.i' | ||
[] | ||
[] |