diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-12 20:29:31 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-12 20:29:31 +0530 |
| commit | d46cf6e12452261c6aaf498dddf8e1176d349d6e (patch) | |
| tree | 34419f624dd2dff981a10f399ee156a3c9ed5f37 /templates | |
| parent | 35d8464f8975ab35c1e2f1a076302d9f95bfb22c (diff) | |
| download | null-browser-d46cf6e12452261c6aaf498dddf8e1176d349d6e.tar.gz null-browser-d46cf6e12452261c6aaf498dddf8e1176d349d6e.zip | |
Allow running only specific test classes + test template generation
Diffstat (limited to '')
| -rwxr-xr-x | templates/qtest.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/templates/qtest.sh b/templates/qtest.sh new file mode 100755 index 0000000..48a9f7d --- /dev/null +++ b/templates/qtest.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env sh + +set -e -o pipefail + +class_name="$1" +[ -z "$class_name" ] && exit 1 + +echo "#include <QtCore> +#include \"testUtils.h\" + +#include \"$class_name.hpp\" + +class ${class_name}Spec : public QObject { + Q_OBJECT + +private slots: + void testThings() { + context(\"when initialized\"); + it(\"does things\") { + $class_name instance; + + QCOMPARE(1, 1); + } + } +}; + +QTEST_REGISTER(${class_name}Spec) +#include \"${class_name}Spec.moc\" +" > "./spec/${class_name}Spec.cpp" + |
