From 4fc76abeb861faaa36c854dfc86e76d00d8089f4 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 11 Dec 2010 22:17:01 -0800 Subject: [PATCH] DEBUG XFORM FAIL: Issue an error message as part of transformation. PSPP only returns a failure exit status if an error message is issued, but DEBUG XFORM FAIL doesn't issue an error message. This means that, if PSPP has no other errors, then it's difficult to tell that the transformation really did what it should have. This commit fixes the potential problem. --- src/language/xforms/fail.c | 15 +++++++-------- tests/language/stats/rank.at | 2 ++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/language/xforms/fail.c b/src/language/xforms/fail.c index d1cfabf6..3ca94524 100644 --- a/src/language/xforms/fail.c +++ b/src/language/xforms/fail.c @@ -18,15 +18,14 @@ #include -#include -#include -#include -#include -#include +#include "data/case.h" +#include "data/procedure.h" +#include "data/transformations.h" +#include "language/command.h" +#include "language/lexer/lexer.h" +#include "libpspp/message.h" static int trns_fail (void *x, struct ccase **c, casenumber n); - - /* A transformation which is guaranteed to fail. */ @@ -34,10 +33,10 @@ static int trns_fail (void *x UNUSED, struct ccase **c UNUSED, casenumber n UNUSED) { + msg (SE, "DEBUG XFORM FAIL transformation executed"); return TRNS_ERROR; } - int cmd_debug_xform_fail (struct lexer *lexer, struct dataset *ds) { diff --git a/tests/language/stats/rank.at b/tests/language/stats/rank.at index ac44189c..99a0459f 100644 --- a/tests/language/stats/rank.at +++ b/tests/language/stats/rank.at @@ -538,6 +538,8 @@ Variables Created By RANK x into Rx(RANK of x) +rank.sps:14: error: RANK: DEBUG XFORM FAIL transformation executed + rank.sps:14: error: Stopping syntax file processing here to avoid a cascade of dependent command failures. ]) AT_CLEANUP -- 2.30.2