~ubuntu-branches/ubuntu/wily/bear/wily-proposed

« back to all changes in this revision

Viewing changes to test/exec_anatomy/main.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Ramacher
  • Date: 2015-08-08 17:17:40 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20150808171740-zjzl8emser97w1le
Tags: 2.1.0-1
* New upstream release.
* debian/patches/remove-rpath.patch: Remove RPATH.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    cwd = NULL;
59
59
}
60
60
 
61
 
void expected_out(const char *cmd, const char *file) {
 
61
void expected_out(const char *file) {
62
62
    if (need_comma)
63
63
        fprintf(fd, ",\n");
64
64
    else
66
66
 
67
67
    fprintf(fd, "{\n");
68
68
    fprintf(fd, "  \"directory\": \"%s\",\n", cwd);
69
 
    fprintf(fd, "  \"command\": \"%s -c %s\",\n", cmd, file);
 
69
    fprintf(fd, "  \"command\": \"cc -c %s\",\n", file);
70
70
    fprintf(fd, "  \"file\": \"%s/%s\"\n", cwd, file);
71
71
    fprintf(fd, "}\n");
72
72
}
116
116
    char *const compiler = "/usr/bin/cc";
117
117
    char *const argv[] = {"cc", "-c", file, 0};
118
118
 
119
 
    expected_out("cc", file);
 
119
    expected_out(file);
120
120
    create_source(file);
121
121
 
122
122
    FORK(execv(compiler, argv);)
130
130
    char *const argv[] = {compiler, "-c", file, 0};
131
131
    char *const envp[] = {"THIS=THAT", 0};
132
132
 
133
 
    expected_out("/usr/bin/cc", file);
 
133
    expected_out(file);
134
134
    create_source(file);
135
135
 
136
136
    FORK(execve(compiler, argv, envp);)
143
143
    char *const compiler = "cc";
144
144
    char *const argv[] = {compiler, "-c", file, 0};
145
145
 
146
 
    expected_out(compiler, file);
 
146
    expected_out(file);
147
147
    create_source(file);
148
148
 
149
149
    FORK(execvp(compiler, argv);)
156
156
    char *const compiler = "cc";
157
157
    char *const argv[] = {compiler, "-c", file, 0};
158
158
 
159
 
    expected_out(compiler, file);
 
159
    expected_out(file);
160
160
    create_source(file);
161
161
 
162
162
    FORK(execvP(compiler, _PATH_DEFPATH, argv);)
170
170
    char *const argv[] = {"/usr/bin/cc", "-c", file, 0};
171
171
    char *const envp[] = {"THIS=THAT", 0};
172
172
 
173
 
    expected_out("/usr/bin/cc", file);
 
173
    expected_out(file);
174
174
    create_source(file);
175
175
 
176
176
    FORK(execvpe(compiler, argv, envp);)
182
182
    char *const file = "execl.c";
183
183
    char *const compiler = "/usr/bin/cc";
184
184
 
185
 
    expected_out("cc", file);
 
185
    expected_out(file);
186
186
    create_source(file);
187
187
 
188
188
    FORK(execl(compiler, "cc", "-c", file, (char *)0);)
194
194
    char *const file = "execlp.c";
195
195
    char *const compiler = "cc";
196
196
 
197
 
    expected_out(compiler, file);
 
197
    expected_out(file);
198
198
    create_source(file);
199
199
 
200
200
    FORK(execlp(compiler, compiler, "-c", file, (char *)0);)
207
207
    char *const compiler = "/usr/bin/cc";
208
208
    char *const envp[] = {"THIS=THAT", 0};
209
209
 
210
 
    expected_out(compiler, file);
 
210
    expected_out(file);
211
211
    create_source(file);
212
212
 
213
213
    FORK(execle(compiler, compiler, "-c", file, (char *)0, envp);)
220
220
    char *const compiler = "cc";
221
221
    char *const argv[] = {compiler, "-c", file, 0};
222
222
 
223
 
    expected_out(compiler, file);
 
223
    expected_out(file);
224
224
    create_source(file);
225
225
 
226
226
    pid_t child;
238
238
    char *const compiler = "cc";
239
239
    char *const argv[] = {compiler, "-c", file, 0};
240
240
 
241
 
    expected_out(compiler, file);
 
241
    expected_out(file);
242
242
    create_source(file);
243
243
 
244
244
    pid_t child;