Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions azure-pipelines/e2e-projects/applocal/plugins-debug/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ cd %~dp0
pushd installed\tools\azure-kinect-sensor-sdk
cl /LD depthengine_2_0.cpp
popd
pushd installed\debug\tools\azure-kinect-sensor-sdk
cl /LD depthengine_2_0.cpp
popd
pushd installed\bin
cl /LD k4a.cpp
popd
pushd installed\debug\bin
cl /LD k4a.cpp
popd
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#define MYLIB_EXPORTS 1

#include <stdio.h>
#include "k4a.h"

void k4a::my_func() {
puts("hello world");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class
#if MYLIB_EXPORTS
__declspec(dllexport)
#endif
k4a {
public:
static void my_func();
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#define MYLIB_EXPORTS 1

#include <stdio.h>
class __declspec(dllexport) depthengine_2_0 {
public:
static void my_func();
};

void depthengine_2_0::my_func() {
puts("hello world");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This file exists to tell z-applocal that the azure-kinect-sensor-sdk is installed and is not
intended to be an executable PowerShell script.
29 changes: 24 additions & 5 deletions azure-pipelines/end-to-end-tests-dir/z-applocalcpp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,30 @@ if ($IsWindows) {
Require-FileExists "$pluginsDir/k4a.dll"
Require-FileExists "$pluginsDir/depthengine_2_0.dll"

# Tests deploy azure kinect sensor SDK plugins from debug directories
# Tests deploy azure kinect sensor SDK plugins from release and debug directories when both are present
$pluginsDebugDir = "$TestingRoot/applocal/plugins-debug"
Run-Vcpkg env "$pluginsDebugDir/build.bat"
Require-FileNotExists "$pluginsDebugDir/k4a.dll"
Require-FileNotExists "$pluginsDebugDir/depthengine_2_0.dll"

$applocalOutput = Run-VcpkgAndCaptureOutput z-applocal `
--target-binary=$pluginsDebugDir/main.exe `
--installed-bin-dir=$pluginsDebugDir/installed/bin
Throw-IfFailed
if (-Not ($applocalOutput -match '.*\\applocal\\plugins-debug\\installed\\bin\\k4a\.dll -> .*\\applocal\\plugins-debug\\k4a\.dll.*'))
{
throw "z-applocal didn't copy dependent release binary"
}

if (-Not ($applocalOutput -match '.*\\applocal\\plugins-debug\\installed\\tools\\azure-kinect-sensor-sdk\\depthengine_2_0\.dll -> .*\\applocal\\plugins-debug\\depthengine_2_0\.dll.*'))
{
throw "z-applocal didn't copy release xbox plugins"
}

Require-FileExists "$pluginsDebugDir/k4a.dll"
Require-FileExists "$pluginsDebugDir/depthengine_2_0.dll"
Remove-Item -LiteralPath "$pluginsDebugDir/k4a.dll", "$pluginsDebugDir/depthengine_2_0.dll"

$applocalOutput = Run-VcpkgAndCaptureOutput z-applocal `
--target-binary=$pluginsDebugDir/main.exe `
--installed-bin-dir=$pluginsDebugDir/installed/debug/bin
Expand All @@ -69,13 +88,13 @@ if ($IsWindows) {
throw "z-applocal didn't copy dependent debug binary"
}

if (-Not ($applocalOutput -match '.*\\applocal\\plugins-debug\\installed\\tools\\azure-kinect-sensor-sdk\\depthengine_2_0\.dll -> .*\\applocal\\plugins-debug\\depthengine_2_0\.dll.*'))
if (-Not ($applocalOutput -match '.*\\applocal\\plugins-debug\\installed\\debug\\tools\\azure-kinect-sensor-sdk\\depthengine_2_0\.dll -> .*\\applocal\\plugins-debug\\depthengine_2_0\.dll.*'))
{
throw "z-applocal didn't copy xbox plugins"
throw "z-applocal didn't copy debug xbox plugins"
}

Require-FileExists "$pluginsDir/k4a.dll"
Require-FileExists "$pluginsDir/depthengine_2_0.dll"
Require-FileExists "$pluginsDebugDir/k4a.dll"
Require-FileExists "$pluginsDebugDir/depthengine_2_0.dll"

# Tests that nonexistent files are merely warnings
$nonexistentDll = Join-Path $basicDir 'nonexisting.dll'
Expand Down
Loading
Loading