Page MenuHomeWildfire Games

clean-workspaces.sh should delete all cpp testfiles
AbandonedPublic

Authored by elexis on Mar 24 2017, 12:01 AM.

Details

Summary

One can't move the svn checkout directory and then do a clean compile there, because the dynamically generated cpp test files still contain the old path and
because not all of them are deleted with clean-workspaces.sh as was intended by #3275 / rP16921.

Functions with the given names in that file are needed since they are referenced by the functions tested in these files.

Test Plan

Apply the patch to a working copy that had succeeded a compile previously.
Make sure that it compiles.
Move the root directory of the checked out code.
Execute clean-workspaces.sh and compile again.
Expected to succeed if and only if the patch was applied.
(Didn't actually test all steps, but it compiles and succeeeds the tests. Someone should test before committing though.)

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 865
Build 1361: Vulcan BuildJenkins
Build 1360: arc lint + arc unit

Event Timeline

elexis created this revision.Mar 24 2017, 12:01 AM
Vulcan added a subscriber: Vulcan.Mar 24 2017, 1:05 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (305 tests).................................................................................................................................................................................................................................................................................................................OK!

http://jw:8080/job/phabricator/583/ for more details.

leper edited edge metadata.Mar 24 2017, 1:45 AM

I'm not really happy with that rename, especially as that file doesn't contain an actual test. (Yes, it is picked up by the test file generation due to being a .h file in a test/ directory, but well.)

Better than this would be explicitly deleting that file, or rewriting that find rule to look for test/ directories and delete all .cpp files therein.

Even better would be fixing the generated makefiles in a way that make clean actually deletes all the files it generates.

In D256#9669, @leper wrote:

I'm not really happy with that rename, especially as that file doesn't contain an actual test. (Yes, it is picked up by the test file generation due to being a .h file in a test/ directory, but well.)

At least it would allow moving the directory and compiling again.

Better than this would be explicitly deleting that file

Can't move it to test_root.cpp, because that file is generated.
Can't find a suitable place that would be preferable over a rename:

./gui/tests/test_ParseString.h
./lib/res/graphics/tests/test_tex.h
./lib/file/disabled_tests/test_file_cache.h
./lib/file/disabled_tests/test_path.h
./lib/file/common/tests/test_trace.h
./lib/file/vfs/tests/test_vfs_tree.h
./lib/file/archive/disabled_tests/test_fat_time.h
./lib/file/archive/disabled_tests/test_codec_zlib.h
./lib/file/archive/disabled_tests/test_zip.h
./lib/file/archive/disabled_tests/test_compression.h
./lib/tests/test_bits.h
./lib/tests/test_wchar.h
./lib/tests/test_path_util.h
./lib/tests/test_adts.h
./lib/tests/test_byte_order.h
./lib/tests/test_cache_adt.h
./lib/tests/test_fnv_hash.h
./lib/tests/test_secure_crt.h
./lib/tests/test_rand.h
./lib/tests/test_base32.h
./lib/tests/test_path.h
./lib/tests/test_regex.h
./lib/tests/test_lib.h
./lib/sysdep/os/win/tests/test_wdbg_sym.h
./lib/sysdep/os/win/tests/test_ia32.h
./lib/sysdep/tests/test_rtl.h
./lib/sysdep/tests/test_sysdep.h
./lib/sysdep/arch/x86_x64/tests/test_topology.h
./lib/allocators/tests/test_allocators.h
./lib/allocators/tests/test_headerless.h
./lib/posix/tests/test_posix.h
./simulation2/tests/test_ComponentManager.h
./simulation2/tests/test_Simulation2.h
./simulation2/tests/test_Serializer.h
./simulation2/tests/test_ParamNode.h
./simulation2/tests/test_CmpTemplateManager.h
./simulation2/components/tests/test_Position.h
./simulation2/components/tests/test_CommandQueue.h
./simulation2/components/tests/test_TerritoryManager.h
./simulation2/components/tests/test_ObstructionManager.h
./simulation2/components/tests/test_RangeManager.h
./simulation2/components/tests/test_scripts.h
./simulation2/components/tests/test_Pathfinder.h
./scriptinterface/tests/test_ObjectToIDMap.h
./scriptinterface/tests/test_ScriptConversions.h
./scriptinterface/tests/test_ScriptInterface.h
./network/tests/test_Net.h
./network/tests/test_NetMessage.h
./maths/tests/test_FixedVector3D.h
./maths/tests/test_Bound.h
./maths/tests/test_Fixed.h
./maths/tests/test_Sqrt.h
./maths/tests/test_FixedVector2D.h
./maths/tests/test_Matrix3d.h
./maths/tests/test_Random.h
./maths/tests/test_MD5.h
./maths/tests/test_Brush.h
./tools/atlas/AtlasObject/tests/test_AtlasObjectXML.h
./ps/XML/tests/test_Xeromyces.h
./ps/XML/tests/test_XeroXMB.h
./ps/XML/tests/test_XMLWriter.h
./ps/XML/tests/test_RelaxNG.h
./ps/GameSetup/tests/test_CmdLineArgs.h
./ps/tests/test_test.h
./ps/tests/test_CColor.h
./ps/tests/test_CLogger.h
./ps/tests/test_Preprocessor.h
./ps/tests/test_cppformat.h
./ps/tests/test_CStr.h
./third_party/encryption/tests/test_pkcs5_pbkdf5.h
./third_party/encryption/tests/test_sha.h
./graphics/tests/test_TextureManager.h
./graphics/tests/test_Color.h
./graphics/tests/test_ShaderManager.h
./graphics/tests/test_LOSTexture.h
./graphics/tests/test_TextureConverter.h
./graphics/tests/test_Terrain.h
./graphics/tests/test_MeshManager.h

or rewriting that find rule to look for test/ directories and delete all .cpp files therein.

Sounds managable in less than a handful of hours.

Even better would be fixing the generated makefiles in a way that make clean actually deletes all the files it generates.

Doesn't sound managable in less than a handful of hours if one isn't familiar with that. Patches welcome.

leper requested changes to this revision.Apr 23 2017, 12:14 AM

As mentioned above I'd prefer a nice fix that would make make clean work, but I'd also be happy with an improved find/rm combination.

This revision now requires changes to proceed.Apr 23 2017, 12:14 AM
elexis added a comment.Jul 9 2017, 2:04 AM
In D256#15202, @leper wrote:

As mentioned above I'd prefer a nice fix that would make make clean work, but I'd also be happy with an improved find/rm combination.

Would be nice to be able to move the 0AD folder without having to delete that file manually.
The author of the commit should provide a fix if the author of the patch isn't available anymore.

Would be nice to be able to move the 0AD folder without having to delete that file manually.

Yes, would be nice, but it is still an uncommon use case and those running into it might want to consider this a simple ticket, or open one.

The author of the commit should provide a fix if the author of the patch isn't available anymore.

Just because someone might be able to fix all simple tickets we have by investing a weekend doesn't mean they have to.
Possible ways to fix this have been detailed earlier, anyone is free to do so.
That all assuming that the author of the commit is actually available.

elexis abandoned this revision.Dec 21 2017, 5:04 PM