### ----------------------------------------------------
### -- Native::Compile
### -- Licenses: Artistic-2.0
### -- Authors: Curt Tilmes <curt@tilmes.org>
### -- File: t/01-basic.t
### ----------------------------------------------------
#!/usr/bin/env raku
use Test;
use Native::Compile;

class Build {
    method build($dir) {
        indir $*PROGRAM.parent,
        {
            plan 7;

            isa-ok my $vars = get-vars(:verbose, :dryrun), Hash, 'get-vars';

            ok $vars<VERBOSE>, 'verbose';
            ok $vars<DRYRUN>, 'dryrun';

            %*ENV<LDFLAGS> = '-fPIC';
            isa-ok $vars = get-vars, Hash, 'get-vars, ENV override';

            nok $vars<VERBOSE>, 'no verbose';
            nok $vars<DRYRUN>, 'no dry run';
            is $vars<LDFLAGS>, '-fPIC', 'ENV override';

            done-testing;
        }
    }
}


