瀏覽代碼

Add the shared object unit test to CI/standard unit test suites (#213)

* Add the shared object unit test to CI/standard unit test suites (#54 #56)
Don Porter 6 年之前
父節點
當前提交
83d230a774

+ 1 - 6
LibOS/shim/test/native/Makefile

@@ -1,4 +1,4 @@
-special_executables = static pie shared_object
+special_executables = static pie 
 c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
 cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
 manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
@@ -27,11 +27,6 @@ static: %: %.c
 	@$(CC) $(CFLAGS) -o $@ -static $< \
 	$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
 
-shared_object: %: %.c
-	@echo [ $@ ]
-	@$(CC) $(CFLAGS) -o $@ -fPIC -pie $< \
-	$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
-
 pie: %: %.c
 	@echo [ $@ ]
 	@$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \

+ 8 - 0
LibOS/shim/test/regression/00_bootstrap.py

@@ -23,3 +23,11 @@ regression.add_check(name="Five Arguments Given",
            "argv[3] = c" in res[0].out and "argv[4] = d" in res[0].out)
 
 regression.run_checks()
+
+# Shared Object Test
+regression = Regression(loader, "shared_object")
+
+regression.add_check(name="Shared Object",
+    check=lambda res: "Hello world" in res[0].out)
+
+regression.run_checks()

+ 6 - 1
LibOS/shim/test/regression/Makefile

@@ -1,6 +1,6 @@
 CFLAGS-libos = -L../../../build/libos -I../../include
 
-special_executables = bootstrap_static bootstrap_pie
+special_executables = bootstrap_static bootstrap_pie shared_object
 c_executables = $(filter-out $(special_executables),$(patsubst %.c,%,$(wildcard *.c)))
 cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
 manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
@@ -36,6 +36,11 @@ bootstrap_pie: %: %.c
 	@echo [ $@ ]
 	@$(CC) $(CFLAGS) -fPIC --pie -o $@ $< \
 	$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
+
+shared_object: %: %.c
+	@echo [ $@ ]
+	@$(CC) $(CFLAGS) -o $@ -fPIC -pie $< \
+	$(shell echo $@ | sed 's/^[^\.]*//g' | sed 's/\./ -l/g')
 else
 .IGNORE: $(special_executables) $(c_executables) $(cxx_executables)
 $(special_executables) $(c_executables) $(cxx_executables):

+ 0 - 0
LibOS/shim/test/native/shared_object.c → LibOS/shim/test/regression/shared_object.c


+ 1 - 1
LibOS/shim/test/native/shared_object.manifest.template → LibOS/shim/test/regression/shared_object.manifest.template

@@ -1,6 +1,6 @@
 loader.preload = file:$(SHIMPATH)
 loader.env.LD_LIBRARY_PATH = /lib
-loader.debug_type = inline
+loader.debug_type = none
 
 fs.mount.lib.type = chroot
 fs.mount.lib.path = /lib