Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita3bae60

Browse files
committed
have pg_regress fall back on testing with the canonical results file if analternative test is specified but none succeeds.
1 parent8d5f3c8 commita3bae60

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.17 2006/07/30 01:45:21 momjian Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.18 2006/08/01 14:56:29 adunstan Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -913,6 +913,36 @@ results_differ(const char *testname)
913913
}
914914
}
915915

916+
/*
917+
* fall back on the canonical results file if we haven't tried it yet
918+
* and haven't found a complete match yet.
919+
*/
920+
921+
if (strcmp(expectname,testname)!=0)
922+
{
923+
snprintf(expectfile,sizeof(expectfile),"%s/expected/%s.out",
924+
inputdir,testname,i);
925+
926+
snprintf(cmd,sizeof(cmd),
927+
SYSTEMQUOTE"diff %s \"%s\" \"%s\" > \"%s\""SYSTEMQUOTE,
928+
basic_diff_opts,expectfile,resultsfile,diff);
929+
930+
if (run_diff(cmd,diff)==0)
931+
{
932+
/* No diff = no changes = good */
933+
unlink(diff);
934+
return false;
935+
}
936+
937+
l=file_line_count(diff);
938+
if (l<best_line_count)
939+
{
940+
/* This diff was a better match than the last one */
941+
best_line_count=l;
942+
strcpy(best_expect_file,expectfile);
943+
}
944+
}
945+
916946
/*
917947
* Use the best comparison file to generate the "pretty" diff, which
918948
* we append to the diffs summary file.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp