mirror of
https://github.com/opencv/opencv.git
synced 2026-09-13 05:42:51 -05:00
Adding test support for WINRT
This commit is contained in:
@@ -119,3 +119,41 @@ To generate Windows Phone 8.1 x86 project files in the opencv/bin dir
|
||||
mkdir bin
|
||||
cd bin
|
||||
cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 ../
|
||||
|
||||
Running tests for Windows Store
|
||||
===============================
|
||||
1. You might need to install this if you haven't already: http://www.microsoft.com/en-US/download/details.aspx?id=40784
|
||||
|
||||
2. Set OPENCV_TEST_DATA_PATH environment variable to location of opencv_extra/testdata (cloning of https://github.com/Itseez/opencv_extra repo required) to get tests work correctly. Also, set OPENCV_PERF_VALIDATION_DIR environment variable in case you are planning to have place where to store performance test results and compare them with the future test runs.
|
||||
|
||||
3. In case you'd like to adjust some flags that are defaulted by setup_winrt script, go to "Manual build" section. Otherwise go to platforms/winrt and execute
|
||||
|
||||
setup_winrt.bat "WS" "8.1" "x64"
|
||||
|
||||
This will generate all files needed to build open_cv projects for selected platform in opencv\bin\<Depends on generated configuration>. Open the opencv\bin\<path to required configuration> directory and open the OpenCV.sln.
|
||||
|
||||
4. Set OCV solution to Release mode and build it. They should build without errors and generate executables in "bin\WS\8.1\x64\bin\Release\" (or similar path depending on the configuration)
|
||||
|
||||
5. Running tests:
|
||||
- **Accuracy:** Run opencv_test_{module}.exe via console or as usual by double clicking it. You should see output in the console window
|
||||
- **Performance:** Run opencv_perf_{module}.exe via console or as usual by double clicking it. You should see output in the console window. In case you'd like to write test results to file use --perf_write_validation_results=<filename> parameter; To compare current results to previous use --perf_read_validation_results=<filename>. This should read/write files from/to OPENCV_PERF_VALIDATION_DIR
|
||||
|
||||
Manual build
|
||||
============
|
||||
|
||||
CMake interface:
|
||||
-----------------
|
||||
1. Set CMAKE_SYSTEM_NAME to WindowsStore or WindowsPhone and CMAKE_SYSTEM_VERSION to 8.0 or 8.1
|
||||
2. Set CMAKE_INSTALL_PREFIX using format "<install dir>\WS\8.1\x64" (this structure is required by samples)
|
||||
3. Click "Configure" and choose required generator
|
||||
4. Click "Generate"
|
||||
|
||||
Command line:
|
||||
--------------
|
||||
1. md bin
|
||||
2. cd bin
|
||||
3. Add any required parameters to this command and execute it:
|
||||
|
||||
cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_SYSTEM_NAME:String=WindowsStore -DCMAKE_SYSTEM_VERSION:String=8.1 -DCMAKE_VS_EFFECTIVE_PLATFORMS:String=x64 -DCMAKE_INSTALL_PREFIX:PATH=.\install\WS\8.1\x64\ ..
|
||||
|
||||
Return to "Running tests for Windows Store", list item 4.
|
||||
@@ -51,6 +51,10 @@ Param(
|
||||
[ValidateNotNull()]
|
||||
$ARCHITECTURES_IN = "x86",
|
||||
|
||||
[parameter(Mandatory=$False)]
|
||||
[String]
|
||||
$TESTS = "None",
|
||||
|
||||
[parameter(Mandatory=$False)]
|
||||
[String]
|
||||
[ValidateNotNull()]
|
||||
@@ -129,6 +133,16 @@ function Call-MSBuild($path, $config)
|
||||
return $true
|
||||
}
|
||||
|
||||
function RunAccuracyTests($path) {
|
||||
md "$path\bin\Release\accuracy"
|
||||
python "$PSScriptRoot\..\..\modules\ts\misc\run.py" -w "$path\bin\Release\accuracy" -a "$path\bin\Release"
|
||||
}
|
||||
|
||||
function RunPerfTests($path) {
|
||||
md "$path\bin\Release\perf"
|
||||
python "$PSScriptRoot\..\..\modules\ts\misc\run.py" -w "$path\bin\Release\perf" "$path\bin\Release"
|
||||
}
|
||||
|
||||
Function Execute() {
|
||||
If ($HELP.IsPresent) {
|
||||
ShowHelp
|
||||
@@ -174,6 +188,7 @@ Function Execute() {
|
||||
Throw "$($_) is not valid! Please use x86, x64, ARM"
|
||||
}
|
||||
}
|
||||
|
||||
D "Processed Architectures: $architectures"
|
||||
|
||||
# Assuming we are in '<ocv-sources>/platforms/winrt' we should move up to sources root directory
|
||||
@@ -263,6 +278,25 @@ Function Execute() {
|
||||
|
||||
Call-MSBuild "OpenCV.sln" "Release"
|
||||
Call-MSBuild "INSTALL.vcxproj" "Release"
|
||||
|
||||
Try {
|
||||
# Running tests for release versions:
|
||||
If ($TESTS -eq "ALL") {
|
||||
RunAccuracyTests "$path"
|
||||
RunPerfTests "$path"
|
||||
} else {
|
||||
If($TESTS -eq "ACC") {
|
||||
RunAccuracyTests "$path"
|
||||
}
|
||||
If($TESTS -eq "PERF") {
|
||||
RunPerfTests "$path"
|
||||
}
|
||||
}
|
||||
} Catch {
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
L "Error: $ErrorMessage"
|
||||
exit
|
||||
}
|
||||
}
|
||||
} Catch {
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
@@ -305,8 +339,10 @@ Function ShowHelp() {
|
||||
Write-Host " cmd> setup_winrt.bat [params]"
|
||||
Write-Host " cmd> PowerShell.exe -ExecutionPolicy Unrestricted -File setup_winrt.ps1 [params]"
|
||||
Write-Host " Parameters:"
|
||||
Write-Host " setup_winrt [options] [platform] [version] [architecture] [generator] [install-path]"
|
||||
Write-Host " setup_winrt [options] [platform] [version] [architecture] [tests] [generator] [install-path]"
|
||||
Write-Host " setup_winrt -b 'WP' 'x86,ARM' "
|
||||
Write-Host " setup_winrt -b 'WP' 'x86,ARM' ALL"
|
||||
Write-Host " setup_winrt -b 'WP' 'x86,ARM' -test PERF "
|
||||
Write-Host " setup_winrt -architecture x86 -platform WP "
|
||||
Write-Host " setup_winrt -arc x86 -plat 'WP,WS' "
|
||||
Write-Host " setup_winrt -a x86 -g 'Visual Studio 11 2012' -pl WP "
|
||||
@@ -329,6 +365,10 @@ Function ShowHelp() {
|
||||
Write-Host " Example: 'ARM,x64' "
|
||||
Write-Host " Options: x86, ARM, x64. Available options may be limited depending on your local setup. "
|
||||
Write-Host " Note that you'll need to use quotes to specify more than one architecture. "
|
||||
Write-Host " tests - Test sets to run. Requires -b option otherwise ignored. "
|
||||
Write-Host " Default: None. "
|
||||
Write-Host " Example: 'ALL' "
|
||||
Write-Host " Options: ACC, PERF, ALL. "
|
||||
Write-Host " generator - Visual Studio instance used to generate the projects. "
|
||||
Write-Host " Default: Visual Studio 12 2013 "
|
||||
Write-Host " Example: 'Visual Studio 11 2012' "
|
||||
|
||||
Reference in New Issue
Block a user