Commit Graph

661 Commits

Author SHA1 Message Date
Adriaan de Groot
e49fb74847 [libcalamares] Fix more tests 2020-02-21 17:58:55 +01:00
Adriaan de Groot
39cc43f26b [libcalamares] Fix tests
- QCOMPARE() is sensitive to differing types in actual and expected,
  and uchar and int (and mode_t and int) are different.
2020-02-21 17:53:43 +01:00
Adriaan de Groot
1bb43e06e2 Merge branch 'master' into kpmcore-manager 2020-02-19 18:34:44 +01:00
Adriaan de Groot
81752b6f7c [libcalamares] Document how TranslatedString context works
- Support re-using class-specific tr() calls in a standard way
- Document this in the netinstall.conf which uses it
2020-02-19 14:23:34 +01:00
Adriaan de Groot
0ef28f6a50 [libcalamares] Translatable config strings use tr()-infrastructure
- Allow TranslatedString to get a context parameter; if it has
  one, it will try to use the regular tr()-infrastructure
  **as fallback** for the translations from the config file itself.
- This makes it possible to offer -- and translate -- some "standard"
  phrases in the module, while allowing the config file the knob
  to change strings. Using one of the standard strings gets translations
  for "free", while introducing something entirely new means sourcing
  translations for it as well.
2020-02-19 14:04:35 +01:00
Adriaan de Groot
371fe267b1 Merge branch 'better-hostname' 2020-02-17 17:10:21 +01:00
Adriaan de Groot
94f5b13db0 [libcalamaresui] Restore previous DLLEXPORT names
- Different libraries should have different EXPORTs, so that
   you can IMPORT one while building the other. Reported (and
   kindly explained) by Kevin Kofler.
 - Stick to one header file, though.

While here, update copyright on file.
2020-02-17 16:55:17 +01:00
Adriaan de Groot
6719a41aef [libcalamares] Switch tests to calamares_add_test() 2020-02-17 15:05:00 +01:00
Adriaan de Groot
51e135cfbd CMake: chase introduction of IMPORTED yamlcpp 2020-02-17 15:01:05 +01:00
Adriaan de Groot
92260e7d0b [libcalamares] Document DllMacro.h and add STATICTEST
- document the export macros
 - introduce a "static" that is switched off when re-building code
   for tests.
2020-02-17 11:43:20 +01:00
Adriaan de Groot
b044549013 [libcalamares] Merge PluginDllMacro.h into DllMacro.h
- Let's just have one header definining export- and visibility-
   macros for Calamares. They are still selected based on the
   export flags (*_PRO), just defined in one header instead of two.
2020-02-17 11:37:35 +01:00
Adriaan de Groot
781322ab41 [libcalamares] Use more descriptive variable name
- If the test failed, you'd get a cryptic message like
	FAIL!  : NetworkTests::testPing() 'r' returned FALSE. ()
   So rename the variable so the failure mode is more obvious.
   (Could have used QVERIFY2() instead, this is simpler)
2020-02-14 13:23:19 +01:00
Adriaan de Groot
f6526f7d9f [libcalamares] Add some tests for CreationResult
- More important is the compiler warning that will show up
   if we add more failure states.
2020-02-14 13:21:16 +01:00
Adriaan de Groot
274115c727 [libcalamares] Update tests to reflect changed API 2020-02-14 13:07:29 +01:00
Adriaan de Groot
2d7398161d [libcalamares] More detail for createTargetFile()
- Return a result-object with statrus information and the path
   which was previously used (empty for "failures").
2020-02-14 13:03:51 +01:00
Adriaan de Groot
d931b146e3 [partition] Shuffle new conveniences into partition service
- the general stuff from KPMHelpers ends up in the partition
   service; that only gets compiled when KPMCore is available anyway.
2020-02-13 13:48:12 +01:00
Adriaan de Groot
e72ecaafd3 Merge branch 'kpmcore-manager'
Introduces a "partitioning service" into libcalamares,
shuffles a bunch of things into it, tries to help out
with settling the system between partitioning actions.
2020-02-13 13:41:53 +01:00
Adriaan de Groot
c7780db07a Merge branch 'model-q'
- Make models of some things previously held as lists, as
   prep-work for QML modules.
2020-02-12 14:08:07 +01:00
Adriaan de Groot
ca13d1670e [libcalamares] Merge more from Camilo
- Complete the model for locales
2020-02-12 13:40:59 +01:00
Adriaan de Groot
59ddda6225 Merge branch 'wrangle-boost' 2020-02-12 12:44:09 +01:00
Adriaan de Groot
9408601074 [libcalamares] Move Python wrapper
- Take the Python wrapper for GlobalStorage out of the GlobalStorage.h
   header and add it to PythonHelper instead, saving some work in
   all the cases that only GS is interesting, not the Python bits.
2020-02-12 12:37:43 +01:00
Adriaan de Groot
a11280b427 [libcalamares] Expand tests for printable entropy 2020-02-12 12:22:02 +01:00
Adriaan de Groot
090716ba4f [libcalamares] Warnings-- in Entropy
- reading a file yields a qint64
 - need to mash the unsigned data from twister to signed char data.
