From c2792d6129fe9b13efba159126430d657f447033 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 1 Apr 2023 15:57:04 -0400 Subject: Adjust output strings to be aligned Change error and fatal messages to start with lowercase and not end with a period. Note a few very common messages were left as-is, just in case some other tools parse them. Also modify the test known-good-output to satisfy the messages. --- src/ar.c | 8 ++++---- src/arscan.c | 4 ++-- src/commands.c | 10 +++++----- src/expand.c | 2 +- src/file.c | 14 +++++++------- src/function.c | 20 ++++++++++---------- src/job.c | 8 ++++---- src/load.c | 12 ++++++------ src/main.c | 27 +++++++++++++-------------- src/output.c | 4 ++-- src/read.c | 2 +- src/remake.c | 10 +++++----- src/rule.c | 2 +- tests/scripts/features/double_colon | 2 +- tests/scripts/features/implicit_search | 2 +- tests/scripts/features/include | 6 +++--- tests/scripts/features/jobserver | 10 +++++----- tests/scripts/features/mult_rules | 14 ++++++++------ tests/scripts/features/patternrules | 6 +++--- tests/scripts/features/se_explicit | 12 ++++++------ tests/scripts/functions/shell | 2 +- tests/scripts/options/dash-B | 3 ++- tests/scripts/options/dash-W | 5 ++++- tests/scripts/options/dash-k | 2 +- tests/scripts/options/shuffle | 2 +- tests/scripts/targets/DELETE_ON_ERROR | 4 ++-- tests/test_driver.pl | 12 ++++++------ 27 files changed, 105 insertions(+), 100 deletions(-) diff --git a/src/ar.c b/src/ar.c index e6eb0a1e..d7928563 100644 --- a/src/ar.c +++ b/src/ar.c @@ -63,7 +63,7 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p) p = strchr (*arname_p, '('); /* This is never called unless ar_name() is true so p cannot be NULL. */ if (!p) - OS (fatal, NILF, "Internal: ar_parse_name: bad name '%s'", *arname_p); + OS (fatal, NILF, "INTERNAL: ar_parse_name: bad name '%s'", *arname_p); *(p++) = '\0'; p[strlen (p) - 1] = '\0'; *memname_p = p; @@ -148,7 +148,7 @@ ar_touch (const char *name) switch (ar_member_touch (arname, memname)) { case -1: - OS (error, NILF, _("touch: Archive '%s' does not exist"), arname); + OS (error, NILF, _("touch: archive '%s' does not exist"), arname); break; case -2: OS (error, NILF, _("touch: '%s' is not a valid archive"), arname); @@ -158,14 +158,14 @@ ar_touch (const char *name) break; case 1: OSS (error, NILF, - _("touch: Member '%s' does not exist in '%s'"), memname, arname); + _("touch: member '%s' does not exist in '%s'"), memname, arname); break; case 0: val = 0; break; default: OS (error, NILF, - _("touch: Bad return code from ar_member_touch on '%s'"), name); + _("touch: bad return code from ar_member_touch on '%s'"), name); } free (arname); diff --git a/src/arscan.c b/src/arscan.c index 7ad1fbfa..62e7420b 100644 --- a/src/arscan.c +++ b/src/arscan.c @@ -399,11 +399,11 @@ parse_int (const char *ptr, const size_t len, const int base, uintmax_t max, if (*ptr < '0' || *ptr > maxchar) OSSS (fatal, NILF, - _("Invalid %s for archive %s member %s"), type, archive, name); + _("invalid %s for archive %s member %s"), type, archive, name); nv = (val * base) + (*ptr - '0'); if (nv < val || nv > max) OSSS (fatal, NILF, - _("Invalid %s for archive %s member %s"), type, archive, name); + _("invalid %s for archive %s member %s"), type, archive, name); val = nv; ++ptr; } diff --git a/src/commands.c b/src/commands.c index eebd63a3..05c164ee 100644 --- a/src/commands.c +++ b/src/commands.c @@ -376,7 +376,7 @@ chop_commands (struct commands *cmds) if (nlines == USHRT_MAX) ON (fatal, &cmds->fileinfo, - _("Recipe has too many lines (limit %hu)"), nlines); + _("recipe has too many lines (limit %hu)"), nlines); if (nlines == max) { @@ -618,11 +618,11 @@ delete_target (struct file *file, const char *on_behalf_of) { if (on_behalf_of) OSS (error, NILF, - _("*** [%s] Archive member '%s' may be bogus; not deleted"), + _("*** [%s] archive member '%s' may be bogus; not deleted"), on_behalf_of, file->name); else OS (error, NILF, - _("*** Archive member '%s' may be bogus; not deleted"), + _("*** archive member '%s' may be bogus; not deleted"), file->name); } return; @@ -636,9 +636,9 @@ delete_target (struct file *file, const char *on_behalf_of) { if (on_behalf_of) OSS (error, NILF, - _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name); + _("*** [%s] deleting file '%s'"), on_behalf_of, file->name); else - OS (error, NILF, _("*** Deleting file '%s'"), file->name); + OS (error, NILF, _("*** deleting file '%s'"), file->name); if (unlink (file->name) < 0 && errno != ENOENT) /* It disappeared; so what. */ perror_with_name ("unlink: ", file->name); diff --git a/src/expand.c b/src/expand.c index a1efa831..3c97f387 100644 --- a/src/expand.c +++ b/src/expand.c @@ -193,7 +193,7 @@ recursively_expand_for_file (struct variable *v, struct file *file) if (!v->exp_count) /* Expanding V causes infinite recursion. Lose. */ OS (fatal, *expanding_var, - _("Recursive variable '%s' references itself (eventually)"), + _("recursive variable '%s' references itself (eventually)"), v->name); --v->exp_count; } diff --git a/src/file.c b/src/file.c index f8e4fb91..dc2ea2ae 100644 --- a/src/file.c +++ b/src/file.c @@ -269,19 +269,19 @@ rehash_file (struct file *from_file, const char *to_hname) if (to_file->cmds->fileinfo.filenm != 0) error (&from_file->cmds->fileinfo, l + strlen (to_file->cmds->fileinfo.filenm) + INTSTR_LENGTH, - _("Recipe was specified for file '%s' at %s:%lu,"), + _("recipe was specified for file '%s' at %s:%lu,"), from_file->name, from_file->cmds->fileinfo.filenm, from_file->cmds->fileinfo.lineno); else error (&from_file->cmds->fileinfo, l, - _("Recipe for file '%s' was found by implicit rule search,"), + _("recipe for file '%s' was found by implicit rule search,"), from_file->name); l += strlen (to_hname); error (&from_file->cmds->fileinfo, l, - _("but '%s' is now considered the same file as '%s'."), + _("but '%s' is now considered the same file as '%s'"), from_file->name, to_hname); error (&from_file->cmds->fileinfo, l, - _("Recipe for '%s' will be ignored in favor of the one for '%s'."), + _("recipe for '%s' will be ignored in favor of the one for '%s'"), from_file->name, to_hname); } } @@ -410,7 +410,7 @@ remove_intermediates (int sig) { if (sig) OS (error, NILF, - _("*** Deleting intermediate file '%s'"), f->name); + _("*** deleting intermediate file '%s'"), f->name); else { if (! doneany) @@ -949,7 +949,7 @@ file_timestamp_cons (const char *fname, time_t stamp, long int ns) ts = s <= OLD_MTIME ? ORDINARY_MTIME_MIN : ORDINARY_MTIME_MAX; file_timestamp_sprintf (buf, ts); OSS (error, NILF, - _("%s: Timestamp out of range; substituting %s"), f, buf); + _("%s: timestamp out of range: substituting %s"), f, buf); } return ts; @@ -1199,7 +1199,7 @@ print_file_data_base (void) do{ \ if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \ error (NULL, strlen (_p->name) + CSTRLEN (# _n) + strlen (_p->_n), \ - _("%s: Field '%s' not cached: %s"), _p->name, # _n, _p->_n); \ + _("%s: field '%s' not cached: %s"), _p->name, # _n, _p->_n); \ }while(0) static void diff --git a/src/function.c b/src/function.c index 5ca28f85..d4636d73 100644 --- a/src/function.c +++ b/src/function.c @@ -1184,7 +1184,7 @@ func_error (char *o, char **argv, const char *funcname) } default: - OS (fatal, *expanding_var, "Internal error: func_error: '%s'", funcname); + OS (fatal, *expanding_var, "INTERNAL: func_error: '%s'", funcname); } /* The warning function expands to the empty string. */ @@ -1669,7 +1669,7 @@ windows32_openpipe (int *pipedes, int errfd, pid_t *pid_p, char **command_argv, if (hIn == INVALID_HANDLE_VALUE) { ON (error, NILF, - _("windows32_openpipe: DuplicateHandle(In) failed (e=%lu)\n"), e); + _("windows32_openpipe: DuplicateHandle(In) failed (e=%lu)"), e); return -1; } } @@ -1693,14 +1693,14 @@ windows32_openpipe (int *pipedes, int errfd, pid_t *pid_p, char **command_argv, if (hErr == INVALID_HANDLE_VALUE) { ON (error, NILF, - _("windows32_openpipe: DuplicateHandle(Err) failed (e=%lu)\n"), e); + _("windows32_openpipe: DuplicateHandle(Err) failed (e=%lu)"), e); return -1; } } if (! CreatePipe (&hChildOutRd, &hChildOutWr, &saAttr, 0)) { - ON (error, NILF, _("CreatePipe() failed (e=%lu)\n"), GetLastError()); + ON (error, NILF, _("CreatePipe() failed (e=%lu)"), GetLastError()); return -1; } @@ -1708,7 +1708,7 @@ windows32_openpipe (int *pipedes, int errfd, pid_t *pid_p, char **command_argv, if (!hProcess) { - O (error, NILF, _("windows32_openpipe(): process_init_fd() failed\n")); + O (error, NILF, _("windows32_openpipe(): process_init_fd() failed")); return -1; } @@ -2706,17 +2706,17 @@ define_new_function (const floc *flocp, const char *name, len = e - name; if (len == 0) - O (fatal, flocp, _("Empty function name")); + O (fatal, flocp, _("empty function name")); if (*name == '.' || *e != '\0') - OS (fatal, flocp, _("Invalid function name: %s"), name); + OS (fatal, flocp, _("invalid function name: %s"), name); if (len > 255) - OS (fatal, flocp, _("Function name too long: %s"), name); + OS (fatal, flocp, _("function name too long: %s"), name); if (min > 255) ONS (fatal, flocp, - _("Invalid minimum argument count (%u) for function %s"), min, name); + _("invalid minimum argument count (%u) for function %s"), min, name); if (max > 255 || (max && max < min)) ONS (fatal, flocp, - _("Invalid maximum argument count (%u) for function %s"), max, name); + _("invalid maximum argument count (%u) for function %s"), max, name); ent = xmalloc (sizeof (struct function_table_entry)); ent->name = strcache_add (name); diff --git a/src/job.c b/src/job.c index bca45529..4df75132 100644 --- a/src/job.c +++ b/src/job.c @@ -1110,7 +1110,7 @@ free_child (struct child *child) output_close (&child->output); if (!jobserver_tokens) - ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left", + ONS (fatal, NILF, "INTERNAL: freeing child %p (%s) but no tokens left", child, child->file->name); /* If we're using the jobserver and this child is not the only outstanding @@ -2242,7 +2242,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv) if (save_fdin >= 0) { if (dup2 (save_fdin, FD_STDIN) != FD_STDIN) - O (fatal, NILF, _("Could not restore stdin")); + O (fatal, NILF, _("could not restore stdin")); else close (save_fdin); } @@ -2250,7 +2250,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv) if (save_fdout >= 0) { if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT) - O (fatal, NILF, _("Could not restore stdout")); + O (fatal, NILF, _("could not restore stdout")); else close (save_fdout); } @@ -2258,7 +2258,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv) if (save_fderr >= 0) { if (dup2 (save_fderr, FD_STDERR) != FD_STDERR) - O (fatal, NILF, _("Could not restore stderr")); + O (fatal, NILF, _("could not restore stderr")); else close (save_fderr); } diff --git a/src/load.c b/src/load.c index 0f8d1860..91200dfa 100644 --- a/src/load.c +++ b/src/load.c @@ -57,7 +57,7 @@ load_object (const floc *flocp, int noerror, const char *ldname, if (! global_dl) { const char *err = dlerror (); - OS (fatal, flocp, _("Failed to open global symbol table: %s"), err); + OS (fatal, flocp, _("failed to open global symbol table: %s"), err); } } @@ -96,14 +96,14 @@ load_object (const floc *flocp, int noerror, const char *ldname, symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible"); if (! symp) OS (fatal, flocp, - _("Loaded object %s is not declared to be GPL compatible"), + _("loaded object %s is not declared to be GPL compatible"), ldname); symp = (load_func_t) dlsym (dlp, symname); if (! symp) { const char *err = dlerror (); - OSSS (fatal, flocp, _("Failed to load symbol %s from %s: %s"), + OSSS (fatal, flocp, _("failed to load symbol %s from %s: %s"), symname, ldname, err); } @@ -148,7 +148,7 @@ load_file (const floc *flocp, struct file *file, int noerror) ++fp; if (fp == ep) - OS (fatal, flocp, _("Empty symbol name for load: %s"), ldname); + OS (fatal, flocp, _("empty symbol name for load: %s"), ldname); /* Make a copy of the ldname part. */ memcpy (new, ldname, l); @@ -248,7 +248,7 @@ load_file (const floc *flocp, struct file *file UNUSED, int noerror) { if (! noerror) O (fatal, flocp, - _("The 'load' operation is not supported on this platform")); + _("'load' is not supported on this platform")); return 0; } @@ -256,7 +256,7 @@ load_file (const floc *flocp, struct file *file UNUSED, int noerror) int unload_file (const char *name UNUSED) { - O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported"); + O (fatal, NILF, "INTERNAL: cannot unload when load is not supported"); } #endif /* MAKE_LOAD */ diff --git a/src/main.c b/src/main.c index f4250726..5d6b9e76 100644 --- a/src/main.c +++ b/src/main.c @@ -1824,7 +1824,7 @@ main (int argc, char **argv, char **envp) goto job_setup_complete; /* Oops: we have jobserver-auth but it's invalid :(. */ - O (error, NILF, _("warning: jobserver unavailable: using -j1. Add '+' to parent make rule.")); + O (error, NILF, _("warning: jobserver unavailable: using -j1 (add '+' to parent make rule)")); arg_job_slots = 1; } @@ -1832,7 +1832,7 @@ main (int argc, char **argv, char **envp) the master make of a new jobserver group. */ else if (!restarts) ON (error, NILF, - _("warning: -j%d forced in submake: resetting jobserver mode."), + _("warning: -j%d forced in submake: resetting jobserver mode"), argv_slots); /* We can't use our parent's jobserver, so reset. */ @@ -2082,7 +2082,7 @@ main (int argc, char **argv, char **envp) Make us the master of a new jobserver group. */ if (!restarts) ON (error, NILF, - _("warning: -j%d forced in makefile: resetting jobserver mode."), + _("warning: -j%d forced in makefile: resetting jobserver mode"), arg_job_slots); /* We can't use our parent's jobserver, so reset. */ @@ -2178,8 +2178,8 @@ main (int argc, char **argv, char **envp) ) { O (error, NILF, - _("Parallel jobs (-j) are not supported on this platform.")); - O (error, NILF, _("Resetting to single job (-j1) mode.")); + _("parallel jobs (-j) are not supported on this platform")); + O (error, NILF, _("resetting to single job (-j1) mode")); arg_job_slots = INVALID_JOB_SLOTS; job_slots = 1; } @@ -2242,7 +2242,7 @@ main (int argc, char **argv, char **envp) #ifndef MAKE_SYMLINKS if (check_symlink_flag) { - O (error, NILF, _("Symbolic links not supported: disabling -L.")); + O (error, NILF, _("symbolic links not supported: disabling -L")); check_symlink_flag = 0; } #endif @@ -2520,8 +2520,7 @@ main (int argc, char **argv, char **envp) /* The update failed and this makefile was not from the MAKEFILES variable, so we care. */ OS (error, &d->floc, - _("Failed to remake makefile '%s'."), - d->file->name); + _("failed to remake makefile '%s'"), d->file->name); mtime = file_mtime_no_search (d->file); any_remade |= (mtime != NONEXISTENT_MTIME && mtime != makefile_mtimes[i]); @@ -2540,11 +2539,11 @@ main (int argc, char **argv, char **envp) /* An included makefile. We don't need to die, but we do want to complain. */ OS (error, &d->floc, - _("Included makefile '%s' was not found."), dnm); + _("included makefile '%s' was not found"), dnm); else { /* A normal makefile. We must die later. */ - OS (error, NILF, _("Makefile '%s' was not found"), dnm); + OS (error, NILF, _("makefile '%s' was not found"), dnm); any_failed = 1; } } @@ -2692,7 +2691,7 @@ main (int argc, char **argv, char **envp) } if (bad) O (fatal, NILF, - _("Couldn't change back to original directory")); + _("couldn't change back to original directory")); } ++restarts; @@ -2898,7 +2897,7 @@ main (int argc, char **argv, char **envp) /* If we detected some clock skew, generate one last warning */ if (clock_skew_detected) O (error, NILF, - _("warning: Clock skew detected. Your build may be incomplete.")); + _("warning: clock skew detected: your build may be incomplete")); /* Exit. */ die (makefile_status); @@ -3715,7 +3714,7 @@ clean_jobserver (int status) { if (status != 2) ON (error, NILF, - "INTERNAL: Exiting with %u jobserver tokens (should be 0)!", + "INTERNAL: exiting with %u jobserver tokens (should be 0)!", jobserver_tokens); else /* Don't write back the "free" token */ @@ -3733,7 +3732,7 @@ clean_jobserver (int status) if (tokens != master_job_slots) ONN (error, NILF, - "INTERNAL: Exiting with %u jobserver tokens available; should be %u!", + "INTERNAL: exiting with %u jobserver tokens available; should be %u!", tokens, master_job_slots); reset_jobserver (); diff --git a/src/output.c b/src/output.c index 2cf76072..5943370d 100644 --- a/src/output.c +++ b/src/output.c @@ -249,7 +249,7 @@ setup_tmpfile (struct output *out) /* If we failed to create a temp file, disable output sync going forward. */ error: O (error, NILF, - _("cannot open output-sync lock file, suppressing output-sync.")); + _("cannot open output-sync lock file: suppressing output-sync")); output_close (out); output_sync = OUTPUT_SYNC_NONE; @@ -280,7 +280,7 @@ output_dump (struct output *out) if (!osync_acquire ()) { O (error, NILF, - _("warning: Cannot acquire output lock, disabling output sync.")); + _("warning: cannot acquire output lock: disabling output sync")); osync_clear (); } diff --git a/src/read.c b/src/read.c index 878a5620..91171081 100644 --- a/src/read.c +++ b/src/read.c @@ -1827,7 +1827,7 @@ record_target_var (struct nameseq *filenames, char *defn, current_variable_set_list = f->variables; v = try_variable_definition (flocp, defn, origin, 1); if (!v) - O (fatal, flocp, _("Malformed target-specific variable definition")); + O (fatal, flocp, _("malformed target-specific variable definition")); current_variable_set_list = global; } diff --git a/src/remake.c b/src/remake.c index dfe981c3..04daf49c 100644 --- a/src/remake.c +++ b/src/remake.c @@ -101,7 +101,7 @@ check_also_make (const struct file *file) for (ad = file->also_make; ad; ad = ad->next) if (ad->file->last_mtime == NONEXISTENT_MTIME) OS (error, file->cmds ? &file->cmds->fileinfo : NILF, - _("warning: pattern recipe did not update peer target '%s'."), + _("warning: pattern recipe did not update peer target '%s'"), ad->file->name); } @@ -529,7 +529,7 @@ update_file_1 (struct file *file, unsigned int depth) int ns = FILE_TIMESTAMP_NS (this_mtime); if (ns != 0) OS (error, NILF, - _("*** Warning: .LOW_RESOLUTION_TIME file '%s' has a high resolution time stamp"), + _("*** warning: .LOW_RESOLUTION_TIME file '%s' has a high resolution time stamp"), file->name); this_mtime += FILE_TIMESTAMPS_PER_S - 1 - ns; } @@ -612,7 +612,7 @@ update_file_1 (struct file *file, unsigned int depth) if (is_updating (d->file)) { - OSS (error, NILF, _("Circular %s <- %s dependency dropped."), + OSS (error, NILF, _("circular %s <- %s dependency dropped"), file->name, d->file->name); if (lastd == 0) @@ -1177,7 +1177,7 @@ check_dep (struct file *file, unsigned int depth, if (is_updating (d->file)) { - OSS (error, NILF, _("Circular %s <- %s dependency dropped."), + OSS (error, NILF, _("circular %s <- %s dependency dropped"), file->name, d->file->name); if (ld == 0) { @@ -1513,7 +1513,7 @@ f_mtime (struct file *file, int search) else sprintf (from_now_string, "%.2g", from_now); OSS (error, NILF, - _("Warning: File '%s' has modification time %s s in the future"), + _("warning: file '%s' has modification time %s s in the future"), file->name, from_now_string); clock_skew_detected = 1; } diff --git a/src/rule.c b/src/rule.c index 85b65ff5..bdf04e19 100644 --- a/src/rule.c +++ b/src/rule.c @@ -616,7 +616,7 @@ print_rule_data_base (void) /* This can happen if a fatal error was detected while reading the makefiles and thus count_implicit_rule_limits wasn't called yet. */ if (num_pattern_rules != 0) - ONN (fatal, NILF, _("BUG: num_pattern_rules is wrong! %u != %u"), + ONN (fatal, NILF, "INTERNAL: num_pattern_rules is wrong! %u != %u", num_pattern_rules, rules); } } diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon index a039b0a9..7b55440b 100644 --- a/tests/scripts/features/double_colon +++ b/tests/scripts/features/double_colon @@ -83,7 +83,7 @@ if ($parallel_jobs) { # TEST 8: Test circular dependency check; PR/1671 -run_make_test(undef, "d", "ok\n$make_name: Circular d <- d dependency dropped.\noops\n"); +run_make_test(undef, "d", "ok\n$make_name: circular d <- d dependency dropped\noops\n"); # TEST 8: I don't grok why this is different than the above, but it is... # diff --git a/tests/scripts/features/implicit_search b/tests/scripts/features/implicit_search index 57782c94..09cf4d79 100644 --- a/tests/scripts/features/implicit_search +++ b/tests/scripts/features/implicit_search @@ -177,7 +177,7 @@ all: hello.tsk %.o:$r %.c; \$(info hello.c) %.o:$r %.f %.tsk; \$(info hello.f) ", '-r', -"#MAKE#: Circular hello.o <- hello.tsk dependency dropped.\nhello.f\nhello.tsk\n#MAKE#: Nothing to be done for 'all'."); +"#MAKE#: circular hello.o <- hello.tsk dependency dropped\nhello.f\nhello.tsk\n#MAKE#: Nothing to be done for 'all'."); } diff --git a/tests/scripts/features/include b/tests/scripts/features/include index cedabf7f..c20e185b 100644 --- a/tests/scripts/features/include +++ b/tests/scripts/features/include @@ -432,9 +432,9 @@ all:; @echo hello include inc_b.mk %_a.mk %_b.mk:; exit 1 !, - '', "exit 1\n#MAKEFILE#:4: Failed to remake makefile 'inc_b.mk'.\n", 512); + '', "exit 1\n#MAKEFILE#:4: failed to remake makefile 'inc_b.mk'", 512); -run_make_test(undef, '-k', "exit 1\n#MAKEFILE#:4: Failed to remake makefile 'inc_b.mk'.\n", 512); +run_make_test(undef, '-k', "exit 1\n#MAKEFILE#:4: failed to remake makefile 'inc_b.mk'", 512); # It seems wrong to me that this gives a different error message, but at # least it doesn't keep going. @@ -446,7 +446,7 @@ include inc_a.mk !, '', "exit 1\n#MAKEFILE#:3: inc_a.mk: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: inc_a.mk] Error 1\n", 512); -run_make_test(undef, '-k', "exit 1\n#MAKEFILE#:3: inc_a.mk: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: inc_a.mk] Error 1\n#MAKEFILE#:3: Failed to remake makefile 'inc_a.mk'.\n", 512); +run_make_test(undef, '-k', "exit 1\n#MAKEFILE#:3: inc_a.mk: $ERR_no_such_file\n#MAKE#: *** [#MAKEFILE#:5: inc_a.mk] Error 1\n#MAKEFILE#:3: failed to remake makefile 'inc_a.mk'", 512); # Check the default makefiles... this requires us to invoke make with no # arguments. Also check MAKEFILES diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver index ad5f9e7f..f8cae542 100644 --- a/tests/scripts/features/jobserver +++ b/tests/scripts/features/jobserver @@ -14,7 +14,7 @@ if (!$parallel_jobs) { # Shorthand my $np = '--no-print-directory'; -my $j1err = "warning: jobserver unavailable: using -j1. Add '+' to parent make rule."; +my $j1err = "warning: jobserver unavailable: using -j1 (add '+' to parent make rule)"; # Simple test of MAKEFLAGS settings run_make_test(q! @@ -42,7 +42,7 @@ recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -j3 -f #MAKEFILE# recurse2 recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all all:;@echo $@: "/$(SHOW)/" !, - "-j2 $np", "recurse: /-j2 --jobserver-auth= $np/\n#MAKE#[1]: warning: -j3 forced in submake: resetting jobserver mode.\nrecurse2: /-j3 --jobserver-auth= $np/\nall: /-j3 --jobserver-auth= $np/\n"); + "-j2 $np", "recurse: /-j2 --jobserver-auth= $np/\n#MAKE#[1]: warning: -j3 forced in submake: resetting jobserver mode\nrecurse2: /-j3 --jobserver-auth= $np/\nall: /-j3 --jobserver-auth= $np/\n"); # Test override of -jN with -j run_make_test(q! @@ -51,7 +51,7 @@ recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE) -j -f #MAKEFILE# recurse2 recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all all:;@echo $@: "/$(SHOW)/" !, - "-j2 $np", "recurse: /-j2 --jobserver-auth= $np/\n#MAKE#[1]: warning: -j0 forced in submake: resetting jobserver mode.\nrecurse2: /-j $np/\nall: /-j $np/\n"); + "-j2 $np", "recurse: /-j2 --jobserver-auth= $np/\n#MAKE#[1]: warning: -j0 forced in submake: resetting jobserver mode\nrecurse2: /-j $np/\nall: /-j $np/\n"); # Don't put --jobserver-auth into a re-exec'd MAKEFLAGS. # We can't test this directly because there's no way a makefile can @@ -76,7 +76,7 @@ inc.mk: #> @echo 'MAKEFLAGS = $(MAKEFLAGS)' > @echo 'FOO = bar' > $@ !, - "$np -j2", "#MAKE#[1]: warning: -j2 forced in submake: resetting jobserver mode.\nall\n"); + "$np -j2", "#MAKE#[1]: warning: -j2 forced in submake: resetting jobserver mode\nall\n"); unlink('inc.mk'); @@ -118,7 +118,7 @@ recurse: ; @echo hi !, '-w -j2', "#MAKE#: Entering directory '#PWD#' #MAKE#[1]: Entering directory '#PWD#' -#MAKE#[1]: warning: -j1 forced in submake: resetting jobserver mode. +#MAKE#[1]: warning: -j1 forced in submake: resetting jobserver mode hi #MAKE#[1]: Leaving directory '#PWD#' #MAKE#: Leaving directory '#PWD#'\n"); diff --git a/tests/scripts/features/mult_rules b/tests/scripts/features/mult_rules index bddd501c..ca6a1afe 100644 --- a/tests/scripts/features/mult_rules +++ b/tests/scripts/features/mult_rules @@ -1,3 +1,5 @@ +# -*-perl-*- + $description = "\ The following test creates a makefile to test the presence of multiple rules for one target. One file can be the @@ -21,8 +23,8 @@ print MAKEFILE <> a.x'); # Put the timestamp for a.x into the future; it should still be remade. - +# There are clock skew errors printed here but they will be cleared by +# the comparison code. utouch(1000, 'a.x'); run_make_test(undef, '', "#MAKE#: 'a.x' is up to date."); run_make_test(undef, '-W b.x', 'echo >> a.x'); @@ -50,6 +51,8 @@ touch baz.x'); # Now run with -W bar.x # Tweak foo.x's timestamp so the update will change it. +# There are clock skew errors printed here but they will be cleared by +# the comparison code. &utouch(1000, 'foo.x'); run_make_test(undef, '-W bar.x', "restarts=\ntouch foo.x\nrestarts=1\ntouch baz.x"); diff --git a/tests/scripts/options/dash-k b/tests/scripts/options/dash-k index 4bd68f03..fec630c3 100644 --- a/tests/scripts/options/dash-k +++ b/tests/scripts/options/dash-k @@ -108,7 +108,7 @@ ifile: no-such-file; exit 1 '-k', "#MAKEFILE#:2: ifile: $ERR_no_such_file #MAKE#: *** No rule to make target 'no-such-file', needed by 'ifile'. -#MAKEFILE#:2: Failed to remake makefile 'ifile'.\n", +#MAKEFILE#:2: failed to remake makefile 'ifile'", 512); } diff --git a/tests/scripts/options/shuffle b/tests/scripts/options/shuffle index 5661683c..c19128f7 100644 --- a/tests/scripts/options/shuffle +++ b/tests/scripts/options/shuffle @@ -92,7 +92,7 @@ all: a_ b_ ; @echo $@ a_: b_ b_: a_ ', - '--shuffle=reverse', "#MAKE#: Circular a_ <- b_ dependency dropped.\na_\nb_\nall"); + '--shuffle=reverse', "#MAKE#: circular a_ <- b_ dependency dropped\na_\nb_\nall"); # Check if order-only dependencies get reordered. run_make_test(' diff --git a/tests/scripts/targets/DELETE_ON_ERROR b/tests/scripts/targets/DELETE_ON_ERROR index f0d9f9b4..f9ed88aa 100644 --- a/tests/scripts/targets/DELETE_ON_ERROR +++ b/tests/scripts/targets/DELETE_ON_ERROR @@ -8,7 +8,7 @@ run_make_test(' .DELETE_ON_ERROR: all: ; exit 1 > $@ ', - '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** Deleting file 'all'", 512); + '', "exit 1 > all\n#MAKE#: *** [#MAKEFILE#:3: all] Error 1\n#MAKE#: *** deleting file 'all'", 512); run_make_test(' .DELETE_ON_ERROR: @@ -16,7 +16,7 @@ all: foo.x ; %.x : %.q ; echo > $@ %.q : ; exit 1 > $@ ', - '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** Deleting file 'foo.q'", 512); + '', "exit 1 > foo.q\n#MAKE#: *** [#MAKEFILE#:5: foo.q] Error 1\n#MAKE#: *** deleting file 'foo.q'", 512); # This tells the test driver that the perl test script executed properly. 1; diff --git a/tests/test_driver.pl b/tests/test_driver.pl index 93801956..b3a8cd2c 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -912,12 +912,12 @@ sub convert_answer_zos my ($log) = @_; # z/OS emits "Error 143" or "SIGTERM" instead of terminated - $log =~ s/Error 143/Terminated/gm; - $log =~ s/SIGTERM/Terminated/gm; + $log =~ s/Error 143/Terminated/igm; + $log =~ s/SIGTERM/Terminated/igm; # z/OS error messages have a prefix - $log =~ s/EDC5129I No such file or directory\./No such file or directory/gm; - $log =~ s/FSUM7351 not found/not found/gm; + $log =~ s/EDC5129I No such file or directory\./No such file or directory/igm; + $log =~ s/FSUM7351 not found/not found/igm; return $log; } @@ -929,8 +929,8 @@ sub compare_answer # For make, get rid of any time skew error before comparing--too bad this # has to go into the "generic" driver code :-/ - $log =~ s/^.*modification time .*in the future.*\n//gm; - $log =~ s/^.*Clock skew detected.*\n//gm; + $log =~ s/^.*modification time .*in the future.*\n//igm; + $log =~ s/^.*clock skew detected.*\n//igm; return 1 if ($log eq $kgo); # Get rid of newline differences, forever -- cgit v1.2.1