Open MPI logo

MTT Devel Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all MTT Devel mailing list

Subject: [MTT devel] Question about adding executable tests to the "Test Run" phase
From: DongInn Kim (dikim_at_[hidden])
Date: 2010-11-12 11:08:40


Hi,

MTT::Test::Specify::Simple::Specify(/nfs/rinfs/san/homedirs/ftbteam/svn/mtt_trunk/lib/MTT/Test/Specify/Simple.pm:130):
130: if (-x $t or $MTT::DoCommand::no_execute) {
  DB<51> p $t
ftb_watchdog

Here is the step to add a executable test to a hash reference($ret) if $t is executable or $MTT::DoCommand::no_execute is true.
$t is pointing to "ftb_watchdog" which is one of the FTB test program, executable, but not on $PATH.

Are we supposed to setup the $PATH to make the test program executable at this time? If so, does mtt have a simple way to do so?
What does "$MTT::DoCommand::no_execute" do actually?

For your convenience, I just copy and paste the part related to adding the executable tests to the hash reference in MTT/Test/Specify/Simple.pm
    # Now go through those groups and make the final list of tests to pass
    # upwards
    foreach my $group (keys %$params) {

        # Go through the list of tests and create an entry for each
        foreach my $t (@{$params->{$group}->{tests}}) {
            # If it's good, add a hash with all the values into the
            # list of tests
            if (-x $t or $MTT::DoCommand::no_execute) {
                my $one;
                # Do a deep copy of the defaults
                %{$one} = %{$config};

                # Set the test name
                $one->{executable} = $t;
                Debug(" Adding test: $t (group: $group)\n");

                # Set all the other names that were specified for this
                # group
                foreach my $key (keys %{$params->{$group}}) {
                    next
                        if ($key eq "tests");
                    if ($key =~ /^mpi_details:/) {
                        $key =~ m/^mpi_details:(.+)/;
                        $one->{mpi_details}->{$1} = $params->{$group}->{$key};
                    } else {
                        $one->{$key} = $params->{$group}->{$key};
                    }
                }

                # Save it on the final list of tests
                push(@{$ret->{tests}}, $one);
            }
        }
    }

    # All done
    $ret->{test_result} = 1;
    return $ret;
}

Regards,

-- 
- DongInn