-
Notifications
You must be signed in to change notification settings - Fork 57
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
13 changed files
with
486 additions
and
90 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 |
---|---|---|
|
@@ -14,5 +14,8 @@ CTestTestfile.cmake | |
eval_tests | ||
|
||
# Artifacts | ||
libspecialkeval.a | ||
build/ | ||
libskpokereval.a | ||
lib | ||
SKConfig.h | ||
|
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 |
---|---|---|
@@ -1,6 +1,20 @@ | ||
language: cpp | ||
os: | ||
- linux | ||
|
||
sudo: required | ||
dist: trusty | ||
|
||
compiler: | ||
- gcc | ||
- clang | ||
script: ./configure && cmake . && make && ctest | ||
|
||
language: cpp | ||
|
||
install: | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
sudo apt-get install cmake; | ||
cmake --version; | ||
fi | ||
|
||
script: ./build.sh | ||
|
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 |
---|---|---|
@@ -1,26 +1,46 @@ | ||
cmake_minimum_required (VERSION 2.8.7) | ||
cmake_minimum_required (VERSION 3.1.0 FATAL_ERROR) | ||
|
||
set(PROJECT_NAME SKPokerEval) | ||
project(${PROJECT_NAME}) | ||
|
||
# Versioning. | ||
set (SK_POKER_EVAL_VERSION_MAJOR 1) | ||
set (SK_POKER_EVAL_VERSION_MINOR 3) | ||
set(SK_POKER_EVAL_VERSION_MAJOR 1) | ||
set(SK_POKER_EVAL_VERSION_MINOR 4) | ||
set(SK_POKER_EVAL_VERSION_PATCH 0) | ||
|
||
# Get the current commit. | ||
execute_process( | ||
COMMAND git log -1 --format=%H | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE SK_POKER_EVAL_GIT_COMMIT | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
|
||
configure_file ( | ||
"${PROJECT_SOURCE_DIR}/src/SKConfig.h.in" | ||
"${PROJECT_BINARY_DIR}/src/SKConfig.h" | ||
"${PROJECT_BINARY_DIR}/generated/SKConfig.h" | ||
) | ||
|
||
# Includes. | ||
include_directories("${PROJECT_SOURCE_DIR}/generated") | ||
|
||
# Output directories. | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build) | ||
|
||
set(CMAKE_CXX_FLAGS "-g -Wall") | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
# Build | ||
add_library(skpokereval src/FiveEval.cpp src/SevenEval.cpp) | ||
add_subdirectory(src) | ||
|
||
# Testing | ||
enable_testing() | ||
add_subdirectory(lib/gtest-1.7.0) | ||
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) | ||
|
||
add_executable(eval_tests tests/seven_eval_tests.cpp) | ||
add_executable(eval_tests tests/five_eval_tests.cpp tests/seven_eval_tests.cpp) | ||
target_link_libraries(eval_tests gtest_main skpokereval) | ||
add_test(NAME GTests COMMAND eval_tests) | ||
|
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,3 @@ | ||
#!/bin/sh | ||
./configure && cmake . && make && ctest --verbose | ||
|
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,5 @@ | ||
add_library(skpokereval | ||
FiveEval.cpp | ||
SevenEval.cpp | ||
) | ||
|
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
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 |
---|---|---|
|
@@ -187,3 +187,4 @@ short unsigned FiveEval::GetRank(int const card_one, int const card_two, | |
} | ||
return best_rank_so_far; | ||
} | ||
|
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
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
#define SK_POKER_EVAL_VERSION_MAJOR @SK_POKER_EVAL_VERSION_MAJOR@ | ||
#define SK_POKER_EVAL_VERSION_MINOR @SK_POKER_EVAL_VERSION_MINOR@ | ||
#define SK_POKER_EVAL_VERSION_PATCH @SK_POKER_EVAL_VERSION_PATCH@ | ||
|
||
#define SK_POKER_EVAL_GIT_COMMIT @SK_POKER_EVAL_GIT_COMMIT@ | ||
|
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
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
Oops, something went wrong.