Skip to content

Commit

Permalink
Add review recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-bc committed Oct 24, 2023
1 parent 97eac4f commit 5c2e608
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/fprime/fpp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def execute(
imports, sources = self.get_fpp_inputs(builder, context)

if not sources:
print("[WARNING] No FPP inputs found in this module.")
print("[WARNING] No FPP sources found in this module.")

# Build the input argument list
input_args = []
Expand All @@ -146,7 +146,6 @@ def execute(

user_args = args[1]
app_args = [self.utility] + user_args + input_args
# NOTE: This adds all fpp_inputs as source file arguments, not as --imports arguments
if builder.cmake.verbose:
print(f"[FPP] '{' '.join(app_args)}'")
return subprocess.run(app_args, capture_output=False).returncode
9 changes: 9 additions & 0 deletions src/fprime/fpp/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def fpp_generate_implementation(
context: Path,
apply_formatting: bool,
ut: bool,
auto_test_helpers: bool = False,
) -> int:
"""
Generate implementation files from FPP templates.
Expand Down Expand Up @@ -63,6 +64,7 @@ def fpp_generate_implementation(
[
"--template",
*(["--unit-test"] if ut else []),
*(["--auto-test-helpers"] if auto_test_helpers else []),
"--names",
gen_files.name,
"--directory",
Expand Down Expand Up @@ -115,6 +117,7 @@ def run_fpp_impl(
parsed.path,
not parsed.no_format,
parsed.ut,
parsed.auto_test_helpers,
)


Expand Down Expand Up @@ -151,4 +154,10 @@ def add_fpp_impl_parsers(
help="Disable formatting (using clang-format) of generated files",
required=False,
)
impl_parser.add_argument(
"--auto-test-helpers",
action="store_true",
help="Enable automatic generation of test helper code",
required=False,
)
return {"impl": run_fpp_impl}, {"impl": impl_parser}
1 change: 0 additions & 1 deletion src/fprime/util/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ def parse_args(args):
runners = {}
parsers = {}

# Refactor the following so that each package defines its own
fbuild_runners, fbuild_parsers = add_fbuild_parsers(
subparsers, common_parser, HelpText
)
Expand Down

0 comments on commit 5c2e608

Please sign in to comment.