← All tasks
cppopenscad/openscad #5883Not a task: not reproduced

Tests fail due to ${SUFFIX} not being used

envgap__openscad__openscad-5883

01 / FAILURE SIGNATURE

As reported upstream

3. Tests will fail with a file not found error for the openscad binary (I don't have the output anymore but you get the idea)
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
12fe733b5a67d44b8b2de223dded6a31fc018ee3
Manifest
CMakeLists.txt
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

openscad/openscad #5883 · read the original issue
**Describe the bug**
In [/CMakeLists,txt:218](https://github.com/openscad/openscad/blob/716690492a551b6458697c9c0c77dfadbd190f4d/CMakeLists.txt#L218) `-DSUFFIX` is appended to the binary name:

```cmake
if (NOT "${SUFFIX}" STREQUAL "")
  set(SUFFIX_WITH_DASH "-${SUFFIX}")
  target_compile_definitions(OpenSCAD PRIVATE OPENSCAD_SUFFIX="${SUFFIX_WITH_DASH}")
endif()
```

This is not honored in [/tests/CMakeLists.txt:204](https://github.com/openscad/openscad/blob/716690492a551b6458697c9c0c77dfadbd190f4d/tests/CMakeLists.txt#L196)`:

```cmake
# Determine path for openscad executable
if(EXISTS "$ENV{OPENSCAD_BINARY}")
  set(OPENSCAD_BINPATH "$ENV{OPENSCAD_BINARY}")
elseif(APPLE)
  set(OPENSCAD_BINPATH "${CBD}/OpenSCAD.app/Contents/MacOS/OpenSCAD")
elseif (WIN32 OR MXECROSS)
  set(OPENSCAD_BINPATH "${CBD}/openscad.com")
elseif(EXISTS "${CBD}/bin/openscad")
  set(OPENSCAD_BINPATH "${CBD}/bin/openscad")
else()
  set(OPENSCAD_BINPATH "${CBD}/openscad")
endif()
```
which causes all tests to fail.

**To Reproduce**
Steps to reproduce the behavior:
1. Call `cmake build` with `-DSUFFIX=whatever`
2. Run `make && make tests`
3. Tests will fail with a file not found error for the openscad binary (I don't have the output anymore but you get the idea)

**Expected behavior**
Tests should use the name of the generated binary.

**Environment and Version info (please complete the following information):**
 - OS: GNU guix
 - System: amd64
 - OpenSCAD Version: d1351d6282abfd239cdd0c657f755d8c4a123ff8


I will submit a PR in a few minutes.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]