Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
b5eaef81
Commit
b5eaef81
authored
May 15, 2015
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tests under gcc
parent
2f81e545
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
Makefile
tests/Makefile
+12
-3
file_log.cpp
tests/file_log.cpp
+3
-3
No files found.
tests/Makefile
View file @
b5eaef81
CXX
?=
g++
CXXFLAGS
=
-D_WIN32_WINNT
=
0x600
-march
=
native
-Wall
-Wextra
-Wshadow
-pedantic
-std
=
c++11
-pthread
-Wl
,--no-as-needed
-I
../include
LDPFALGS
=
-pthread
CPP_FILES
:=
$
(
wildcard
*
.cpp
)
OBJ_FILES
:=
$
(
addprefix ./,
$
(
notdir
$
(
CPP_FILES:.cpp
=
.o
)))
tests
:
$(OBJ_FILES)
$(CXX)
$(CXXFLAGS)
$(LDPFALGS)
-o
$@
$^
%.o
:
%.cpp
g++
$(CXXFLAGS)
-c
-o
$@
$<
all
:
%.cpp
$(CXX)
$^
-o
tests
$(CXXFLAGS)
$(CXX_RELEASE_FLAGS)
clean
:
rm
-f
tests
*.o
logs/*
rm
-f
tests
*
.o logs/
*
rebuild
:
clean all
...
...
tests/file_log.cpp
View file @
b5eaef81
...
...
@@ -4,7 +4,7 @@ static std::string file_contents(const std::string& filename)
{
std
::
ifstream
ifs
(
filename
);
if
(
!
ifs
)
throw
std
::
exception
(
"Failed open file "
);
throw
std
::
runtime_error
(
"Failed open file "
);
return
std
::
string
((
std
::
istreambuf_iterator
<
char
>
(
ifs
)),
(
std
::
istreambuf_iterator
<
char
>
()));
...
...
@@ -15,7 +15,7 @@ static std::size_t count_lines(const std::string& filename)
{
std
::
ifstream
ifs
(
filename
);
if
(
!
ifs
)
throw
std
::
exception
(
"Failed open file "
);
throw
std
::
runtime_error
(
"Failed open file "
);
std
::
string
line
;
size_t
counter
=
0
;
...
...
@@ -28,7 +28,7 @@ std::ifstream::pos_type filesize(const std::string& filename)
{
std
::
ifstream
ifs
(
filename
,
std
::
ifstream
::
ate
|
std
::
ifstream
::
binary
);
if
(
!
ifs
)
throw
std
::
exception
(
"Failed open file "
);
throw
std
::
runtime_error
(
"Failed open file "
);
return
ifs
.
tellg
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment