Hi @pradeeban, was looking through #574 and ended up down a rabbit hole on the C++ side.
Turns out we already have two decent test files sitting in the repo, TestLiteralEvalCpp.cpp from #389 and TestConcoreHpp.cpp from #484. They cover the parser and the actual Concore class API, read_FM/write_FM, unchanged(), the works. Both are written as plain pass/fail programs that exit non-zero on failure, basically built to be dropped straight into CI.
Except they never are. The only C++ job in ci.yml, cpp-shm-test, just runs g++ with -fsyntax-only on a completely different file, which only checks that concore.hpp parses, nothing gets compiled into a binary or executed. So these two test files just sit there. Someone could break read/write round-tripping or reintroduce the old parser bug from #389 and CI would still show green, because the job that looks like it's testing C++ isn't actually running either of them.
Kind of an easy thing to miss too since the job name makes it look covered. Java, Julia, MATLAB and Verilog all genuinely build and run their tests, C++ is the odd one out here.
Fix is small, just build and run both in that job:
g++ -std=c++11 -o TestLiteralEvalCpp TestLiteralEvalCpp.cpp && ./TestLiteralEvalCpp
g++ -std=c++11 -o TestConcoreHpp TestConcoreHpp.cpp && ./TestConcoreHpp
Can send the PR for this, just wanted to check first in case there was a reason they were left out.
Hi @pradeeban, was looking through #574 and ended up down a rabbit hole on the C++ side.
Turns out we already have two decent test files sitting in the repo, TestLiteralEvalCpp.cpp from #389 and TestConcoreHpp.cpp from #484. They cover the parser and the actual Concore class API, read_FM/write_FM, unchanged(), the works. Both are written as plain pass/fail programs that exit non-zero on failure, basically built to be dropped straight into CI.
Except they never are. The only C++ job in ci.yml, cpp-shm-test, just runs g++ with -fsyntax-only on a completely different file, which only checks that concore.hpp parses, nothing gets compiled into a binary or executed. So these two test files just sit there. Someone could break read/write round-tripping or reintroduce the old parser bug from #389 and CI would still show green, because the job that looks like it's testing C++ isn't actually running either of them.
Kind of an easy thing to miss too since the job name makes it look covered. Java, Julia, MATLAB and Verilog all genuinely build and run their tests, C++ is the odd one out here.
Fix is small, just build and run both in that job:
g++ -std=c++11 -o TestLiteralEvalCpp TestLiteralEvalCpp.cpp && ./TestLiteralEvalCpp
g++ -std=c++11 -o TestConcoreHpp TestConcoreHpp.cpp && ./TestConcoreHpp
Can send the PR for this, just wanted to check first in case there was a reason they were left out.