I am very close to getting the Microchip MPLABX MDB (debugger) working with an automated test suite called ceedling. I have a ruby file called sim_test_fixture.rb
This file is to open the mdb.bat
and pass it a config file called sim_instructions.txt
. When I run the ruby file I am given a permission denied error. Why is that?
The script runs the command "C:\Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\bin\"mdb.bat C:\Users\MichaelMi\Documents\SourceTree\LED-Lighting-Driver\test\simulation\sim_instructions.txt
When I run the command myself it works just fine. Only when I try to run it from the following ruby file does it fail.
require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
OUT_FILE = "./test/simulation/out.txt"
File.delete OUT_FILE if File.exists? OUT_FILE
path = '"C:\Program Files (x86)\Microchip\MPLABX\v5.05\mplab_platform\bin\"mdb.bat C:\Users\MichaelMi\Documents\SourceTree\LED-Lighting-Driver\test\simulation\sim_instructions.txt'
var = IO.popen(path)
Process.wait
if File.exists? OUT_FILE
file_contents = File.read OUT_FILE
file_contents.gsub!("\n", "")
print file_contents
end
I am not 100% sure of the difference but this code works!