2020-02-12 12:15:13 +01:00
Adriaan de Groot
7efed8226c [libcalamares] Warnings--, update copyright 2020-02-12 12:10:58 +01:00
Adriaan de Groot
c1151cbcfa [libcalamares] Update copyright info 2020-02-12 12:08:46 +01:00
Adriaan de Groot
8181808bec [libcalamares] Fix build
- drop now-obsolete boost-warnings.h
 - add missing namespace alias to GlobalStorage.h (removed accidentally
   in previous commit)
2020-02-12 11:25:10 +01:00
Adriaan de Groot
3b35ca7bb9 [libcalamares] Simplify includes
- PythonHelper.h already pulls in all the Python machinery
2020-02-12 11:04:15 +01:00
Adriaan de Groot
95722541d0 [libcalamares] Untangle Python includes
- Use BoostPython.h to manage overall includes
 - Remove local home-grown variations
2020-02-12 11:02:38 +01:00
Adriaan de Groot
f8998834cf [libcalamares] Simplify includes (no Python used in JobQueue) 2020-02-12 10:55:36 +01:00
Adriaan de Groot
d42e757576 [libcalamares] Simplify includes
- CalamaresVersion used by the job, not the API presented to Python.
 - Untangle Qt includes from there.
2020-02-12 10:48:19 +01:00
Adriaan de Groot
f3e7fe5eb4 [libcalamares] Use more specific include 2020-02-12 10:32:10 +01:00
Adriaan de Groot
96580e5c40 [libcalamares] Convenience header for Boost and its warnings 2020-02-12 10:28:48 +01:00
Adriaan de Groot
6432b7f42a [libcalamares] Hit Boost warnings with a hammer
- Tons of warnings from Clang 9 in Boost::Python code, so
   turn of most of those warnings in the Boost-support code.
2020-02-11 16:46:44 +01:00
Adriaan de Groot
684c5f477c [libcalamares] Moc warnings--
- don't have a NOTIFY CONSTANT property
 - the data is constant, so drop NOTIFY
 - remove redundant signals
 - remove setLabels() now it's only needed from one constructor
2020-02-11 16:40:36 +01:00
Adriaan de Groot
b4b1bf5de2 [libcalamares] Call delegated constructor 2020-02-11 16:39:39 +01:00
Adriaan de Groot
df5a0d25bc [libcalamares] Handle empty locale names quickly 2020-02-11 16:37:49 +01:00
Adriaan de Groot
27bc64e63f [libcalamares] C++ style, warnings-- 2020-02-11 15:36:30 +01:00
Adriaan de Groot
241cb04f06 [libcalamares] Coding style 2020-02-11 15:25:28 +01:00
Camilo Higuita
1b3d32ca79 make label item from LabelModel qobject based and expose properties 2020-02-11 15:24:29 +01:00
Adriaan de Groot
240fe2a564 [libcalamares] Add convenience createTargetParentDirs() 2020-02-07 16:09:02 +01:00
Adriaan de Groot
6ede9f2c7c [libcalamares] Test QFileInfo::dir() for completeness 2020-02-07 16:08:38 +01:00
Adriaan de Groot
e65969d587 [libcalamares] Re-do createTargetDirs()
- Drop the basedirs idea, replace return with just bool
 - Use QDir::mkpath, with some extra validation
 - Test it a bit
2020-02-07 15:51:46 +01:00
Adriaan de Groot
8b8ecf7b7b [libcalamars] Improve test init and cleanup
- Test createTargetFile and removeTargetFile
 - Clean up afterwards
 - Ensure /tmp is the RMP for each test
2020-02-07 15:23:02 +01:00
Adriaan de Groot
b502d78984 [libcalamares] Fix warning message
- "create" was when this function was used elsewhere
2020-02-07 13:58:44 +01:00
Adriaan de Groot
394eee3954 [libcalamares] Test more targetPath() scenario's 2020-02-07 13:57:14 +01:00
Adriaan de Groot
8d23e665ea [libcalamares] Fix targetPath() tests
- there is less simplification done than you might think
2020-02-07 13:53:49 +01:00
Adriaan de Groot
daa5b804b3 [libcalamares] Split paths-tests into own test executable
- Since these tests all want a system object, and a GS
   with a sensible setup, give them one with its own initTestCase().

This could have been done with one executable, running tests from
multiple classes, but there's not much overall benefit there.
2020-02-07 13:49:06 +01:00
Adriaan de Groot
31878dd43b [libcalamares] Avoid double / between root and path in targetPath() 2020-02-07 13:29:35 +01:00
Adriaan de Groot
15bca702c1 [libcalamares] Add tests for path functions (part 1) 2020-02-07 11:51:13 +01:00
Adriaan de Groot
95936549e2 [libcalamares] Add a createTargetBasedirs()
- Used to ensure that the directories leading up to a given path
   exist. Implementation is incomplete and broken for now.
 - While here, avoid removing an empty pathname in removeTargetFile()
   (the empty pathname indicates a broken configuration).
2020-02-07 11:30:37 +01:00