diff options
author | Jacob Pipkin <j@dawnrazor.net> | 2012-11-01 23:07:18 -0500 |
---|---|---|
committer | Jacob Pipkin <j@dawnrazor.net> | 2012-11-01 23:07:18 -0500 |
commit | b73343f9cd0936748b6fe5ecd19a42965bfa52f7 (patch) | |
tree | d524085e6b944ecc840125cc5a8cd31190b60d6a | |
parent | da74382cb1def30948c8170ccc1ff5da47f05a66 (diff) | |
download | sbotools2-b73343f9cd0936748b6fe5ecd19a42965bfa52f7.tar.xz |
add ability to empty $temp_queue in order to facilitate unit testing
-rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 24fae5f..1087fb4 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -749,10 +749,11 @@ sub add_to_queue ($) { } # recursively add a sbo's requirements to the build queue. -sub get_build_queue ($$) { +sub get_build_queue ($$;$) { exists $_[1] or script_error 'get_build_queue requires two arguments.'; - my ($sbos, $warnings) = @_; - state $temp_queue = [()]; + my ($sbos, $warnings, $empty) = @_; + state $temp_queue = []; + $temp_queue = [] if $empty; for my $sbo (@$sbos) { my %args = ( QUEUE => $temp_queue,, |