Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
a1f9c169
Commit
a1f9c169
authored
Feb 04, 2020
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/configurator: simplify wrapper code a little.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
42d7b648
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
+6
-13
tools/configurator/configurator.c
tools/configurator/configurator.c
+6
-13
No files found.
tools/configurator/configurator.c
View file @
a1f9c169
...
...
@@ -639,7 +639,7 @@ static struct test *find_test(const char *name)
#define MAIN_BODY_BOILERPLATE "return 0;\n"
#define MAIN_END_BOILERPLATE "}\n"
static
bool
run_test
(
const
char
*
cmd
,
const
char
*
wrapper
,
struct
test
*
test
)
static
bool
run_test
(
const
char
*
cmd
,
const
char
*
wrapper
,
struct
test
*
test
)
{
char
*
output
,
*
newcmd
;
FILE
*
outf
;
...
...
@@ -757,17 +757,10 @@ static bool run_test(const char *cmd, const char* wrapper, struct test *test)
/* We run INSIDE_MAIN tests for sanity checking. */
if
(
strstr
(
test
->
style
,
"EXECUTE"
)
||
strstr
(
test
->
style
,
"INSIDE_MAIN"
))
{
char
*
cmd
=
"."
DIR_SEP
OUTPUT_FILE
;
if
(
wrapper
)
{
// string length and null terminator.
size_t
size
=
strlen
(
wrapper
)
+
strlen
(
" "
)
+
strlen
(
cmd
)
+
1
;
char
*
newcmd
=
malloc
(
size
);
memset
(
newcmd
,
'\0'
,
size
);
strcat
(
newcmd
,
wrapper
);
strcat
(
newcmd
,
" "
);
strcat
(
newcmd
,
cmd
);
cmd
=
newcmd
;
}
char
*
cmd
=
malloc
(
strlen
(
wrapper
)
+
strlen
(
" ."
DIR_SEP
OUTPUT_FILE
)
+
1
);
strcpy
(
cmd
,
wrapper
);
strcat
(
cmd
,
" ."
DIR_SEP
OUTPUT_FILE
);
output
=
run
(
cmd
,
&
status
);
if
(
wrapper
)
{
free
(
cmd
);
...
...
@@ -922,7 +915,7 @@ int main(int argc, const char *argv[])
=
{
""
,
DEFAULT_COMPILER
,
DEFAULT_FLAGS
,
NULL
};
const
char
*
outflag
=
DEFAULT_OUTPUT_EXE_FLAG
;
const
char
*
configurator_cc
=
NULL
;
const
char
*
wrapper
=
NULL
;
const
char
*
wrapper
=
""
;
const
char
*
orig_cc
;
const
char
*
varfile
=
NULL
;
const
char
*
headerfile
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment