rubis-lab / CPSim_linux

8 stars 26 forks source link

(Suggestion) Way to find compile errors #6

Open iKess opened 7 years ago

iKess commented 7 years ago

In the current simulator, I cannot find the way to see compile errors of SWC codes. Even though there are errors in the codes, it launches TORCS normally with the previous version of design.

I suggest that you add some codes to see the errors if compile errors occur. Since this can prevent users from wasting time when they fine-tune without noticing the error (as i did...), I believe this will improve UX.

As a temporal solution, I found that we can see the errors by a 'make' command in the simulator/engine directory.

we123456 commented 7 years ago

You're right. We'll add your suggestion in the official release. If you add this feature in 'start.sh' file, then you'll get the bonus credit.

Thanks.

iKess commented 7 years ago

I just modified the start.sh file a little. (A way to check the errors and to prevent the confusing run of TORCS)

This additional lines are to see the make errors in the error.txt if errors occur. Plus, It won't run the TORCS if the make command is not successful.

c.f. Since the sh file is not on the git, so i just put the code here.

---------- start.sh ------------

!/bin/sh

cd ~/eclipse cp design.xml ../Simulator/parser/. cd workspace/$1 cp .h ../../../Simulator/parser/. cd ../../../Simulator/parser ./parser cd ../engine cp auto_generated_files/ .

make 2> ~/eclipse/error.txt

if [ $? -eq 0 ]; then torcs & ./real-time_simulator & rm ~/eclipse/error.txt echo OK > ~/eclipse/result.txt else echo FAIL > ~/eclipse/result.txt echo "some errors occur in SWC files. check error.txt in your eclipe directory" >> ~/eclipse/result.txt xmessage "some errors occur in SWC files. check error.txt in your eclipe directory" fi

camilo-celis commented 7 years ago

TL;DR You contribution can be slightly improved by storing also the stdout and stderr outputs of the parser, engine, and real-time_simulator.

@iKess This is a good suggestion. But, to be honest I think the approach of using the start.sh bash script should be changed. Also, because Torcs, the simulator, and the parser all run as a background task launched by start.sh we won't see any runtime error in an easy way.