Setting up custom build environment

49 views Asked by At

I am trying to set up my custom build environment for Sublime Text 3 for competitive Programming.

My target is as follows :

  1. Build the current source file
  2. Run it and read inputs from a file input.in
  3. Write output to a file output.out
  4. diff expected output.out. expected file contains the expected output

This is how the window setup looks like enter image description here

This is my json file for the build system

{
"cmd": ["g++ -std=c++11 ${file} -o ${file_path}/${file_base_name} && ${file_path}/${file_base_name}<${file_path}/input.in>${file_path}/output.out && diff output.out expected"],
"shell":true
}

So far steps 1-3 are working as expected. But for last step 4, I am not able to get the result in proper suitable format. e.g. when files match there is no output (as diff generates nothing in case of match) and in case of non-match, this build system is generating output in non human-readable format.

5a6
> f
[Finished in 0.1s with exit code 1]

Can anyone suggest a better way to output the result or is there a way to use linux's notification utility

0

There are 0 answers