I'm a maintainer for FSharp.Charting. Recently our FAKE testing rules started breaking with the error reported below (specifically I'm calling build.cmd RunTests). FAKE seems to be picking up the incorrect path and exe name for nunit-console, which is at packages/NUnit.ConsoleRunner/tools/nunit3-console.exe. I'm not sure whether this is a versioning issue or if I need to update my build.fsx script to account for changes to FAKE and/or NUnit. Any guidance would be appreciated.
System.Exception: Start of process c:\GitHub\FSharp.Charting_20180310\tools\Nunit\nunit-console.exe failed. The system cannot find the file specified
at Fake.ProcessHelper.ExecProcessWithLambdas#91-16.Invoke(String message) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 91
at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent, FSharpFunc2 errorF, FSharpFunc2 messageF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 91
at Fake.NUnitSequential.NUnit(FSharpFunc2 setParams, IEnumerable1 assemblies) in C:\code\fake\src\app\FakeLib\UnitTest\NUnit\Sequential.fs:line 26
at FSI_0005.Build.clo#113-10.Invoke(Unit _arg6) at Fake.TargetHelper.runSingleTarget(TargetTemplate1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 626
Some relevant contents of paket.lock:
FAKE (4.61.3) - framework: net40, net45, net461
NUnit (3.7.1) - framework: net40, net45, net461
NUnit.ConsoleRunner (3.6.1) - framework: net40, net45, net461
NUnit.Runners (3.6.1) - framework: net40, net45, net461
NUnit.ConsoleRunner (>= 3.6.1) - framework: net40, net45, net461
EDIT: fixed the build.cmd test command, and provided the explicit nunit-console path.
Per additional comments from #Charles Mager, there are two potential solutions:
Thanks to #TeaDrivenDev I figured out there's a version misalignment between FAKE (v4) and NUnit which was unconstrained to download the latest v3 stable. This can be accomplished by clamping NUnit and NUnit.Runners in paket.dependencies to 2.6.3 or above, up to <3.0.
Update build.fsx to use NUnit3. This involved open Fake.Testing and updating the NUnit call to NUnit3. In addition, some of the NUnit parameter names have been updated or deprecated. Full details of this approach can be found here.
I opted for solution 2 since it keeps us up to date with the current NUnit.
Related
I am building Yocto 2.5(Sumo) with Gstreamer 1.14 and OpenCV 3.4.5
I am getting this error while compiling Gstreamer:
build_xwayland_mq/tmp/work/aarch64-mx8m-poky-linux/gstreamer1.0-plugins-bad/1.14.4.imx-r0/recipe-sysroot/usr/include/opencv2/imgproc/types_c.h:445:21: error: conflicting declaration of C function 'CvMoments cvMoments(const cv::Moments&)'
CV_INLINE CvMoments cvMoments(const cv::Moments& m)
same error in imgproc_c.h:360:13
I saw someone solved this by building with OpenCV 4 instead, but we need OpenCV 3.4.5 for our own project.
Anyone know how to resolve this conflict?
too long for comment..
I did just quick search, found this:
https://www.yoctoproject.org/pipermail/meta-freescale/2019-March/023888.html
There is some problem in includes .. I guess in mentioned hpp files there are some types that are not declared in that imgproc_c.h for 3.4, but already are moved there for opencv 4 (just my guess).
You just need to add those hpp on all places (in gst plugins bad) where you find include for imgproc_c.h.
Take inspiration from this.. or maybe it itself will solve your issue:
https://git.yoctoproject.org/cgit/cgit.cgi/meta-freescale/tree/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch?h=thud
The patch is for yocto thud.. but perhaps it does not matter for GStreamer.
In worst case you will have to backport it or make your own patch for sumo.
Or if you can try update to thud (should be small difference) or newer and check if it persists.
Trying MockWebServer for the first time on a Groovy/Spring project that uses Spock for unit testing.
I added MockWebServer dependencies as directed (I had to add the second line myself to avoid errors, but it's not documented:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I have a basic Spock test that looks like this:
def 'server'() {
setup:
MockWebServer server = new MockWebServer()
expect:
server
}
But it fails with this output:
java.lang.NoSuchMethodError: okhttp3.internal.Util.immutableListOf([Ljava/lang/Object;)Ljava/util/List;
at okhttp3.mockwebserver.MockWebServer.<init>(MockWebServer.kt:176)
Is there another dependency I'm missing? Does MockWebServer not play well with Groovy and Spock?
For what it's worth, using version 3.1.4 seems to work:
testImplementation("com.squareup.okhttp3:mockwebserver:3.14.2")
(I'm a first time user of MockWebServer)
Thank you!
Try adding this:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("com.squareup.okhttp3:okhttp:4.0.0")
With MockWebServer your OkHttp dependency must be the same version.
I got the same problem, I found the solution in version, just change the version to "3.7.0" and it's work fine.
there is some discussion about version changing to "3.4.1" but this version got the problem (Cannot inherit from final class) that discussed at this issue :
https://github.com/andrzejchm/RESTMock/issues/56
so the safest version is "3.7.0" :D
just notice that both versions should be the same..
change your to dependencies to below:
//mock retrofit
testImplementation("com.squareup.okhttp3:mockwebserver:3.7.0")
testImplementation("com.squareup.okhttp3:okhttp:3.7.0")
//if your source code is java
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I know... Another one of this... But no one else's error is the same as mine and I've been trying to build opencv with mingw32 for days now.
When building OpenCV with mingw the command mingw32-make fails at some point trying to compile sources\modules\ts\src\ts_gtest.cpp with error pic bellow:
I've tried following several tutorials, but none work cleanly and this is the best I could get stuff to work.
What I did:
Installed Mingw and added C:\Mingw\bin\ to PATH environment variable.
Installed CMake and added it too to PATH.
Extracted OpenCV to C:\ and created forlder C:\opencv\mingwBuild\
In CMake-GUI I define source folder as C:\opencv\sources\ and build folder as C:\opencv\mingwBuild\.
Hit Configure and select Mingw Makefiles, with 'Use default native compilers' (have also specified compilers explicitly and the result is the same.).
Hit Generate, which creates the Makefile.
I open C:\Mingw\msys\1.0\msys.bat to have a console with all variables loaded (have also tried directly from a simple cmd.exe, given that PATH is set for mingw, but I get the same error in compilation). Navigate to C:\opencv\mingwBuild\ and run mingw32-make.
And that's where the error shows up after a while. Any ideas?
Turns ou gTest was not compiling in Mingw for some reason.
As I don't intend to test my code (for now) I removed opencv_ts from instalation (by deselecting it in Cmake, after configuring and before generating).
Someone mentions, in the first link #Dan Masek refers, that GTest has this issue with type conversion under mingw. They say that you can edit ts_gtest.cpp to apply the correct conversion, according to error message. That may be a solution if you need this module.
Another comment in #Dan Masek's second link mentions that gcc's version 5 surpasses the issue, which version 4 has. So, getting a hold of such distro may also be a solution.
For me it seems to be fixed by applying this fix: https://github.com/msk-repo01/opencv/commit/9a1835ce6676836ce278d723da4ff55a8f900ff1
(Also see: https://github.com/opencv/opencv/issues/8105)
The fix basically replaces the "_RTL_CRITICAL_SECTION" by "_CRITICAL_SECTION" for MingW compilers in modules/ts/include/opencv2/ts/ts_gtest.h in the following way:
The lines
// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
// This assumption is verified by
// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
struct _RTL_CRITICAL_SECTION;
(around line 723 in OpenCV 3.2.0 release from Dec. 2016) are replaced by
# if GTEST_OS_WINDOWS_MINGW
// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
// separate (equivalent) structs, instead of using typedef
typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
# else
// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
// This assumption is verified by
// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
# endif
and
_RTL_CRITICAL_SECTION* critical_section_;
is replaced by
GTEST_CRITICAL_SECTION* critical_section_;
I'm student. I used Android Studio in new version, because I wanted to compile the face detection sample of Opencv library.
At first problem, I didn't resolve the ndk path.
Show that error:
Error:Execution failed for task
':openCVSamplefacedetection:compileDebugNdk'.
NDK not configured. Download the NDK from http://developer.android.com/tools/sdk/ndk/.Then add
ndk.dir=path/to/ndk in local.properties. (On Windows, make sure you
escape backslashes, e.g. C:\ndk rather than C:\ndk)
so I download the ndk and add the path like this.
ndk.dir=d\:\\android-ndk-r10e
Then, the new error is showing:
Error:Execution failed for task
':openCVSamplefacedetection:compileDebugNdk'.
A problem occurred starting process 'command 'd:\android-ndk-r10e\ndk-build.cmd'
Some people say that please add the sourceset.main in build.gradle, so I add the source code.
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.opencv.samples.facedetect"
minSdkVersion 15
targetSdkVersion 22
ndk {
moduleName "detection_based_tracker"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':openCVLibrary2410')
}
Finally built complete but my phone showed "FaceDetecter is stopped" and exit the app.
Don't you know the problem? I really don't know about Opencv's open source.
One possible solution to try it out with Task NdkCompile into your build.gradle file.
Also I do not think you need to add OPENCV as a dependency instead simply add JNI directories to configuration file as noted above (the jniLibs.srcDir is mapped to the proper location).
I know this question was asked 6 months ago, but I hope isn't late or others may find it useful for quick troubleshooting.
Best of luck.
After using XCode 5.1, I got an error like this:
gcov: Unknown command line argument '-v'. Try: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/gcov -help'
Then I find an answer from this page: XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks
However, I got another error like this:
Processing *****.gcda
File checksums do not match: 1280071245 != 5 in ().
Invalid .gcno File!
geninfo: ERROR: GCOV failed for ****.gcda!
For me the cause was that the *.gcno files were stale and did not match the *.gcda files. In fact most of them had gone missing.
Fixed this by doing the following:
Ensured that both: 'instrument program flow' and 'generated test coverage' were set in both the App's target and the test target.
I then added the following to the AppDelegate.
- (void)applicationWillTerminate:(UIApplication *)application
{
extern void __gcov_flush(void);
__gcov_flush(); //ensure all coverage data is flushed before shutdown
}
. . this is for application hosted iOS tests. Depending on your requirements you could make this a little less 'invasive' (eg, mix in the coverage flushing so that its only in your test target), but this should be a good starting point to get it working first.