-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
32,966 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.*.o | ||
.*.d | ||
.test-*.passed | ||
main |
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* @file | ||
* @copyright Ken Smith kgsmith at gmail.com, 2013. | ||
* @license This software is released under the Boost | ||
* Software License, version 1.0. | ||
* See LICENSE_1_0.txt or | ||
* http://www.boost.org/LICENSE_1_0.txt | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define TEST BOOST_AUTO_TEST_CASE | ||
#define FTST BOOST_FIXTURE_TEST_CASE | ||
#define EQ BOOST_REQUIRE_EQUAL | ||
#define NE BOOST_REQUIRE_NE | ||
#define THROW BOOST_REQUIRE_THROW | ||
#define NO_THROW BOOST_REQUIRE_NO_THROW | ||
|
||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MAIN | ||
#include <boost/test/unit_test.hpp> | ||
#include "stream_saver_t.hpp" | ||
|
||
inline std::string vecstr(const std::vector<char>& rhs) | ||
{ | ||
std::string s(rhs.begin(), rhs.end()); | ||
return s; | ||
} | ||
|
||
inline std::vector<char> vecstr(const std::string& rhs) | ||
{ | ||
std::vector<char> v(rhs.begin(), rhs.end()); | ||
return v; | ||
} | ||
|
||
inline std::ostream& operator<<(std::ostream& os, const std::nullptr_t& rhs) | ||
{ | ||
os << "nullptr"; | ||
return os; | ||
} | ||
|
||
inline std::ostream& operator<<(std::ostream& os, const std::vector<char>& rhs) | ||
{ | ||
stream_saver_t saver(os); | ||
|
||
os | ||
<< "[" | ||
<< rhs.size() | ||
<< "]" | ||
<< std::hex << "{"; | ||
for (char byte : rhs) | ||
{ | ||
os << "0x" << uint32_t(uint8_t(byte)) << ","; | ||
} | ||
os << "}"; | ||
|
||
return os; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This software is released under the Boost Software License, version 1.0. | ||
# See LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt | ||
# Copyright Ken Smith kgsmith at gmail dot com, 2013. | ||
|
||
# User configurable portion. | ||
prefix := /usr/local | ||
cpus := 4 | ||
prog := $(notdir $(CURDIR)) | ||
|
||
# Implementation | ||
MAKEFLAGS := j$(cpus) | ||
g := g++ -flto -g -std=c++11 -Wall -Werror -pedantic | ||
c := $(g) -c -MMD | ||
l := $(g) | ||
s := $(wildcard *.cpp) | ||
o := $(addprefix .,$(patsubst %.cpp,%.o,$(s))) | ||
d := $(o:o=d) | ||
p := $(filter-out .test-%.o,$(o)) | ||
t := $(patsubst %.o,%,$(filter .test-%.o,$(o))) | ||
|
||
.PRECIOUS\ | ||
:$(t)\ | ||
$(o) | ||
|
||
$(prog)\ | ||
:$(p) $(addsuffix .passed,$(t))\ | ||
#;$(l) -o $@ $(p) -lluabind | ||
|
||
.%.o\ | ||
:%.cpp $(MAKEFILE_LIST)\ | ||
;$(c) -o $@ $< | ||
|
||
.test-%.passed\ | ||
:.test-%\ | ||
;./$< --random\ | ||
&& touch $@ | ||
|
||
.test-%\ | ||
:.test-%.o\ | ||
;$(l) -o $@ $< -lboost_unit_test_framework | ||
|
||
.PHONY\ | ||
:clean\ | ||
install | ||
|
||
install\ | ||
:$(prog)\ | ||
;cp $(prog) $(prefix)/bin | ||
|
||
clean\ | ||
:\ | ||
;rm -Rf $(prog) $(t) .*.o .*.d .*.passed html latex | ||
|
||
-include $(d) |
Oops, something went wrong.