> On Dec. 12, 2015, 3:40 p.m., Alex Merry wrote: > > Ooh, also, please write a unit test. I can help with that if you find the > > idea of writing a CMake-based unit test daunting, but you can look in the > > tests directory for inspiration. > > Marco Martin wrote: > I'm not sure what the test should do... > perhaps having in the repo a tarball and a source template, make it > generate and then compare the files? > > Alex Merry wrote: > Yes, that would work. Or you could have a source template, and check the > installed file can be extracted and check the extracted contents. Don't > forget to make sure that files you think should be excluded are in fact > omitted. > > Marco Martin wrote: > if i try to use kde_add_app_templates from a run_test.cmake i get the > message KDETemplateGenerator.cmake:97 (add_custom_target): > Command add_custom_target() is not scriptable > any idea what it could be? > > Alex Merry wrote: > Ah, you'll need to do a project-style test. See ECMPoQmToolsTest, or > ECMInstallIconsTest. The idea is you create a CMakeLists.txt file as though > it were a project using this module, and make, say, a check_tree.cmake script > to check that the right things were installed in the right places. Lines > 124-131 of tests/CMakeLists.txt are what run ECMInstallIconsTest. > > Marco Martin wrote: > still not completely understanding.. do i have to execute the operations > i test in the test dirs cmakelist or have the run_test.cmake generate another > cmakelist and then run another cmake on top of that? > > Marco Martin wrote: > in the latest version it successfully to just check for the existence of > the tarball. > is it possible to uncompress it as well in the test script? (i get the > same non scriptable error if i try to call the cmake untar command)
That's because you need to use execute_process(). For the general structure, I really recommend you take ECMInstallIconsTest as your starting point. - Alex ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/126185/#review89391 ----------------------------------------------------------- On Dec. 17, 2015, 11:15 a.m., Marco Martin wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/126185/ > ----------------------------------------------------------- > > (Updated Dec. 17, 2015, 11:15 a.m.) > > > Review request for Build System, KDE Frameworks, Plasma, Aleix Pol Gonzalez, > and Simon Wächter. > > > Repository: extra-cmake-modules > > > Description > ------- > > templates are very useful as teaching tool in order to make > a minimal application that uses a certain framework. > templates in the KAppTemplate repository will always get forgotten > (plus kapptemplate is not really necessary as they work in kdevelop as well) > An ideal situation would be frameworks having templates in their own repos > with templates of barebone apps using the main framework features. > In order to do that, the cmake stuff needed in order to correctly install > a template needs to be ported to a place avaiable to all frameworks > > > Diffs > ----- > > tests/KDEPackageAppTemplatesTest/qml-plasmoid/Messages.sh PRE-CREATION > tests/KDEPackageAppTemplatesTest/qml-plasmoid/CMakeLists.txt PRE-CREATION > tests/KDEPackageAppTemplatesTest/CMakeLists.txt PRE-CREATION > kde-modules/KDEPackageAppTemplates.cmake PRE-CREATION > tests/CMakeLists.txt 1a66f56 > kde-modules/KDEInstallDirs.cmake b7cd34d > tests/KDEPackageAppTemplatesTest/qml-plasmoid/README PRE-CREATION > > tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/contents/images/pairs.svgz > PRE-CREATION > tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/contents/ui/main.qml > PRE-CREATION > tests/KDEPackageAppTemplatesTest/qml-plasmoid/package/metadata.desktop > PRE-CREATION > tests/KDEPackageAppTemplatesTest/qml-plasmoid/qml-plasmoid.kdevtemplate > PRE-CREATION > tests/KDEPackageAppTemplatesTest/qml-plasmoid/qml-plasmoid.png PRE-CREATION > tests/KDEPackageAppTemplatesTest/run_test.cmake.config PRE-CREATION > > Diff: https://git.reviewboard.kde.org/r/126185/diff/ > > > Testing > ------- > > done some templates installed by plasma-framework > > > Thanks, > > Marco Martin > >
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel