Skip to content

Commit

Permalink
add run task for test
Browse files Browse the repository at this point in the history
  • Loading branch information
wysaid committed Dec 9, 2023
1 parent d606833 commit ec9d787
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,25 @@
},
"group": "build",
"problemMatcher": "$gcc"
},
{
"label": "Run Demo - GraphicsTest",
"type": "shell",
"command": "bash",
"args": [
"-l",
"tasks.sh",
"--run",
"graphicstest.exe",
],
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": [
"Build XEGE Library"
],
"group": "build",
"problemMatcher": "$gcc"
}
]
}
14 changes: 14 additions & 0 deletions tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ function isWindows() {
isWsl || [[ -d "/c" ]] || [[ -d "/cygdrive/c" ]]
}

function isMacOS() {
[[ "$(uname)" == "Darwin" ]]
}

function loadCMakeProject() {
if mkdir -p "$CMAKE_VS_DIR" &&
cd "$CMAKE_VS_DIR" &&
Expand Down Expand Up @@ -125,6 +129,16 @@ while [[ $# > 0 ]]; do
shift
shift
;;
--run)
echo "run $2"
if isWindows; then
"$CMAKE_VS_DIR/$2"
elif isMacOS; then
wine64 "$CMAKE_VS_DIR/$2"
fi
shift
shift
;;
*)
echo "unknown option $PARSE_KEY..."
exit 1
Expand Down

0 comments on commit ec9d787

Please sign in to comment.