Bug 66753 - [PATCH] Do not build test only files into internal libdbus
Summary: [PATCH] Do not build test only files into internal libdbus
Status: RESOLVED NOTABUG
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: Other All
: lowest trivial
Assignee: Havoc Pennington
QA Contact:
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-07-10 04:39 UTC by Chengwei Yang
Modified: 2013-08-23 08:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH 1/3] TEST: remove redundant test build detection in bus daemon (3.17 KB, patch)
2013-07-10 05:49 UTC, Chengwei Yang
Details | Splinter Review
[PATCH 2/3] TEST: do not build test only files into libdbus (2.05 KB, patch)
2013-07-10 05:50 UTC, Chengwei Yang
Details | Splinter Review
[PATCH 3/3] TEST: remove redundant test build detection in libdbus (2.69 KB, patch)
2013-07-10 05:51 UTC, Chengwei Yang
Details | Splinter Review
[PATCH v2 1/3] TEST: do not build test only files into internal libdbus (2.19 KB, patch)
2013-07-11 05:04 UTC, Chengwei Yang
Details | Splinter Review
[PATCH v2 2/3] TEST: polish test build detection in bus daemon test files (3.58 KB, patch)
2013-07-11 05:05 UTC, Chengwei Yang
Details | Splinter Review
[PATCH v2 3/3] TEST: polish test build detection in libdbus test files (2.75 KB, patch)
2013-07-11 05:05 UTC, Chengwei Yang
Details | Splinter Review

Description Chengwei Yang 2013-07-10 04:39:27 UTC
There are several files used only by test, and these files only build if tests enabled. So it's redundant to check DBUS_ENABLE_EMBEDDED_TESTS in source code. These patches removed these checks in bus/ and dbus/, no such checks in test/, it's clean.
Comment 1 Chengwei Yang 2013-07-10 05:49:53 UTC
Created attachment 82250 [details] [review]
[PATCH 1/3] TEST: remove redundant test build detection in bus  daemon
Comment 2 Chengwei Yang 2013-07-10 05:50:23 UTC
Created attachment 82251 [details] [review]
[PATCH 2/3] TEST: do not build test only files into libdbus
Comment 3 Chengwei Yang 2013-07-10 05:51:48 UTC
Created attachment 82252 [details] [review]
[PATCH 3/3] TEST: remove redundant test build detection in libdbus
Comment 4 Chengwei Yang 2013-07-10 09:09:50 UTC
these patches looks very trivial, not make much sense, I think I need explain more to convince myself first.

current status.

quite several files which used only by tests build into libdbus, although they did nothing since they detect DBUS_ENABLE_EMBEDDED_TESTS in the file begin. This looks like a double confirm to prevent these files be built by mistake, so I'm now OK to keep these detect in source file.

Meanwhile, I'd like to fix the others which detect DBUS_ENABLE_EMBEDDED_TESTS in the middle of file although they're only used in tests, like that in [PATCH 3/3].

And move these test only files into test build in Makefile.am rather than keep them in libdbus build.
Comment 5 Chengwei Yang 2013-07-11 05:04:31 UTC
Created attachment 82311 [details] [review]
[PATCH v2 1/3] TEST: do not build test only files into internal  libdbus
Comment 6 Chengwei Yang 2013-07-11 05:05:05 UTC
Created attachment 82312 [details] [review]
[PATCH v2 2/3] TEST: polish test build detection in bus daemon test  files
Comment 7 Chengwei Yang 2013-07-11 05:05:31 UTC
Created attachment 82313 [details] [review]
[PATCH v2 3/3] TEST: polish test build detection in libdbus test  files
Comment 8 Simon McVittie 2013-08-22 17:58:25 UTC
Comment on attachment 82313 [details] [review]
[PATCH v2 3/3] TEST: polish test build detection in libdbus test  files

Review of attachment 82313 [details] [review]:
-----------------------------------------------------------------

This seems a lot of diffstat, for what benefit?

::: dbus/dbus-test.c
@@ -98,4 @@
>  void
>  dbus_internal_do_not_use_run_tests (const char *test_data_dir, const char *specific_test)
>  {
> -#ifdef DBUS_ENABLE_EMBEDDED_TESTS

This is technically an ABI break: it removes symbols that were previously exported. (Nobody should have been calling those functions, but, still.)
Comment 9 Simon McVittie 2013-08-22 17:59:21 UTC
Given the choice between conditionally including files in the build system, and always including all files but having some of them conditionally empty, I usually prefer the "conditionally empty" route unless there are technical reasons to avoid it.
Comment 10 Chengwei Yang 2013-08-23 08:24:06 UTC
OK.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.