incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 3da25cef4 -> 686529d34 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/686529d3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/686529d3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/686529d3 Branch: refs/heads/HAWQ-400 Commit: 686529d34d9f625d70cda270c0361f6b65f5d2c8 Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 23:41:24 2016 -0800 -- src/test/regress/pg_regress.c | 49 +++-- src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 - 3 files changed, 36 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/686529d3/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..99aad84 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +char *initfile = NULL; +char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -575,7 +575,7 @@ load_expected_statuses(char *filename) f = fopen(filename, "r"); if (!f) { - fprintf(stderr, _("could not open file with expected statuses for reading: \n")); + fprintf(stderr, _("could not open file with expected statuses for reading: %s\n"), filename); exit_nicely(2); } @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -892,6 +896,7 @@ initialize_environment(void) convert_sourcefiles(); load_resultmap(); load_expected_statuses(expected_statuses_file); + free(expected_statuses_file); } /* @@ -982,6 +987,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1063,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -1276,6 +1283,7 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul snprintf(m_pretty_diff_opts, sizeof(m_pretty_diff_opts), "%s --gpd_init %s", pretty_diff_opts, initfile); + free(initfile); } else { @@ -2072,12 +2080,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2095,13 +2097,13 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc * before we add the specified one. */ free_stringlist(&dblist); - split_to_stringlist(strdup(optarg), ", ", &dblist); + split_to_stringlist(optarg, ", ", &dblist); break; case 2: debug = true; break; case 3: - inputdir = strdup(optarg); +
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 4fddda4a2 -> 3da25cef4 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/3da25cef Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/3da25cef Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/3da25cef Branch: refs/heads/HAWQ-400 Commit: 3da25cef4bc10a30764a4545f764e349998723d2 Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 17:03:11 2016 -0800 -- src/test/regress/pg_regress.c | 25 - src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 24 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3da25cef/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..e103df1 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +char *initfile = NULL; +char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -575,7 +575,7 @@ load_expected_statuses(char *filename) f = fopen(filename, "r"); if (!f) { - fprintf(stderr, _("could not open file with expected statuses for reading: \n")); + fprintf(stderr, _("could not open file with expected statuses for reading: %s\n"), filename); exit_nicely(2); } @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -892,6 +896,7 @@ initialize_environment(void) convert_sourcefiles(); load_resultmap(); load_expected_statuses(expected_statuses_file); + free(expected_statuses_file); } /* @@ -982,6 +987,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1063,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -1276,6 +1283,7 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul snprintf(m_pretty_diff_opts, sizeof(m_pretty_diff_opts), "%s --gpd_init %s", pretty_diff_opts, initfile); + free(initfile); } else { @@ -2072,12 +2080,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2177,6 +2179,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn't pass arguments +*/ + ifunc(); + + /* * Initialization */ open_result_files(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3da25cef/src/test/regress/pg_regress.h -- diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 94db0b4..906cef4 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -38,6 +38,8 @@ extern char *datadir; extern char *host_pla
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 8f5e585f4 -> 4fddda4a2 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/4fddda4a Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/4fddda4a Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/4fddda4a Branch: refs/heads/HAWQ-400 Commit: 4fddda4a2ce550829f6a8478af9ccdfef40a5fe5 Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 16:28:59 2016 -0800 -- src/test/regress/pg_regress.c | 27 +-- src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 25 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4fddda4a/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..c68d78c 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +char *initfile = NULL; +char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -575,7 +575,7 @@ load_expected_statuses(char *filename) f = fopen(filename, "r"); if (!f) { - fprintf(stderr, _("could not open file with expected statuses for reading: \n")); + fprintf(stderr, _("could not open file with expected statuses for reading: %s\n"), filename); exit_nicely(2); } @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -892,6 +896,7 @@ initialize_environment(void) convert_sourcefiles(); load_resultmap(); load_expected_statuses(expected_statuses_file); + free(expected_statuses_file); } /* @@ -982,6 +987,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1063,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -1276,6 +1283,7 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul snprintf(m_pretty_diff_opts, sizeof(m_pretty_diff_opts), "%s --gpd_init %s", pretty_diff_opts, initfile); + free(initfile); } else { @@ -2072,12 +2080,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2157,7 +2159,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc initfile = strdup(optarg); break; case 20: - expected_statuses_file = strdup(optarg); + //expected_statuses_file = strdup(optarg); break; default: /* getopt_long already emitted a complaint */ @@ -2177,6 +2179,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn'
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 1aec59ce5 -> 8f5e585f4 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/8f5e585f Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/8f5e585f Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/8f5e585f Branch: refs/heads/HAWQ-400 Commit: 8f5e585f4d85194dd7f1b271b747322277d99cb8 Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 15:12:16 2016 -0800 -- src/test/regress/pg_regress.c | 25 - src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 24 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8f5e585f/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..e103df1 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +char *initfile = NULL; +char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -575,7 +575,7 @@ load_expected_statuses(char *filename) f = fopen(filename, "r"); if (!f) { - fprintf(stderr, _("could not open file with expected statuses for reading: \n")); + fprintf(stderr, _("could not open file with expected statuses for reading: %s\n"), filename); exit_nicely(2); } @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -892,6 +896,7 @@ initialize_environment(void) convert_sourcefiles(); load_resultmap(); load_expected_statuses(expected_statuses_file); + free(expected_statuses_file); } /* @@ -982,6 +987,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1063,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -1276,6 +1283,7 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul snprintf(m_pretty_diff_opts, sizeof(m_pretty_diff_opts), "%s --gpd_init %s", pretty_diff_opts, initfile); + free(initfile); } else { @@ -2072,12 +2080,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2177,6 +2179,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn't pass arguments +*/ + ifunc(); + + /* * Initialization */ open_result_files(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8f5e585f/src/test/regress/pg_regress.h -- diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 94db0b4..906cef4 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -38,6 +38,8 @@ extern char *datadir; extern char *host_pla
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 c91aed5b0 -> 1aec59ce5 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/1aec59ce Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/1aec59ce Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/1aec59ce Branch: refs/heads/HAWQ-400 Commit: 1aec59ce5169e26d5b63bca2da49eb3485429db5 Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 13:45:58 2016 -0800 -- src/test/regress/pg_regress.c | 23 ++- src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 22 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1aec59ce/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..9ba82eb 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +char *initfile = NULL; +char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -575,7 +575,7 @@ load_expected_statuses(char *filename) f = fopen(filename, "r"); if (!f) { - fprintf(stderr, _("could not open file with expected statuses for reading: \n")); + fprintf(stderr, _("could not open file with expected statuses for reading: %s\n"), filename); exit_nicely(2); } @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -982,6 +986,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1062,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -2072,12 +2078,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2177,6 +2177,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn't pass arguments +*/ + ifunc(); + + /* * Initialization */ open_result_files(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1aec59ce/src/test/regress/pg_regress.h -- diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 94db0b4..906cef4 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -38,6 +38,8 @@ extern char *datadir; extern char *host_platform; extern _stringlist *dblist; +extern char *initfile; +extern char *expected_statuses_file; extern bool debug; extern char *inputdir; extern char *outputdir; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1aec59ce/src/test/regress/pg_regress_main.c -- diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c index b3245b5..afbf132 100644 --- a/src/test/regress/pg_regress_main.c +++ b/src/test/reg
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 f5ddbbbcf -> c91aed5b0 (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/c91aed5b Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/c91aed5b Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/c91aed5b Branch: refs/heads/HAWQ-400 Commit: c91aed5b06ff28ec5aa22508bc9852c72677d5ff Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 11:19:37 2016 -0800 -- src/test/regress/pg_regress.c | 21 + src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 21 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c91aed5b/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..08af4a2 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +static char *initfile = NULL; +static char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -982,6 +986,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1062,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -2072,12 +2078,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2177,6 +2177,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn't pass arguments +*/ + ifunc(); + + /* * Initialization */ open_result_files(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c91aed5b/src/test/regress/pg_regress.h -- diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 94db0b4..906cef4 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -38,6 +38,8 @@ extern char *datadir; extern char *host_platform; extern _stringlist *dblist; +extern char *initfile; +extern char *expected_statuses_file; extern bool debug; extern char *inputdir; extern char *outputdir; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/c91aed5b/src/test/regress/pg_regress_main.c -- diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c index b3245b5..afbf132 100644 --- a/src/test/regress/pg_regress_main.c +++ b/src/test/regress/pg_regress_main.c @@ -108,7 +108,12 @@ static void psql_init(void) { /* set default regression database name */ - add_stringlist_item(&dblist, "regression"); + if (!dblist) + add_stringlist_item(&dblist, "regression"); + if(!expected_statuses_file) + expected_statuses_file = "expected_statuses"; +
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 3163e6c5f -> f5ddbbbcf (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/f5ddbbbc Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/f5ddbbbc Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/f5ddbbbc Branch: refs/heads/HAWQ-400 Commit: f5ddbbbcf512f7a67e490e6c115f358503e7c9cf Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Fri Feb 19 11:18:10 2016 -0800 -- src/test/regress/pg_regress.c | 22 ++ src/test/regress/pg_regress.h | 2 ++ src/test/regress/pg_regress_main.c | 7 ++- 3 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f5ddbbbc/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..ba41c83 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -91,8 +91,8 @@ static intport = -1; static char *user = NULL; static char *srcdir = NULL; static _stringlist *extraroles = NULL; -static char *initfile = "./init_file"; -static char *expected_statuses_file = "expected_statuses"; +static char *initfile = NULL; +static char *expected_statuses_file = NULL; /* internal variables */ static const char *progname; @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -982,6 +986,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1062,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -2072,12 +2078,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc hostname = "localhost"; #endif - /* -* We call the initialization function here because that way we can set -* default parameters and let them be overwritten by the commandline. -*/ - ifunc(); - while ((c = getopt_long(argc, argv, "hV", long_options, &option_index)) != -1) { switch (c) @@ -2157,6 +2157,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc initfile = strdup(optarg); break; case 20: + expected_statuses_file = NULL; expected_statuses_file = strdup(optarg); break; default: @@ -2177,6 +2178,11 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc } /* +* Set default values if user didn't pass arguments +*/ + ifunc(); + + /* * Initialization */ open_result_files(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f5ddbbbc/src/test/regress/pg_regress.h -- diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 94db0b4..906cef4 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -38,6 +38,8 @@ extern char *datadir; extern char *host_platform; extern _stringlist *dblist; +extern char *initfile; +extern char *expected_statuses_file; extern bool debug; extern char *inputdir; extern char *outputdir; http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f5ddbbbc/src/test/regress/pg_regress_main.c -- diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c index b
incubator-hawq git commit: HAWQ-400. Support expected exit codes for regression tests, fixed leaks. [Forced Update!]
Repository: incubator-hawq Updated Branches: refs/heads/HAWQ-400 1b362bbf6 -> 3163e6c5f (forced update) HAWQ-400. Support expected exit codes for regression tests, fixed leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/3163e6c5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/3163e6c5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/3163e6c5 Branch: refs/heads/HAWQ-400 Commit: 3163e6c5fab18f9d754c56bb8818f34afd0a993e Parents: 73eb65f Author: Oleksandr Diachenko Authored: Thu Feb 18 15:03:20 2016 -0800 Committer: Oleksandr Diachenko Committed: Thu Feb 18 19:43:23 2016 -0800 -- src/test/regress/pg_regress.c | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3163e6c5/src/test/regress/pg_regress.c -- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index b1f1846..21469ad 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -780,6 +780,8 @@ doputenv(const char *var, const char *val) sprintf(s, "%s=%s", var, val); putenv(s); + + free(s); } /* @@ -844,6 +846,8 @@ initialize_environment(void) new_pgoptions = malloc(strlen(old_pgoptions) + strlen(my_pgoptions) + 12); sprintf(new_pgoptions, "PGOPTIONS=%s %s", old_pgoptions, my_pgoptions); putenv(new_pgoptions); + + free(new_pgoptions); } { @@ -982,6 +986,7 @@ spawn_process(const char *cmdline) execl(shellprog, shellprog, "-c", cmdline2, (char *) NULL); fprintf(stderr, _("%s: could not exec \"%s\": %s\n"), progname, shellprog, strerror(errno)); + free(cmdline2); exit(1);/* not exit_nicely here... */ } /* in parent */ @@ -1057,6 +1062,7 @@ spawn_process(const char *cmdline) cmdline2 = malloc(strlen(cmdline) + 8); sprintf(cmdline2, "cmd /c %s", cmdline); + free(cmdline2); #ifndef __CYGWIN__ AddUserToTokenDacl(restrictedToken); @@ -2157,6 +2163,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc initfile = strdup(optarg); break; case 20: + expected_statuses_file = NULL; expected_statuses_file = strdup(optarg); break; default: