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
9 changed files
with
138 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:21 BCs/left/value = 0 | ||
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,4 @@ | ||
input2.i:16 PostProcessor/max/value = 1 | ||
input2.i:21 PostProcessor/min/value = 1 | ||
input2.i:26 PostProcessor/min2/value = 1 | ||
3 matches 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,2 @@ | ||
input2.i | ||
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,3 @@ | ||
input1.i:9 Kernels/diff_u/variable = u | ||
input1.i:13 Kernels/diff_v/variable = v | ||
2 matches 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,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,28 @@ | ||
# | ||
# This is not a valid MOOSE input, it is only used for testing the HIT command | ||
# line utility. | ||
# | ||
|
||
[Outputs] | ||
[out] | ||
type = Exodus | ||
[] | ||
[] | ||
|
||
[PostProcessor] | ||
[max] | ||
type = Calculation | ||
mode = MAX | ||
value = 1 | ||
[] | ||
[min] | ||
type = Calculation | ||
mode = min | ||
value = 1 | ||
[] | ||
[min2] | ||
type = Calculation | ||
mode = MIN | ||
value = 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,41 @@ | ||
[Tests] | ||
issues = '#19001' | ||
design = 'hit.md' | ||
|
||
[find] | ||
requirement = 'The hit find command shall be able to find' | ||
[parameter_exists] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/parameter_exists find Kernels/\*/variable input1.i input2.i' | ||
detail = 'files with specific parameters,' | ||
[] | ||
[parameter_does_not_exist] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/parameter_does_not_exist find -v Kernels/\*/variable input1.i ' | ||
'input2.i' | ||
detail = 'files not containing a specified parameter,' | ||
[] | ||
|
||
[positive_pattern] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/positive_pattern find Kernels/\*/variable=u input1.i' | ||
detail = 'parameters set to an exact specified value,' | ||
[] | ||
[negative_pattern] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/positive_pattern find Kernels/\*/variable!=v input1.i' | ||
detail = 'parameters not set to an exact specified value,' | ||
[] | ||
|
||
[additional_pattern] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/additional_pattern find -p type=DirichletBC -- \*/value input1.i input2.i' | ||
detail = 'parameters with additional pattern constraints,' | ||
[] | ||
[additional_pattern_negative] | ||
type = RunCommand | ||
command = './hit_wrapper.py gold/additional_pattern_negative find -p type!=DirichletBC -- \*/value input1.i input2.i' | ||
detail = 'parameters with additional pattern constraints,' | ||
[] | ||
[] | ||
[] |