Skip to content

Commit

Permalink
Fix test-{cmake,pkgconfig}.sh to create, not append, to test files. (#…
Browse files Browse the repository at this point in the history
…919)

The test.cpp file and the CMakeLists.txt/Makefile were created with
the '>>' append in shell instead of '>'. Which means these files were
growing on multiple invocations if *-consumer was not deleted
between calls (which means that the test would fail the second time
around).

While at it, add the manifold/parallel.h include also to the
pkg-config test.

Make all includes 'system-header' style with angle brackets, as this
is what users of the library would use.
  • Loading branch information
hzeller authored Sep 10, 2024
1 parent 9124a68 commit 2e41fef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
mkdir cmake-consumer
cd cmake-consumer

cat <<EOT >> CMakeLists.txt
cat <<EOT > CMakeLists.txt
cmake_minimum_required(VERSION 3.18)
project(testing LANGUAGES CXX)
find_package(manifold "2.5.1" REQUIRED)
add_executable(testing test.cpp)
target_link_libraries(testing PRIVATE manifold)
EOT

cat <<EOT >> test.cpp
#include "manifold/manifold.h"
#include "manifold/parallel.h"
cat <<EOT > test.cpp
#include <manifold/manifold.h>
#include <manifold/parallel.h>
int main() { manifold::Manifold foo; return 0; }
EOT

Expand Down
5 changes: 3 additions & 2 deletions test-pkgconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
mkdir make-consumer
cd make-consumer

cat <<'EOT' >> Makefile
cat <<'EOT' > Makefile
CXXFLAGS=$(shell pkg-config --cflags manifold)
LDFLAGS=$(shell pkg-config --libs manifold)
testing : testing.cpp
EOT

cat <<EOT >> testing.cpp
cat <<EOT > testing.cpp
#include <manifold/manifold.h>
#include <manifold/parallel.h>
int main() { manifold::Manifold foo; return 0; }
EOT

Expand Down

0 comments on commit 2e41fef

Please sign in to comment.