This repository has been archived by the owner on Sep 22, 2019. It is now read-only.
-
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.
Showing
7 changed files
with
222 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
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,59 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build only", | ||
"type": "shell", | ||
"command": "sampctl package build", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"isBackground": false, | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": "$sampctl" | ||
}, | ||
{ | ||
"label": "build watcher", | ||
"type": "shell", | ||
"command": "sampctl package build --watch", | ||
"group": "build", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": "$sampctl" | ||
}, | ||
{ | ||
"label": "run tests", | ||
"type": "shell", | ||
"command": "sampctl package run", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": "$sampctl" | ||
}, | ||
{ | ||
"label": "run tests watcher", | ||
"type": "shell", | ||
"command": "sampctl package run --watch", | ||
"group": "test", | ||
"isBackground": true, | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated" | ||
}, | ||
"problemMatcher": "$sampctl" | ||
} | ||
] | ||
} |
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 @@ | ||
# - | ||
# Development | ||
# - | ||
|
||
build-release: | ||
cargo +stable-i686-pc-windows-msvc build --release | ||
cp target/release/pawn_templates.dll test/plugins/templates.dll | ||
|
||
build-debug: | ||
cargo +stable-i686-pc-windows-msvc build --debug | ||
cp target/debug/pawn_templates.dll test/plugins/templates.dll | ||
|
||
# - | ||
# Setup test requirements | ||
# - | ||
|
||
test-setup: | ||
cd test && sampctl server ensure | ||
sampctl package ensure | ||
|
||
# - | ||
# Run Tests | ||
# - | ||
|
||
test-native: | ||
sampctl package build | ||
cd test && sampctl server run | ||
|
||
test-container: | ||
sampctl package build | ||
cd test && sampctl server run --container | ||
|
||
# - | ||
# Build inside container | ||
# - | ||
|
||
build-container: | ||
rm -rf build | ||
docker build -t southclaws/projectname-build . | ||
docker run -v $(shell pwd)/test/plugins:/root/test/plugins southclaws/projectname-build | ||
|
||
# this make target is only run inside the container | ||
build-inside: | ||
cd build && cmake .. && make |
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,20 @@ | ||
{ | ||
"user": "Southclaws", | ||
"repo": "pawn-templates", | ||
"entry": "test.pwn", | ||
"output": "test/gamemodes/test.amx", | ||
"dependencies": ["Southclaws/samp-stdlib"], | ||
"dev_dependencies": ["pawn-lang/YSI-Includes"], | ||
"resources": [ | ||
{ | ||
"name": "templates.so", | ||
"archive": false, | ||
"platform": "linux" | ||
}, | ||
{ | ||
"name": "templates.dll", | ||
"archive": false, | ||
"platform": "windows" | ||
} | ||
] | ||
} |
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,14 @@ | ||
// built-in include guard removal | ||
// just in case the user has a local dependency with the same file name | ||
#if defined _inc_templates | ||
#undef _inc_templates | ||
#endif | ||
// custom include-guard to ensure we don't duplicate | ||
#if defined _templates_included | ||
#endinput | ||
#endif | ||
#define _templates_included | ||
|
||
|
||
native Template:CreateTemplate(const template[]); | ||
native RenderTemplate(Template:id, dest[]); |
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,22 @@ | ||
#define RUN_TESTS | ||
|
||
#include <a_samp> | ||
#include <YSI\y_testing> | ||
|
||
#include "templates.inc" | ||
|
||
main() { | ||
// | ||
} | ||
|
||
Test:Simple() { | ||
new Template:t = CreateTemplate("Hello, {{ name }}!"); | ||
new rendered[64]; | ||
new ret = RenderTemplate(t, rendered); | ||
|
||
printf("ret: %d", ret); | ||
printf("rendered: %s", rendered); | ||
|
||
ASSERT(ret == 0); | ||
// ASSERT(!strcmp(rendered, "Hello, Southclaws!")); | ||
} |
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,9 @@ | ||
{ | ||
"gamemodes": ["test"], | ||
"plugins": ["templates"], | ||
"rcon_password": ";,JoTh856/:?", | ||
"port": 7777, | ||
"hostname": "test", | ||
"maxplayers": 32, | ||
"mode": "y_testing" | ||
} |