nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
49 stars 31 forks source link

Test C++ enums #117

Closed bocchino closed 2 years ago

bocchino commented 2 years ago

Test C++ code generation for enums.

bocchino commented 2 years ago

Steps:

  1. Set up the test environment a. Add compiler/scripts to your PATH to pick up the fprime-gcc script b. Check out F Prime from nasa/fprime c. Set the FPRIME environment variable to point to the root of the F Prime repo (step 1.b)
  2. Create compiler/tools/fpp-to-cpp/test/enum
  3. Copy compiler/tools/fpp-to-xml/test/enum/*.fpp to the directory created in step 1. Those are the source files for the tests.
  4. Copy executable scripts and scripts ending in .sh from compiler/tools/fpp-to-cpp/test/constants to .../test/enum
  5. Revise tests.sh in .../test/enum to record the new tests. The name of each test matches the corresponding source fpp file.
  6. Run ./update-ref to regenerate the test output
  7. Examine the *.ref.txt files to make sure that the test output looks right
  8. Revise check-cpp to compile the generated enum C++ (the current version is specialized to compiling constant C++)
  9. Make sure that check-cpp runs without errors and compiles the generated C++
bocchino commented 2 years ago

Done in #129.