summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2009-06-13 08:05:17 -0700
committerDan Nicholson <dbn.lists@gmail.com>2009-06-13 08:05:17 -0700
commit9ae6abd455e9b52bbdf88bb5a03874dc1ad7e26a (patch)
tree45731bf750cd6e247bbd0549a7687a11c581282a /src
parent41e164e0370b4623d59502789e8f55571bbdfb47 (diff)
tcc: Check for scenarios with and without current directory prefix
When asked to use a scenario relative to the current directory (probably because automake prefixed the test name with "./"), check for the name as supplied and with the ./ prefix stripped.
Diffstat (limited to 'src')
-rw-r--r--src/tet3/tcc/scen3.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tet3/tcc/scen3.c b/src/tet3/tcc/scen3.c
index 2d777991..39310950 100644
--- a/src/tet3/tcc/scen3.c
+++ b/src/tet3/tcc/scen3.c
@@ -85,13 +85,19 @@ char *scenario;
{
register struct scentab *ep;
struct scentab *myscen = (struct scentab *) 0;
+ int cwd_prefix;
+
+ /* If the scenario has the current directory "./" prefix,
+ * also check for the non-prefixed name */
+ cwd_prefix = (!strncmp(scenario, "./", 2)) ? 1 : 0;
/* set the SCF_NEEDED flag in the chosen scenario */
TRACE1(tet_Tscen, 1, "proc3sctree(): marking needed scenarios");
for (ep = sctree; ep; ep = ep->sc_forw) {
ASSERT(ep->sc_magic == SC_MAGIC);
ASSERT(ep->sc_type == SC_SCENARIO);
- if (!strcmp(ep->sc_scenario, scenario)) {
+ if (!strcmp(ep->sc_scenario, scenario) ||
+ (cwd_prefix && !strcmp(ep->sc_scenario, &scenario[2]))) {
TRACE2(tet_Tscen, 6, "chosen scenario %s is needed",
ep->sc_scenario);
ep->sc_flags |= SCF_NEEDED;