Skip to content

C++ tests exist but CI never actually runs them #584

Description

@bhuvan-somisetty

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions