Skip to content

Commit 65490bb

Browse files
committed
Add native test setup
1 parent 63277fb commit 65490bb

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

tests/run-tests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
set -e
44

5-
echo "a" > /tmp/a
6-
echo "b" > /tmp/b
7-
echo "c" > /tmp/c
85
COPYCAT="/tmp/a /tmp/b" copycat -- tests
96

107
echo -e "\nRunning benchmark without interception:"

tests/tests_general.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ void check_correct_fd(int fd) {
2525
EXPECT(!a);
2626
}
2727

28+
void setup() {
29+
FILE *f = fopen("/tmp/b", "w");
30+
EXPECT(f);
31+
fprintf(f, "b");
32+
fclose(f);
33+
}
34+
2835
int do_open(const char *filename) {
2936
return open(filename, O_RDONLY);
3037
}
@@ -40,6 +47,8 @@ int do_openat2(const char *filename) {
4047

4148
int main(int argc, char *argv[])
4249
{
50+
setup();
51+
4352
const char filename[] = "/tmp/a";
4453
int f = -1;
4554

0 commit comments

Comments
 (0)