aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-11-01 23:07:18 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-11-01 23:07:18 -0500
commitb73343f9cd0936748b6fe5ecd19a42965bfa52f7 (patch)
treed524085e6b944ecc840125cc5a8cd31190b60d6a
parentda74382cb1def30948c8170ccc1ff5da47f05a66 (diff)
downloadsbotools2-b73343f9cd0936748b6fe5ecd19a42965bfa52f7.tar.xz
add ability to empty $temp_queue in order to facilitate unit testing
-rw-r--r--SBO-Lib/lib/SBO/Lib.pm7
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,,