NAME
App::Test::DWG::LibreDWG::DwgRead - Base class for test-dwg-libredwg-dwgread script.
SYNOPSIS
use App::Test::DWG::LibreDWG::DwgRead;
my $app = App::Test::DWG::LibreDWG::DwgRead->new;
my $exit_code = $app->run;
METHODS
new
my $app = App::Test::DWG::LibreDWG::DwgRead->new;
Constructor.
Returns instance of object.
run
my $exit_code = $app->run;
Run.
Returns 1 for error, 0 for success.
EXAMPLE
use strict;
use warnings;
use App::Test::DWG::LibreDWG::DwgRead;
use File::Temp qw(tempdir);
use File::Spec::Functions qw(catfile);
use IO::Barf qw(barf);
use MIME::Base64;
# Bad DWG data in base64.
my $bad_dwg_data = <<'END';
QUMxMDAyAAAAAAAAAAAAAAAK
END
# Prepare file in temp dir.
my $temp_dir = tempdir(CLEANUP => 1);
# Save data to file.
my $temp_file = catfile($temp_dir, 'bad.dwg');
barf($temp_file, decode_base64($bad_dwg_data));
# Arguments.
@ARGV = (
$temp_dir,
);
# Run.
exit App::Test::DWG::LibreDWG::DwgRead->new->run;
# Output like:
# Cannot dwgread '/tmp/__TMP_DIR__/bad.dwg'.
# Command 'dwgread -v1 /tmp/__TMP_DIR__/1.dwg' exit with 256.
DEPENDENCIES
Capture::Tiny, File::Copy, File::Find::Rule, File::Find::Rule::DWG, File::Path, File::Spec::Functions, File::Temp, Getopt::Std, IO::Barf, Readonly.
REPOSITORY
https://github.com/michal-josef-spacek/App-Test-DWG-LibreDWG-DwgRead
AUTHOR
Michal Josef Špaček mailto:skim@cpan.org
LICENSE AND COPYRIGHT
© 2023 Michal Josef Špaček
BSD 2-Clause License
VERSION
0.03