I have a C++ program in test.cpp and some test cases for it namely test.1.in, test.2.in, test.3.in, test.4.in and test.5.in. The answers for these test cases are in test.1.sol, test.2.sol, test.3.sol, test.4.sol and test.5.sol. I want to write a *.bat file that
- compiles test.cpp
- tests test.exe on the test files and writes the results in *.txt files. I know how to do 2) but when I try to do 1) using the way I think I have to, nothing happens.
My guess for 1) is
cd C:UsersPetyoDesktopcl
-> this is the path to test.cpp
cl /EHsc /W4 /std:c++17 /O2 test.cpp
-> compiles test.cpp using MSVC
I do 2) this way:
test <test.1.in > test.1.sol2.txt
-> tests test.exe on test.1.in and writes the result in test.1.sol2.txt
test <test.2.in > test.2.sol2.txt
-> tests test.exe on test.2.in and writes the result in test.2.sol2.txt
test <test.3.in > test.3.sol2.txt
-> tests test.exe on test.3.in and writes the result in test.3.sol2.txt
test <test.4.in > test.4.sol2.txt
-> tests test.exe on test.4.in and writes the result in test.4.sol2.txt
test <test.5.in > test.5.sol2.txt
-> tests test.exe on test.5.in and writes the result in test.5.sol2.txt
How can I make 1) work ?