Make most python tests pass with Python 3.4

Dictionary order is not stable in Python < 3.6 so we need to sort
by key to have consistent results.
The LogHandler output is also different on older Python versions.
Also, don't stop running python tests after the first error.
This commit is contained in:
Todd C. Miller
2020-04-07 14:03:58 -06:00
parent fa5025a569
commit cd74b83c21
13 changed files with 72 additions and 44 deletions

View File

@@ -61,22 +61,22 @@ char ** create_str_array(size_t count, ...);
#define RUN_TEST(testcase) \
do { \
int success = 1; \
printf("Running test " #testcase " ... \n"); \
int rc = EXIT_SUCCESS; \
if (!init()) { \
printf("FAILED: initialization of testcase %s at %s:%d\n", #testcase, __FILE__, __LINE__); \
rc = EXIT_FAILURE; \
success = 0; \
} else \
if (!testcase) { \
printf("FAILED: testcase %s at %s:%d\n", #testcase, __FILE__, __LINE__); \
rc = EXIT_FAILURE; \
success = 0; \
} \
if (!cleanup(rc == EXIT_SUCCESS)) { \
if (!cleanup(success)) { \
printf("FAILED: deitialization of testcase %s at %s:%d\n", #testcase, __FILE__, __LINE__); \
rc = EXIT_FAILURE; \
success = 0; \
} \
if (rc != EXIT_SUCCESS) \
return rc; \
if (!success) \
errors++; \
} while(false)
#define VERIFY_PRINT_MSG(fmt, actual_str, actual, expected_str, expected, expected_to_be_message) \