Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Catch unit testing framework #874

Merged
merged 4 commits into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions unit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Unit test binaries
miniBDD
sharing_node
string_utils
unit_tests
6 changes: 3 additions & 3 deletions unit/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: all cprover.dir test

SRC = catch_entry_point.cpp \
SRC = unit_tests.cpp \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to specify the tests to build and execute in a way that does not require to add them in three different places?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the test is catch_example, which is only specified once, in SRC. That's where extra tests will be added. The other executables here will be migrated to the Catch framework over time and be removed from this makefile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the plan to put all tests into a single cpp file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple cpp files, since executable is my understanding.

catch_example.cpp \
# Empty last line

Expand All @@ -26,7 +26,7 @@ LIBS = ../src/ansi-c/ansi-c$(LIBEXT) \
../src/solvers/solvers$(LIBEXT) \
# Empty last line

TESTS = catch_entry_point$(EXEEXT) \
TESTS = unit_tests$(EXEEXT) \
miniBDD$(EXEEXT) \
string_utils$(EXEEXT) \
sharing_node$(EXEEXT) \
Expand All @@ -43,7 +43,7 @@ test: all

###############################################################################

catch_entry_point$(EXEEXT): $(OBJ)
unit_tests$(EXEEXT): $(OBJ)
$(LINKBIN)

miniBDD$(EXEEXT): miniBDD$(OBJEXT)
Expand Down
5 changes: 0 additions & 5 deletions unit/catch_entry_point.cpp → unit/unit_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
Author: DiffBlue Limited. All rights reserved.

\*******************************************************************/
#ifndef CATCH_ENTRY_POINT_H
#define CATCH_ENTRY_POINT_H

#define CATCH_CONFIG_MAIN
#include "catch.hpp"


#endif // CATCH_ENTRY_POINT_H