-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update shared_header.h Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update Makefile Signed-off-by: Ian Hunter <[email protected]> * Update Makefile Signed-off-by: Ian Hunter <[email protected]> * Update Makefile Signed-off-by: Ian Hunter <[email protected]> * Update Makefile Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update sided_dice.c Signed-off-by: Ian Hunter <[email protected]> * Update dice_logic.c Signed-off-by: Ian Hunter <[email protected]> * Update safe_functions.c Signed-off-by: Ian Hunter <[email protected]> * Update vector_functions.c Signed-off-by: Ian Hunter <[email protected]> * Update safe_functions.c Signed-off-by: Ian Hunter <[email protected]> * Update vector_functions.c Signed-off-by: Ian Hunter <[email protected]> * Update dice.lex Signed-off-by: Ian Hunter <[email protected]> * Update README.md Signed-off-by: Ian Hunter <[email protected]> * Update vector_functions.c Signed-off-by: Ian Hunter <[email protected]> * Update dice.lex Signed-off-by: Ian Hunter <[email protected]> * Create main.cpp Signed-off-by: Ian Hunter <[email protected]> * Create target.mk Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update dice.lex Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update test_binding_cpp.yml Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update Makefile Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update target.mk Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> * Update main.cpp Signed-off-by: Ian Hunter <[email protected]> Signed-off-by: Ian Hunter <[email protected]>
- Loading branch information
1 parent
00e4067
commit d6b181c
Showing
11 changed files
with
135 additions
and
39 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,30 @@ | ||
name: "Binding Tests: C++" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
build_clang: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: make | ||
run: | | ||
make CC=clang all | ||
./build/dice d20 | ||
build_cpp: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: make | ||
run: | | ||
make 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
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,44 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <assert.h> | ||
#include <string.h> | ||
#include "shared_header.h" | ||
|
||
int roll_full_options( | ||
char* roll_request, | ||
char* log_file, | ||
int enable_verbosity, | ||
int enable_introspection, | ||
int enable_mocking, | ||
int mocking_type, | ||
int mocking_seed | ||
); | ||
|
||
int main() | ||
{ | ||
const char* fn = "out.dice"; | ||
|
||
remove(fn); | ||
|
||
int err_code = roll_full_options( | ||
strdup("1d20"), | ||
strdup(fn), | ||
0, | ||
0, | ||
0, | ||
0, | ||
0 | ||
); | ||
assert(err_code == 0); | ||
|
||
std::ifstream myfile; | ||
myfile.open(fn); | ||
std::string mystring; | ||
if ( myfile.is_open() ) { | ||
myfile >> mystring; | ||
std::cout << mystring; | ||
}else{ | ||
return 1; | ||
} | ||
return 0; | ||
} |
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 @@ | ||
CXX?=g++ | ||
cpp: all | ||
$(CXX) src/C++/main.cpp -I src/grammar/ -ldice -Lbuild/ | ||
LD_LIBRARY_PATH=$(PWD)/build/ ./a.out |
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
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
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