I want to use the Eclipse plugin "makegood" to use php-unit-tests in Eclipse. When I'm running phpunit on console, everything is working.
I followed the following instruction to set up the makegood-plugin in Eclipse: http://www.stuermer-benjamin.de/v12_1/eclipse-4-2-with-php-android-and-unit-testing/
The status of makegood is "Waiting for a test run...", but when I try to run a unit-test, I get this error printed in the console:
Fatal error: Class
> 'Stagehand\TestRunner\CLI\TestRunnerApplication\Command\CommandRepository'
> not found in C:\Users\myNameWith18Charac
> \.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\php\Stagehand\TestRunner\CLI\TestRunnerApplication\Application.php
> on line 64
>
> Call Stack:
> 0.0000 148336 1. {main}() C:\Users\myNameWith18Charac\.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\bin\testrunner.php:0
> 0.0100 460744 2. Stagehand\TestRunner\CLI\TestRunnerApplication\Application->__construct()
> C:\Users\myNameWith18Charac\.eclipse\org.eclipse.platform_4.3.0_1709980481_win32_win32_x86_64\plugins\com.piece_framework.makegood.stagehandtestrunner_2.5.0.v201311031709\resources\php\bin\testrunner.php:58
The class Stagehand\TestRunner\CLI\TestRunnerApplication\Command\CommandRepository is existing!
Is the path maybe too long? But I don't know, how to change it. I'm using win7 x64.
I'm seeing the same thing in Ubuntu, running Eclipse Kepler and PDT 3.3.
Enabling debug in MakeGood, I can see that the command that's actually being run is php with a single argument of the file I'm currently viewing (E.G the test).
It simply doesn't work as advertised, as it's just trying to execute the file on its own.
Downgrading to Eclipse 3.8 (Juno), and PDT 3.0.0 worked for me.
*Edit:
You can define a custom bash script as the php executable as a workaround, and hardcode the path to testrunner.php
#!/bin/bash
# MakeGood for PHP stopped working after Eclipse Indigo (3.8) due to inability to run testrunner.php
# This is a hack PHP binary, to be configured as PHP executable for MakeGood to start working in Juno, Kepler and Luna.
# Remove the -n operator to read all config files
options=`echo $# | sed 's%-n %%' | sed 's%-c .+? %%'`
# Hardcode path to testrunner.php
options=`echo $options | sed 's#open_tag=on [^ ]*#open_tag=on /opt/testrunner.php
/usr/bin/php $options
Related
I downloaded Mozilla-central and built it. I am able to run Firefox Nightly using ./mach run.
Now I am following the instructions of MDN on how to use Eclipse CDT with Mozilla code.
I downloaded Eclipse CDT on my mac and installed it. When I execute the following command:
./mach build-backend -b CppEclipse
It raises an exception saying: Failed to launch eclipse to import project. Ensure 'eclipse' is in your PATH and try again
I tried to add the eclipse's directory (Applications/Eclipse.app) to my PATH environment variable but I still get the same error.
Here is the complete trace:
0:00.46
/Users/****/src/mozilla-central/obj-ff-dbg/_virtualenvs/init/bin/python
/Users/****/src/mozilla-central/obj-ff-dbg/config.status --backend
CppEclipse Reticulating splines... 0:02.99 File already read.
Skipping:
/Users/****/src/mozilla-central/gfx/angle/targets/angle_common/moz.build
Traceback (most recent call last): File
"/Users/****/src/mozilla-central/obj-ff-dbg/config.status", line 1022,
in
config_status(**args) File "/Users/****/src/mozilla-central/python/mozbuild/mozbuild/config_status.py",
line 146, in config_status
the_backend.consume(definitions) File "/Users/****/src/mozilla-central/python/mozbuild/mozbuild/backend/base.py",
line 143, in consume
self.consume_finished() File "/Users/****/src/mozilla-central/python/mozbuild/mozbuild/backend/cpp_eclipse.py",
line 158, in consume_finished
self._import_project() File "/Users/****/src/mozilla-central/python/mozbuild/mozbuild/backend/cpp_eclipse.py",
line 181, in _import_project
raise Exception("Failed to launch eclipse to import project. " Exception: Failed to launch eclipse to import project. Ensure
'eclipse' is in your PATH and try again
Also, using the command:
./mach ide eclipse
I again get the same message:
Eclipse CDT 8.4 or later must be installed in your PATH. Download:
http://www.eclipse.org/cdt/downloads.php
How can I resolve this issue?
I just need to open Firefox nightly in Eclipse to be able to get the call-graph and navigate through its source code.
Run Eclipse first, then:
1- Command:
ps -ef |grep -i ecli
Output:
501 6410 1 0 2:57pm ?? 0:44.98 /Applications/Eclipse
CPP.app/Contents/MacOS/eclipse 501 6428 6365 0 2:57pm ttys001
0:00.00 grep -i ecli
2- Add the binary to the path:
export PATH=/Applications/Eclipse\ CPP.app/Contents/MacOS/:$PATH
3- Test it:
which eclipse
everything worked fine but I've just tried to run my CUDA programs on Linux Ubuntu 12.10 in NetBeans and I get error:
dist/Debug/GNU-Linux-x86/my_cuda_1: error while loading shared
libraries: libcudart.so.5.0: cannot open shared object file: No such
file or directory
RUN FAILED (exit value 127, total time: 191ms)
the projects can build: compile + link without problems, I can also run it from commandline but if I try run it from NetBeans I get this error.
I was able to run it few minutes ago, what might happened?
I have added file my_lib to ld.so.conf.d containing such text:
/usr/local/cuda-5.0/lib64:/lib
/usr/lib
/usr/lib64
can it be a link issue libcudart.so.5.0 -> licudart.so?
there are two libs in cuda/lib libcudart.so.5.0 (link) and libcudart.so (link) and libcudart.so.5.0.35 (shared lib)
why it complains about .so.5.0? mayve link like:
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
is necessary
it is related to link to shared library I think
root#comp:# echo $LD_LIBRARY_PATH
/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib::/usr/local/cuda-5.0/lib64:/lib
isn't this :: a problem? seems that No because I changed this and still same error. I specify PATHS, I run ldconfig, I put exports in the .bashrc, still nothing.
the reason is that I cannot load these libraries if program is started from NetBeans GUI, however I start NetBeans as root always
add to the Project -> Properties -> Run -> Environment
Name: LD_LIBRARY_PATH
Value:
$LD_LIBRARY_PATH:/usr/lib/nvidia-current:/usr/local/cuda-5.0/lib:/usr/local/cuda-5.0/lib64:/lib
Thank you all. I don't know what happened before as it worked just fine.
When i try to run my code on Eclipse this error appears:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
i try to coment my entired code and this error still appear.
It seems you haven't set your java path correctly.
Setting Up Eclipse with Java 1.6 on Windows
How To Install and Get Started with Java Programming
Run eclipse in clean mode
Edit the eclipse.ini file located in your Eclipse install directory and insert -clean as the first line.
If this is happening to a specific project only and other projects are running fine then your default run configuration might have changed. You may try the following
- Run -> Run As -> 1 Java Application.
I fixed this issue by deleting some of my old runtime configurations. Eclipse then started automatically generating them again.
This feels silly, but its been 2 days...somewhere after upgrading from Ubuntu 10.04 to 10.11 and from Eclipse Helios to Eclipse Indigo, I got stuck with the following problem:
Problem Description:
I'm trying to use a function in math.h called isinf(), but the problem also occurs with things like isnan(). The program compiles fine on the command line using make and fine in eclipse using build. But if I open the program file in eclipse it reports that it cannot reolve the isinf() function call. If I just insert the program contents into a new project and new source file, the error appears immediately. This problem did not occur under 11.04 with Eclipse Helios CDT
Questions:
Why are these errors only reported when the program file is opened and not on when the program is compiled; why are the errors not detected make is run from the command line? Is there a solution/workaround available?
Version Info
Linux Ubuntu 10.11 64-bit
Eclipse CDT Indigo, Service Release 1, Build id: 20110916-0149
(Also using Eclipse EE Indigo – if that makes a difference)
GNU Make 3.81
gcc 4.6.1-9Ubuntu3
To Duplicate:
Please find the two files you'll need to replicate below:
Step 0. Verify that everything is fine outside of Eclipse
Copy the attached source file and make file
create a directory e.g. Mkdir FunTest
Save the source file a 'Test.cpp' and the makefile as 'makefile'
Open a command prompt and navigate to the directory e.g. FunTest
Enter 'make'
Enter ./TestOut
Program responds “is not infinite”
Step 1. Create the project in Eclipse
Open Eclipse
Select File|New|MakeFile Project with Existing Code
Click Browse – navigate to the directory (FunTest) and click ok
Select 'Linux GCC' from the Toolchain selector
Click Finish
Step 2. Find the Error
Click Build All (Ctrl-B) – project builds without errors
Open the project in the project explorer to display the file in the directory
Double click on the file “Test.cpp”
Note the error icon next to line testing for infinity
Note the 2 error messages:
Semantic error: Function _isinff could not be resolved
Semantic error: Function _isinfl could not be resolved
Test.cpp:
include <math.h>
int main(int argc, char **argv)
{
int TestNum = 10;
if (isinf(TestNum) == 0)
printf("Not infinite\n");
return 0;
}
makefile:
# Specify the compiler
CC = g++
# Specify the compiler flags
CFLAGS += -c
# Specify the files making up the application
SOURCES = Test.cpp
OBJECTS = $(SOURCES:.cpp=.o)
EXECUTABLE = TestOut
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $#
.cpp.o:
$(CC) $(CPPFLAGS) $(CFLAGS) $< -o $#
install:
#echo "Build complete!"
I have experienced similar problems of the CDT reporting errors even though the code compiled fine within Eclipse Indigo.
Project > Properties > Settings > Binary Parsers > "GNU Elf Parser"
helped in my case. I had the "Elf Parser" checked.
That looks like a problem that many others have had with eclipse CDT before. Sometimes shutting eclipse down and then starting it back up again is enough to help. If that isn't the case, take a look at what I have below:
Compilation ok, but eclipse content assist having problems
Check your includes: if you're using include<math.h> change it to include<cmath>. The same for stdio.h and stdlib.h, you should replace by cstdio and cstdlib. Another option may be change you project to a C project instead of a C++.
You are missing -lm option in your build preferences.
Project->Properties->Settings->Miscleanous->Other (linker) flags[]
For me, it was solved by adding a specific ‘Source Location’ folder, and removing the default. In Luna, it is under:
Project > Properties > C/C++ General > Paths and Symbols > Source
Location
I have the following class and unit test in a PHP project in Eclipse:
I know my unit test works as I can run it at the command line:
Now I want to run this test from Eclipse. I set up PHP Unit in Eclipse like this:
However, when I run the PHPUnit tests:
It tells me that it can't include the class file:
/usr/bin/php -c /var/folders/UA/UAv38snBHd0QMgEPMCmM9U+++TM/-Tmp-/zend_debug/session4910937990995915704.tmp -d asp_tags=off /Applications/eclipse/plugins/org.phpsrc.eclipse.pti.tools.phpunit_0.5.0.R20101103000000/php/tools/phpunit.php --log-junit /var/folders/UA/UAv38snBHd0QMgEPMCmM9U+++TM/-Tmp-/pti_phpunit/phpunit.xml /Volumes/data/domains/et/extjslayout/phpunittest/tests
PHP Warning: include_once(../Product.php): failed to open stream: No such file or directory in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 3
PHP Warning: include_once(): Failed opening '../Product.php' for inclusion (include_path='/usr/local/PEAR') in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 3
PHP Fatal error: Class 'Product' not found in /Volumes/data/domains/et/extjslayout/phpunittest/tests/ProductTest.php on line 9
Why would PHPUnit be able to find the class when run from the command line but not when run from Eclipse?
When you start something from the command line, the "current directory" has a well-defined meaning: It's the directory where you started the command.
In Eclipse, what is the "current directory"? It's probably the directory from which you started Eclipse or maybe the folder in which Eclipse is installed.
I haven't used PHP in Eclipse before but for other languages, I can set the current directory in the launch config somewhere. If that doesn't work, define a variable which points to your project and then use absolute paths (using that variable as a starting point).
Have same problem. Found only solution by creating tests with internal PHPUnit wizard like at this screenshot:
Source: HowTo create a Test Case Class from a PHP Class
But following investigate show that your test case file should contain reference to tested code for example like this: require_once 'C:\Apache2\htdocs\jobeet\src\Ibw\JobeetBundle\Utils\Jobeet.php';
Other experiments with plugin config not bringing luck. So in my opinion PHPUnit from PHP Tools not well developed plugin. Consider using MakeGood plugin as better alternative.