base build system for a coding dojo
Created
August 1, 2012 17:43
-
-
Save PeterHajdu/3229141 to your computer and use it in GitHub Desktop.
base config for the coding dojo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "some.hpp" | |
int some() | |
{ | |
return 1; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _SOME_HPP_ | |
#define _SOME_HPP_ | |
int some(); | |
#endif | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cxxtest/TestSuite.h> | |
#include "some.hpp" | |
class SomeTest : public CxxTest::TestSuite | |
{ | |
public: | |
void testSome() | |
{ | |
TS_ASSERT_EQUALS( 1, some() ); | |
} | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include_rules | |
: test_*.hpp |> !generate_test |> testFile.cpp | |
: foreach *.cpp |> !cpp |> | |
: *.o |> !link_test |> | |
: |> !run_test |> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS+=-Wall -pedantic --coverage -ggdb | |
CXX=g++ | |
!generate_test = |> cxxtestgen --error-printer -o %o %f |> | |
!cpp = |> $(CXX) $(CFLAGS) $(COMP_ATTR) %f -c |> %B.o %B.gcno | |
!link_test = |> $(CXX) $(CFLAGS) $(COMP_ATTR) %f -o %o |> testFile | |
!run_test = | testFile *.gcno |> valgrind --leak-check=full --show-reachable=yes ./testFile |> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment