ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Conditional tests based on ${MACHINE} and ${MACHINE_ARCH}



On Sat, 1 Jan 2011, Julio Merino wrote:

Seems to me it would also be useful to have the inverse tests?

require.not.{arch,machine} could skip the tests if any of the the listed
entries match?

Seems that it would be much more likely to have one or two "skip test"
architectures than having a small list of "run test", so maintenance would
be simpler.

It probably does make sense to have such a feature but, from memory,
most of the ${MACHINE*} tests I have seen in the Makefiles are with
==, not with != (hence why require.* works as it does).

For now, if you want to do this, you can do it programmatically.
Something along the lines of:

const char* machine = atf_tc_get_config_var("atf_machine");
if (strcmp(machine, "foo") == 0)
   atf_tc_skip("Can't run on foo machine");
... rest of the test case body ...

That's what I'm currently doing.


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index