Squash commits for public release
This commit is contained in:
8
test/kernel/env/BUILD.gn
vendored
Normal file
8
test/kernel/env/BUILD.gn
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import("//build/test/TEMPLATE.gni")
|
||||
|
||||
xOS_test("env") {
|
||||
test_bundle = "kernel/env"
|
||||
sources = [ "main.c" ]
|
||||
configs = [ "//build/userland:userland_flags" ]
|
||||
deplibs = [ "libc" ]
|
||||
}
|
||||
28
test/kernel/env/main.c
vendored
Normal file
28
test/kernel/env/main.c
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (getenv("OSTEST")) {
|
||||
char* res = getenv("GO");
|
||||
if (!res) {
|
||||
TestErr("Empty GO env var.");
|
||||
}
|
||||
if (strncmp(res, "go", 2)) {
|
||||
TestErr("Different value in GO env var.");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
TestErr("Loop while executing test.");
|
||||
}
|
||||
|
||||
setenv("OSTEST", "1", 1);
|
||||
setenv("GO", "go", 1);
|
||||
execlp(argv[0], argv[0], "loop", NULL);
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user