test_slow_decompression: skip by default since it's flaky

Since this is a performance-based test, unfortunately it's always going
to be flaky, so it needs to be skipped by default.
This commit is contained in:
Eric Biggers 2019-08-30 00:14:43 -05:00
parent 8474418509
commit 0015560a82
3 changed files with 15 additions and 1 deletions

View File

@ -432,6 +432,8 @@ tmain(int argc, tchar *argv[])
program_invocation_name = get_filename(argv[0]);
begin_performance_test();
/* static huffman case */
generate_empty_static_huffman_blocks(in, sizeof(in));
t = do_test_libdeflate("static huffman", in, sizeof(in),
@ -457,7 +459,7 @@ tmain(int argc, tchar *argv[])
* FIXME: make it faster.
*/
putchar('\n');
ASSERT(t < 5 * tz);
ASSERT(t < 4 * tz);
/* original reproducer */
t = do_test_libdeflate("original repro", orig_repro, sizeof(orig_repro),

View File

@ -59,6 +59,16 @@ assertion_failed(const char *expr, const char *file, int line)
abort();
}
void
begin_performance_test(void)
{
if (getenv("INCLUDE_PERF_TESTS") == NULL) {
printf("Skipping '%"TS"' since it's a performance test, which may be flaky.\n",
program_invocation_name);
exit(0);
}
}
static size_t
get_page_size(void)
{

View File

@ -44,6 +44,8 @@ assertion_failed(const char *expr, const char *file, int line);
#define ASSERT(expr) { if (unlikely(!(expr))) \
assertion_failed(#expr, __FILE__, __LINE__); }
extern void begin_performance_test(void);
extern void alloc_guarded_buffer(size_t size, u8 **start_ret, u8 **end_ret);
extern void free_guarded_buffer(u8 *start, u8 *end);