-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repair z-applocal test bugs. (#1105)
* Repair z-applocal test bugs. * We accidentally checked in main.exe rather than main.cpp. Compiling main.cpp failed, but the test 'passed' because main.exe was already present. * We never checked the output to see that vcpkg thought it actually deployed anything. * We didn't actually test anything because we built the DLLs to be copied in the same location as the exe, so there was nothing to do. * We wrote to the source tree. * Also make deploying plugins from 'debug' bin dirs correct.
- Loading branch information
1 parent
6391341
commit 7e3b1a7
Showing
26 changed files
with
216 additions
and
110 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
azure-pipelines/e2e_projects/applocal-test/plugins/azure_kinect_sensor_sdk/build.bat
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...-pipelines/e2e_projects/applocal-test/plugins/azure_kinect_sensor_sdk/depthengine_2_0.cpp
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
azure-pipelines/e2e_projects/applocal-test/plugins/azure_kinect_sensor_sdk/depthengine_2_0.h
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-74.5 KB
azure-pipelines/e2e_projects/applocal-test/plugins/azure_kinect_sensor_sdk/main.exe
Binary file not shown.
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 @@ | ||
cd %~dp0 | ||
pushd installed\bin | ||
cl /LD mylib.cpp | ||
popd | ||
cl /EHsc main.cpp installed\bin\mylib.lib |
5 changes: 3 additions & 2 deletions
5
...2e_projects/applocal-test/build/mylib.cpp → ...ts/applocal/basic/installed/bin/mylib.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#define MYLIB_EXPORTS 1 | ||
|
||
#include <stdio.h> | ||
#include "mylib.h" | ||
|
||
void mylib::my_func() { | ||
puts("hello world"); | ||
} | ||
puts("hello world"); | ||
} |
8 changes: 8 additions & 0 deletions
8
azure-pipelines/e2e_projects/applocal/basic/installed/bin/mylib.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class | ||
#if MYLIB_EXPORTS | ||
__declspec(dllexport) | ||
#endif | ||
mylib { | ||
public: | ||
static void my_func(); | ||
}; |
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,6 @@ | ||
#include "installed/bin/mylib.h" | ||
|
||
int main() { | ||
mylib::my_func(); | ||
return 0; | ||
} |
8 changes: 8 additions & 0 deletions
8
azure-pipelines/e2e_projects/applocal/plugins-debug/build.bat
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,8 @@ | ||
cd %~dp0 | ||
pushd installed\tools\azure-kinect-sensor-sdk | ||
cl /LD depthengine_2_0.cpp | ||
popd | ||
pushd installed\debug\bin | ||
cl /LD k4a.cpp | ||
popd | ||
cl /EHsc main.cpp installed/debug/bin/k4a.lib |
5 changes: 3 additions & 2 deletions
5
...t/plugins/azure_kinect_sensor_sdk/k4a.cpp → ...plugins-debug/installed/debug/bin/k4a.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#define MYLIB_EXPORTS 1 | ||
|
||
#include <stdio.h> | ||
#include "k4a.h" | ||
|
||
void k4a::my_func() { | ||
puts("hello world"); | ||
} | ||
puts("hello world"); | ||
} |
8 changes: 3 additions & 5 deletions
8
...est/plugins/azure_kinect_sensor_sdk/k4a.h → ...l/plugins-debug/installed/debug/bin/k4a.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,10 +1,8 @@ | ||
#include <stdio.h> | ||
|
||
class | ||
class | ||
#if MYLIB_EXPORTS | ||
__declspec( dllexport ) | ||
__declspec(dllexport) | ||
#endif | ||
k4a { | ||
public: | ||
static void my_func(); | ||
}; | ||
}; |
11 changes: 11 additions & 0 deletions
11
...ojects/applocal/plugins-debug/installed/tools/azure-kinect-sensor-sdk/depthengine_2_0.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
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"); | ||
} |
2 changes: 2 additions & 0 deletions
2
...e2e_projects/applocal/plugins-debug/installed/tools/azure-kinect-sensor-sdk/k4adeploy.ps1
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,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. |
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,6 @@ | ||
#include "installed/debug/bin/k4a.h" | ||
|
||
int main() { | ||
k4a::my_func(); | ||
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,8 @@ | ||
cd %~dp0 | ||
pushd installed\tools\azure-kinect-sensor-sdk | ||
cl /LD depthengine_2_0.cpp | ||
popd | ||
pushd installed\bin | ||
cl /LD k4a.cpp | ||
popd | ||
cl /EHsc main.cpp installed/bin/k4a.lib |
8 changes: 8 additions & 0 deletions
8
azure-pipelines/e2e_projects/applocal/plugins/installed/bin/k4a.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
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"); | ||
} |
8 changes: 8 additions & 0 deletions
8
azure-pipelines/e2e_projects/applocal/plugins/installed/bin/k4a.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class | ||
#if MYLIB_EXPORTS | ||
__declspec(dllexport) | ||
#endif | ||
k4a { | ||
public: | ||
static void my_func(); | ||
}; |
11 changes: 11 additions & 0 deletions
11
...e2e_projects/applocal/plugins/installed/tools/azure-kinect-sensor-sdk/depthengine_2_0.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
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"); | ||
} |
2 changes: 2 additions & 0 deletions
2
...lines/e2e_projects/applocal/plugins/installed/tools/azure-kinect-sensor-sdk/k4adeploy.ps1
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,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. |
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,6 @@ | ||
#include "installed/bin/k4a.h" | ||
|
||
int main() { | ||
k4a::my_func(); | ||
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 |
---|---|---|
@@ -1,36 +1,79 @@ | ||
if ($IsWindows) { | ||
. $PSScriptRoot/../end-to-end-tests-prelude.ps1 | ||
|
||
# Paths to test projects | ||
$buildDir = "$PSScriptRoot/../e2e_projects/applocal-test/build" | ||
$pluginsDir = "$PSScriptRoot/../e2e_projects/applocal-test/plugins" | ||
|
||
Run-Vcpkg env "$buildDir/build.bat" | ||
Run-Vcpkg env "$pluginsDir/azure_kinect_sensor_sdk/build.bat" | ||
|
||
# Tests z-applocal command | ||
Run-Vcpkg z-applocal ` | ||
--target-binary=$buildDir/main.exe ` | ||
--installed-bin-dir=$buildDir | ||
Refresh-TestRoot | ||
Copy-Item -Recurse -LiteralPath "$PSScriptRoot/../e2e_projects/applocal" -Destination $TestingRoot | ||
|
||
# Tests basic z-applocal command | ||
$basicDir = "$TestingRoot/applocal/basic" | ||
Run-Vcpkg env "$basicDir/build.bat" | ||
Require-FileNotExists $basicDir/mylib.dll | ||
$applocalOutput = Run-VcpkgAndCaptureOutput z-applocal ` | ||
--target-binary=$basicDir/main.exe ` | ||
--installed-bin-dir=$basicDir/installed/bin | ||
Throw-IfFailed | ||
if (-Not ($applocalOutput -match '.*\\applocal\\basic\\installed\\bin\\mylib\.dll -> .*\\applocal\\basic\\mylib\.dll.*')) | ||
{ | ||
throw "z-applocal didn't copy dependent binary" | ||
} | ||
|
||
Require-FileExists $basicDir/mylib.dll | ||
|
||
# Tests z-applocal command with no arguments | ||
Run-Vcpkg z-applocal | ||
Throw-IfNotFailed | ||
|
||
# Tests z-applocal with no installed-bin-dir argument | ||
Run-Vcpkg z-applocal ` | ||
--target-binary=$buildDir/main.exe | ||
--target-binary=$basicDir/main.exe | ||
Throw-IfNotFailed | ||
|
||
# Tests z-applocal with no target-binary argument | ||
Run-Vcpkg z-applocal ` | ||
--installed-bin-dir=$buildDir | ||
--installed-bin-dir=$basicDir | ||
Throw-IfNotFailed | ||
|
||
# Tests deploy azure kinect sensor SDK plugins | ||
Run-Vcpkg z-applocal ` | ||
--target-binary=$pluginsDir/azure_kinect_sensor_sdk/main.exe ` | ||
--installed-bin-dir=$pluginsDir/azure_kinect_sensor_sdk | ||
Throw-IfFailed | ||
$pluginsDir = "$TestingRoot/applocal/plugins" | ||
Run-Vcpkg env "$pluginsDir/build.bat" | ||
Require-FileNotExists "$pluginsDir/k4a.dll" | ||
Require-FileNotExists "$pluginsDir/depthengine_2_0.dll" | ||
$applocalOutput = Run-VcpkgAndCaptureOutput z-applocal ` | ||
--target-binary=$pluginsDir/main.exe ` | ||
--installed-bin-dir=$pluginsDir/installed/bin | ||
Throw-IfFailed | ||
if (-Not ($applocalOutput -match '.*\\applocal\\plugins\\installed\\bin\\k4a\.dll -> .*\\applocal\\plugins\\k4a\.dll.*')) | ||
{ | ||
throw "z-applocal didn't copy dependent binary" | ||
} | ||
|
||
if (-Not ($applocalOutput -match '.*\\applocal\\plugins\\installed\\tools\\azure-kinect-sensor-sdk\\depthengine_2_0\.dll -> .*\\applocal\\plugins\\depthengine_2_0\.dll.*')) | ||
{ | ||
throw "z-applocal didn't copy xbox plugins" | ||
} | ||
|
||
Require-FileExists "$pluginsDir/k4a.dll" | ||
Require-FileExists "$pluginsDir/depthengine_2_0.dll" | ||
|
||
# Tests deploy azure kinect sensor SDK plugins from debug directories | ||
$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/debug/bin | ||
Throw-IfFailed | ||
if (-Not ($applocalOutput -match '.*\\applocal\\plugins-debug\\installed\\debug\\bin\\k4a\.dll -> .*\\applocal\\plugins-debug\\k4a\.dll.*')) | ||
{ | ||
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.*')) | ||
{ | ||
throw "z-applocal didn't copy xbox plugins" | ||
} | ||
|
||
Require-FileExists "$pluginsDir/k4a.dll" | ||
Require-FileExists "$pluginsDir/depthengine_2_0.dll" | ||
} |
Oops, something went wrong.