Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bpftrace
Commits
6cbeb0a3
Commit
6cbeb0a3
authored
Feb 06, 2017
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include GTest in builds
parent
9eb6e51a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
21 deletions
+61
-21
CMakeLists.txt
CMakeLists.txt
+24
-0
README.md
README.md
+3
-1
src/CMakeLists.txt
src/CMakeLists.txt
+0
-20
tests/CMakeLists.txt
tests/CMakeLists.txt
+23
-0
tests/parser.cpp
tests/parser.cpp
+11
-0
No files found.
CMakeLists.txt
0 → 100644
View file @
6cbeb0a3
cmake_minimum_required
(
VERSION 2.8.12
)
project
(
bpftrace
)
add_compile_options
(
"-std=c++14"
)
add_compile_options
(
"-Wall"
)
add_compile_options
(
"-Wextra"
)
add_compile_options
(
"-Wundef"
)
add_compile_options
(
"-Wpointer-arith"
)
add_compile_options
(
"-Wcast-align"
)
add_compile_options
(
"-Wwrite-strings"
)
add_compile_options
(
"-Wcast-qual"
)
add_compile_options
(
"-Wswitch-default"
)
add_compile_options
(
"-Wswitch-enum"
)
add_compile_options
(
"-Wconversion"
)
add_compile_options
(
"-Wunreachable-code"
)
add_compile_options
(
"-Wformat=2"
)
add_compile_options
(
"-Wstrict-overflow=5"
)
add_compile_options
(
"-Wdisabled-optimization"
)
add_compile_options
(
"-pedantic"
)
enable_testing
()
add_subdirectory
(
src
)
add_subdirectory
(
tests
)
README.md
View file @
6cbeb0a3
...
...
@@ -50,6 +50,8 @@ git clone https://github.com/ajor/bpftrace
cd bpftrace
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ../
src
cmake -DCMAKE_BUILD_TYPE=Debug ../
make
```
The latest versions of BCC and Google Test will be downloaded on the first build. To update them later, the commands
`make bcc-update`
and
`make gtest-update`
can be run.
src/CMakeLists.txt
View file @
6cbeb0a3
cmake_minimum_required
(
VERSION 2.8.12
)
project
(
bpftrace
)
add_compile_options
(
"-std=c++14"
)
add_compile_options
(
"-Wall"
)
add_compile_options
(
"-Wextra"
)
add_compile_options
(
"-Wundef"
)
add_compile_options
(
"-Wpointer-arith"
)
add_compile_options
(
"-Wcast-align"
)
add_compile_options
(
"-Wwrite-strings"
)
add_compile_options
(
"-Wcast-qual"
)
add_compile_options
(
"-Wswitch-default"
)
add_compile_options
(
"-Wswitch-enum"
)
add_compile_options
(
"-Wconversion"
)
add_compile_options
(
"-Wunreachable-code"
)
add_compile_options
(
"-Wformat=2"
)
add_compile_options
(
"-Wstrict-overflow=5"
)
add_compile_options
(
"-Wdisabled-optimization"
)
add_compile_options
(
"-pedantic"
)
find_package
(
BISON REQUIRED
)
find_package
(
FLEX REQUIRED
)
find_package
(
LLVM REQUIRED CONFIG
)
...
...
tests/CMakeLists.txt
0 → 100644
View file @
6cbeb0a3
add_compile_options
(
"-Wno-undef"
)
add_compile_options
(
"-Wno-switch-default"
)
add_compile_options
(
"-Wno-switch-enum"
)
add_executable
(
bpftrace_test parser.cpp
)
find_package
(
Threads REQUIRED
)
include
(
ExternalProject
)
ExternalProject_Add
(
gtest
GIT_REPOSITORY https://github.com/google/googletest.git
STEP_TARGETS build update
EXCLUDE_FROM_ALL 1
UPDATE_DISCONNECTED 1
)
add_dependencies
(
bpftrace_test gtest-build
)
ExternalProject_Get_Property
(
gtest source_dir binary_dir
)
include_directories
(
${
source_dir
}
/googletest/include
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/googlemock/gtest/libgtest.a
)
target_link_libraries
(
bpftrace_test
${
binary_dir
}
/googlemock/gtest/libgtest_main.a
)
target_link_libraries
(
bpftrace_test
${
CMAKE_THREAD_LIBS_INIT
}
)
add_test
(
NAME bpftrace_test COMMAND bpftrace_test
)
tests/parser.cpp
0 → 100644
View file @
6cbeb0a3
#include "gtest/gtest.h"
TEST
(
test1
,
aaa
)
{
}
int
main
(
int
argc
,
char
*
argv
[])
{
::
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
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