{"id":21943409,"url":"https://github.com/janwilmans/libidentify","last_synced_at":"2025-04-22T18:48:00.687Z","repository":{"id":75898228,"uuid":"95912763","full_name":"janwilmans/LibIdentify","owner":"janwilmans","description":"Standard method to identify a project's executable, for now specifically aimed at test-frameworks","archived":false,"fork":false,"pushed_at":"2017-08-19T00:31:18.000Z","size":30,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T17:41:35.294Z","etag":null,"topics":["identification","proposal","test-framework","test-runner"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janwilmans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-30T18:09:23.000Z","updated_at":"2025-02-06T23:06:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c822d4d-519d-4f48-8df5-f423371afda5","html_url":"https://github.com/janwilmans/LibIdentify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janwilmans%2FLibIdentify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janwilmans%2FLibIdentify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janwilmans%2FLibIdentify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janwilmans%2FLibIdentify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janwilmans","download_url":"https://codeload.github.com/janwilmans/LibIdentify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250301661,"owners_count":21408227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["identification","proposal","test-framework","test-runner"],"created_at":"2024-11-29T03:29:55.370Z","updated_at":"2025-04-22T18:48:00.681Z","avatar_url":"https://github.com/janwilmans.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibIdentify\nStandard method to identify a project's executable, for now specifically aimed at test-frameworks.\n\n# Abstract / Rationale\nThe initial reason for the existance of this project is too let [BoostTestUI](https://github.com/djeedjay/BoostTestUi) identify the kind of test it is loading. BoostTestUI is a graphical test runner for windows to run unittests, but this proposal should be useful to any test-runner that has to deal with executable binaries from several test frameworks, such as for example [Microsoft Visual Studio](https://www.visualstudio.com/) and possibly have wider application in identification of executables in general.\n\nBoostTestUI's name is kindof obsolete, it would better be named MultiTestRunner, because it currently supports Boost.Test, Google Test, Catch and Nunit.\n\nCurrently tests need to be re-compiled with a special header that is different per test-framework to be able to do two things:\n- identify the framework, in order to know what arguments to pass, to for example list all test or execute a specific test.\n- add an option --gui-wait to allow the UI to start the test-process without actually beginning to run anything, allowing the user to attach a debugger.\n\n# References\n\n- https://github.com/google/googletest/issues/1121\n- https://github.com/philsquared/Catch/issues/931  [implemented / DONE]\n- https://svn.boost.org/trac10/ticket/13082#ticket\n\n# Proposed standard\n\nOnly [libidentify.h](https://github.com/janwilmans/LibIdentify/blob/master/libidentify.h) is part of the standard, main.cpp is just an example of its usage.\n\n```\nfoobin --libidentify returns on std:cout:\nline 1: description:    \u003cdescription\u003e           [ascii string, starting at colomn 17, ending at but not including newline]\nline 2: category:       \u003ccategory\u003e              [ascii string, starting at colomn 17, ending at but not including newline]\nline 3: framework:      \u003cframeworkname\u003e         [ascii string, starting at colomn 17, ending at but not including newline]\nline 4: version:        \u003cversion\u003e               [ascii string, starting at colomn 17, ending at but not including newline]\n```\n\n- ```\u003cdescription\u003e``` for display purposes, not to be used for identification\n- ```\u003ccategory\u003e``` identification of the category the binary belongs to\n- ```\u003cframework\u003e``` major part of the identification\n- ```\u003cversion\u003e``` minor part of the identification \n\n```\u003cframework\u003e``` may be any string, but it shall be unique and stable over all future versions of your framework\n```\u003cversion\u003e``` shall start with \u003cmajor_version_number\u003e.\u003cminor_version_number\u003e. but after the second dot any text is allowed.\n\n# categories\n\nCurrently there is only one valid category:\n- testframework\n\n# examples \n\n```\nmyboosttest --libidentify\ndescription:    Boost Test\ncategory:       testframework\nframework:      boost.test\nversion:        1.64.0\n\nmygoogletest --libidentify\ndescription:    Google Test \ncategory:       testframework\nframework:      Google Test\nversion:        1.8.0\n\nmycatchtest --libidentify\ndescription:    Catch Test \ncategory:       testframework\nframework:      Catch Test\nversion:        1.9.6\n\nmyrandomtest --libidentify\ndescription:    Any Random Description Here\ncategory:       testframework\nframework:      RaNdOmTeSTFrAmEWoRk\nversion:        8.4.7.2-delta\n```\n\n# Additional proposed extention for all test frameworks\n\nI propose to add an commandline argument extention to wait for a UI / debugger to be attached.\n\n```\n   --wait-for-keypress \u003cstart|exit|both\u003e\n```\n\nSimplified example implementation: (--wait-for-keypress without arguments)\n\n```\n#include \"libidentify.h\"\n\n#include \u003ccstdio\u003e\n#include \u003cstring\u003e\n\nvoid main(int argc, char* argv[])\n{\n    // output identification if requested\n    LibIdentify::report(\"My test description\", LibIdentify::category_unspecified, \"My unique framework string\", \"1.0\", argc, argv);\n\n    // wait for debugger if requested \n    for (int i = 0; i \u003c argc; ++i)\n    {\n        auto argument = std::string(argv[i]);\n        if (argument == \"--wait-for-keypress\")\n        {\n            std::cout \u003c\u003c \"#waiting\" \u003c\u003c std::endl; // acknowledge the command was understood, make sure to use std::endl to flush the stream\n            std::getchar();\n        }\n    }\n\n    /*\n    ... normal main() starts here...\n    */\n}\n```\n\nNote that this argument does not have to be '--wait-for-getchar', it can have any name you like, it is not part of the 'libidentify' standard as such. It does however enable test-runners to start the test process without actually starting the test.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanwilmans%2Flibidentify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanwilmans%2Flibidentify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanwilmans%2Flibidentify/lists"}