mirror of
https://github.com/bkaradzic/bx.git
synced 2026-10-23 01:01:06 +00:00
This commit is contained in:
committed by
GitHub
parent
f56519b35d
commit
3fd3d3279e
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
#include <bx/allocator.h>
|
||||
#include <bx/commandline.h>
|
||||
#include <bx/readerwriter.h>
|
||||
#include <bx/string.h>
|
||||
@@ -436,3 +437,25 @@ TEST_CASE("tokenizeCommandLine maxArgvs", "")
|
||||
REQUIRE(0 == bx::strCmp(argv[1], "b") );
|
||||
REQUIRE(0 == bx::strCmp(next, "v g d") );
|
||||
}
|
||||
|
||||
TEST_CASE("commandLine args", "")
|
||||
{
|
||||
bx::DefaultAllocator allocator;
|
||||
|
||||
const char* argv[] = { "program", "--flag" };
|
||||
bx::CommandLineArgs args(&allocator, BX_COUNTOF(argv), argv);
|
||||
|
||||
REQUIRE(0 < args.getArgc() );
|
||||
REQUIRE(args.getArgv() != (const char**)NULL);
|
||||
|
||||
if (BX_ENABLED(BX_PLATFORM_WINDOWS) )
|
||||
{
|
||||
// Taken from the process command line, so the program is this test executable.
|
||||
REQUIRE(!bx::strFind(args.getArgv()[0], "bx.test").isEmpty() );
|
||||
}
|
||||
else
|
||||
{
|
||||
REQUIRE(BX_COUNTOF(argv) == args.getArgc() );
|
||||
REQUIRE(argv == args.getArgv() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user