]> git.refcnt.org Git - colorize.git/blob - lib/Colorize/Common.pm
Run tests through valgrind
[colorize.git] / lib / Colorize / Common.pm
1 package Colorize::Common;
2
3 use strict;
4 use warnings;
5 use base qw(Exporter);
6 use constant true => 1;
7
8 use File::Temp qw(tempfile);
9
10 our (@EXPORT_OK, %EXPORT_TAGS);
11 my @defaults;
12
13 @defaults = qw($source $compiler);
14 @EXPORT_OK = (qw($compiler_flags %BUF_SIZE $valgrind_command $write_to_tmpfile), @defaults);
15 %EXPORT_TAGS = ('defaults' => [ @defaults ]);
16
17 our ($source, $compiler, $compiler_flags, %BUF_SIZE, $valgrind_command, $write_to_tmpfile);
18
19 #---------------#
20 # START of data #
21 #---------------#
22
23 $source = 'colorize.c';
24 $compiler = 'gcc';
25 $compiler_flags = '-ansi -pedantic -Wall -Wextra -Wformat -Wswitch-default -Wuninitialized -Wunused -Wno-unused-function -Wno-unused-parameter';
26 %BUF_SIZE = (
27 normal => 1024,
28 short => 10,
29 );
30 $valgrind_command = 'valgrind';
31 $write_to_tmpfile = sub
32 {
33 my ($content) = @_;
34
35 my ($fh, $tmpfile) = tempfile(UNLINK => true);
36 print {$fh} $content;
37 close($fh);
38
39 return $tmpfile;
40 };
41
42 #-------------#
43 # END of data #
44 #-------------#
45
46 1;