Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1443 from STEllAR-GROUP/fixing_1437
Always stripping HPX command line arguments before executing start function
- Loading branch information
Showing
4 changed files
with
88 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2015 Andreas Schaefer` | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
// Demonstrating #1437: hpx::init() should strip HPX-related flags from argv | ||
|
||
#include <hpx/hpx.hpp> | ||
#include <hpx/hpx_init.hpp> | ||
#include <hpx/util/lightweight_test.hpp> | ||
|
||
bool invoked_main = false; | ||
|
||
int my_hpx_main(int argc, char **argv) | ||
{ | ||
// all HPX command line arguments should have been stripped here | ||
HPX_TEST(argc == 1); | ||
|
||
invoked_main = true; | ||
return hpx::finalize(); | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
HPX_TEST(argc > 1); | ||
|
||
HPX_TEST_EQ(hpx::init(&my_hpx_main, "testapp", argc, argv), 0); | ||
HPX_TEST(invoked_main); | ||
|
||
return hpx::util::report_errors(); | ||
} |