paulhorn da43859b97 feat: Projektstruktur nach P1204R0
Layout, Build und Konventionen analog zu mydb und cxx_scaffold_cli:
Header und Quellen nebeneinander in playground/, Unit-Tests als
.test.c/.test.cpp daneben, Integrationstests in tests/.

Geruest-Module counter (C, Unity) und notebook (C++, doctest) zeigen
jede Regel einmal an lauffaehigem Code.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 16:07:03 +02:00
2026-08-30 16:07:03 +02:00
2026-08-30 16:07:03 +02:00
2026-08-30 16:07:03 +02:00
2026-08-30 16:07:03 +02:00
2026-08-30 16:07:03 +02:00
2026-08-30 16:06:57 +02:00
2026-08-30 15:57:44 +02:00
2026-08-30 16:07:03 +02:00

playground

Experimentierprojekt. Struktur nach P1204R0 "Canonical Project Structure", Konventionen und Build-Setup identisch zu mydb und cxx_scaffold_cli.

Der Punkt dieses Repos ist die Form, nicht der Inhalt: counter (C) und notebook (C++) sind Gerüst-Module, die jede Regel einmal an lauffähigem Code zeigen. Zum Experimentieren werden sie ersetzt.

Layout

playground/
├── playground/           Quellcode UND Header nebeneinander
│   ├── counter.h/.c        C-Modul, opakes Struct, extern "C"
│   ├── counter.test.c      Unit-Test daneben (Unity)
│   ├── notebook.hpp/.cpp   C++-Modul, namespace playground
│   ├── notebook.test.cpp   Unit-Test daneben (doctest)
│   ├── main.cpp
│   └── details/            Implementation Details, nicht public API
├── tests/basics/         Integrationstest, nur öffentliche API
├── third_party/          vendortes Unity + doctest, nie editieren
├── cmake/                Warnings.cmake, Sanitizers.cmake
└── docs/                 CONVENTIONS.md, ADRs

Kein include/ + src/. Eigene Header immer <playground/counter.h>, nie "counter.h" — das ist P1204R0s wichtigste Einzelregel.

Bauen

cmake --preset debug
cmake --build --preset debug
ctest --preset debug
./build/debug/bin/playground

Presets: debug, release, asan-ubsan, apple-clang, homebrew-gcc, linux-gcc. Details in docs/CONVENTIONS.md.

Ein neues Modul hinzufügen

  1. playground/<name>.hpp + .cpp anlegen (bzw. .h/.c für C).
  2. Beide in CMakeLists.txt bei PLAYGROUND_SOURCES / PLAYGROUND_HEADERS eintragen — kein file(GLOB), sonst bleibt der Build grün und die Datei fehlt einfach.
  3. playground/<name>.test.cpp daneben, dann playground_add_doctest_test(<name>) aufrufen (C: .test.c und playground_add_unity_test(<name>)).
S
Description
No description provided
Readme MIT 239 KiB
Languages
C++ 64.8%
CMake 22.3%
C 11.5%
Shell 1.4%