#! /usr/bin/env perl
##**************************************************************
##
## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
## University of Wisconsin-Madison, WI.
## 
## Licensed under the Apache License, Version 2.0 (the "License"); you
## may not use this file except in compliance with the License.  You may
## obtain a copy of the License at
## 
##    http://www.apache.org/licenses/LICENSE-2.0
## 
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
##**************************************************************

use strict;
use warnings;
use CondorTest;
use CondorUtils;

my $testname = "_ring_buffer_tester";
my $cmd = 'ring_buffer_unit_test';
if (CondorUtils::is_windows()) { $cmd .= ".exe"; }
my $args = '';
my $success = 0;

TLOG "Running $cmd $args\n";

open(ELOG,"$cmd $args 2>&1 |") || die "Could not run: $cmd $args: $!\n";
while(<ELOG>) {
	print $_;
	#if ($_ =~ /No errors detected/) { $success = 1; }
}
close(ELOG);
# alternative: my $exitcode = ${^CHILD_ERROR_NATIVE}
my $exitcode = $?;

print "\n";
TLOG "exitcode = $exitcode\n";
$success = $exitcode == 0;

CondorTest::RegisterResult($success, "test_name", $testname);
CondorTest::EndTest();
