Modify test-heap.c to use ovstest framework.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
tests/valgrind/test-file_name \
tests/valgrind/test-flows \
tests/valgrind/test-hash \
- tests/valgrind/test-heap \
tests/valgrind/test-hindex \
tests/valgrind/test-hmap \
tests/valgrind/test-json \
tests_test_hash_SOURCES = tests/test-hash.c
tests_test_hash_LDADD = lib/libopenvswitch.la
-noinst_PROGRAMS += tests/test-heap
-tests_test_heap_SOURCES = tests/test-heap.c
-tests_test_heap_LDADD = lib/libopenvswitch.la
-
noinst_PROGRAMS += tests/test-hindex
tests_test_hindex_SOURCES = tests/test-hindex.c
tests_test_hindex_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/ovstest
tests_ovstest_SOURCES = tests/ovstest.c \
- tests/ovstest.h
+ tests/ovstest.h \
+ tests/test-heap.c
tests_ovstest_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-reconnect
m4_define([TEST_HEAP],
[AT_SETUP([heap library -- m4_bpatsubst([$1], [-], [ ])])
- AT_CHECK([test-heap $1])
+ AT_CHECK([ovstest test-heap $1])
AT_CLEANUP])
TEST_HEAP([insert-delete-same-order])
/*
- * Copyright (c) 2012 Nicira, Inc.
+ * Copyright (c) 2012, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "command-line.h"
#include "random.h"
#include "util.h"
+#include "ovstest.h"
#undef NDEBUG
#include <assert.h>
test_heap_insert_delete_same_order_with_dups, },
{ "raw-insert", 0, 0, test_heap_raw_insert, },
{ "raw-delete", 0, 0, test_heap_raw_delete, },
+ { NULL, 0, 0, NULL, },
};
-int
-main(int argc, char *argv[])
+static void
+test_heap_main(int argc, char *argv[])
{
set_program_name(argv[0]);
run_command(argc - 1, argv + 1, commands);
-
- return 0;
}
+
+OVSTEST_REGISTER("test-heap", test_heap_main, commands);