Changes in / [18cc83c:6609050] in mainline
- Files:
-
- 73 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r18cc83c r6609050 21 21 kernel/generic/src/debug/real_map.bin 22 22 uspace/app/bdsh/bdsh 23 uspace/app/bdsh/test-bdsh24 23 uspace/app/bithenge/bithenge 25 24 uspace/app/blkdump/blkdump … … 185 184 uspace/dist/srv/udf 186 185 uspace/dist/srv/udp 187 uspace/dist/test/*188 186 uspace/drv/audio/hdaudio/hdaudio 189 187 uspace/drv/audio/sb16/sb16 … … 223 221 uspace/lib/c/arch/amd64/_link.ld 224 222 uspace/lib/c/arch/amd64/include/libarch/common.h 225 uspace/lib/c/test-libc226 uspace/lib/pcut/test-libpcut-*227 223 uspace/lib/posix/collisions.list 228 224 uspace/lib/posix/redefs-hide-libc.xargs 229 225 uspace/lib/posix/redefs-show-posix.xargs 230 226 uspace/lib/posix/include/libc 231 uspace/lib/posix/test-libposix232 uspace/lib/uri/test-liburi233 227 uspace/srv/audio/hound/hound 234 228 uspace/srv/bd/file_bd/file_bd -
HelenOS.config
r18cc83c r6609050 600 600 ! CONFIG_WRITE_CORE_FILES (n/y) 601 601 602 % Include userspace unit tests (PCUT)603 ! CONFIG_PCUT_TESTS (n/y)604 605 % Include PCUT self-tests606 ! CONFIG_PCUT_SELF_TESTS (n/y)607 608 602 % Include development files (headers, libraries) 609 603 ! CONFIG_DEVEL_FILES (n/y) -
boot/Makefile
r18cc83c r6609050 68 68 cp "$$file" "$(DIST_PATH)/app/" ; \ 69 69 done 70 ifeq ($(CONFIG_PCUT_TESTS),y)71 echo "echo Running all tests..." >"$(DIST_PATH)/test/run_all"72 echo "<html><head><title>HelenOS test results</title></head><body>" >"$(DIST_PATH)/test/test.html"73 echo "<h1>HelenOS test results</h1><ul>" >>"$(DIST_PATH)/test/test.html"74 for file in $(RD_TESTS) ; do \75 file2=`basename $$file`; \76 cp "$$file" "$(DIST_PATH)/test/" ; \77 echo "echo ' ->' $$file2" >>"$(DIST_PATH)/test/run_all"; \78 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \79 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_all"; \80 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_all"; \81 echo "<li><a href=\"result-$$file2.txt\">$$file2</a></li>" >>"$(DIST_PATH)/test/test.html"; \82 done83 echo "cp -f /test/test.html /data/web/test.html" >>"$(DIST_PATH)/test/run_all"84 echo "</ul></body></html>" >>"$(DIST_PATH)/test/test.html"85 endif86 87 ifeq ($(CONFIG_PCUT_SELF_TESTS),y)88 echo "echo Running all PCUT self-tests..." >"$(DIST_PATH)/test/run_pcut"89 echo "<html><head><title>Results of PCUT self-tests on HelenOS</title></head><body>" >"$(DIST_PATH)/test/pcut.html"90 echo "<h1>Results of PCUT self-tests on HelenOS</h1><ul>" >>"$(DIST_PATH)/test/pcut.html"91 for file in $(USPACE_PATH)/lib/pcut/test-libpcut-*; do \92 file2=`basename $$file`; \93 name=`echo "$$file2" | sed 's/test-libpcut-//'`; \94 cp "$$file" "$(DIST_PATH)/test/" ; \95 echo "echo ' ->' $$name" >>"$(DIST_PATH)/test/run_pcut"; \96 echo "/test/$$file2 | to /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \97 echo "cat /test/$$file2.out" >>"$(DIST_PATH)/test/run_pcut"; \98 echo "cp -f /test/$$file2.out /data/web/result-$$file2.txt" >>"$(DIST_PATH)/test/run_pcut"; \99 echo "<li><a href=\"result-$$file2.txt\">$$name</a></li>" >>"$(DIST_PATH)/test/pcut.html"; \100 done101 echo "cp -f /test/pcut.html /data/web/pcut.html" >>"$(DIST_PATH)/test/run_pcut"102 echo "</ul></body></html>" >>"$(DIST_PATH)/test/pcut.html"103 endif104 105 70 for drv in $(RD_DRVS) ; do \ 106 71 drv_dir="`dirname "$$drv"`" ; \ … … 135 100 rm -rf $(USPACE_PATH)/dist/inc/* 136 101 rm -f $(USPACE_PATH)/dist/app/* 137 rm -f $(USPACE_PATH)/dist/test/*138 102 rm -f $(USPACE_PATH)/dist/cfg/net/* -
boot/Makefile.common
r18cc83c r6609050 222 222 $(USPACE_PATH)/app/fontviewer/fontviewer 223 223 224 RD_TESTS = \225 $(USPACE_PATH)/lib/c/test-libc \226 $(USPACE_PATH)/lib/posix/test-libposix \227 $(USPACE_PATH)/lib/uri/test-liburi \228 $(USPACE_PATH)/app/bdsh/test-bdsh229 230 231 224 COMPONENTS = \ 232 225 $(KERNEL_PATH)/kernel.bin \ -
uspace/Makefile
r18cc83c r6609050 233 233 lib/usbvirt \ 234 234 lib/pcm \ 235 lib/pcut \236 235 lib/bithenge \ 237 236 lib/posix \ … … 243 242 LIBN_BUILD = $(addsuffix .build,$(LIBN)) 244 243 BUILDS := $(addsuffix .build,$(DIRS)) 245 BUILDS_TESTS := $(addsuffix .build-test,$(DIRS) $(LIBS) lib/c)246 244 247 245 CLEANS := $(addsuffix .clean,$(DIRS)) $(addsuffix .clean,$(LIBN)) $(addsuffix .clean,$(LIBS)) $(addsuffix .clean,$(LIBC)) … … 249 247 .PHONY: all $(LIBC_BUILD) $(LIBS_BUILD) $(LIBN_BUILD) $(BUILDS) $(CLEANS) clean 250 248 251 all: $(BUILDS) $(BUILDS_TESTS) 252 253 $(BUILDS_TESTS): $(BUILDS) 254 $(MAKE) -C $(basename $@) all-test PRECHECK=$(PRECHECK) 249 all: $(BUILDS) 255 250 256 251 clean: $(CLEANS) -
uspace/Makefile.common
r18cc83c r6609050 78 78 JOB = $(BINARY).job 79 79 OUTPUT = $(BINARY) 80 TEST_BINARY = test-$(BINARY)81 80 EXTRA_OUTPUT += $(BINARY).disasm 82 81 EXTRA_CLEAN += $(BINARY).map … … 86 85 JOB = $(LIBRARY).job 87 86 OUTPUT = $(LIBRARY).a 88 TEST_BINARY = test-$(LIBRARY)89 87 endif 90 88 … … 203 201 endif 204 202 205 # PCUT-based unit tests206 ifneq ($(TEST_SOURCES),)207 TEST_OUTPUT = $(TEST_BINARY)208 TEST_CFLAGS = -I$(LIB_PREFIX)/pcut/include -D__helenos__209 TEST_OUTPUT_LIBS = $(LIB_PREFIX)/pcut/libpcut.a210 EXTRA_CLEAN += $(TEST_OUTPUT) $(TEST_OUTPUT).map211 ifneq ($(LIBRARY),)212 TEST_OUTPUT_LIBS += $(OUTPUT)213 endif214 TEST_OUTPUT_LIBS += $(TEST_LIBS)215 endif216 217 203 .PHONY: all clean 218 204 219 205 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(LIBS) $(OUTPUT) $(LOUTPUT) $(EXTRA_OUTPUT) 220 206 -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV) 221 222 all-test: $(TEST_OUTPUT)223 207 224 208 clean: … … 311 295 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 312 296 LOBJECTS := $(addsuffix .lo,$(basename $(SOURCES))) 313 TEST_OBJECTS := $(addsuffix .test.o,$(basename $(TEST_SOURCES)))314 297 315 298 ifneq ($(BINARY),) … … 356 339 endif 357 340 358 ifneq ($(TEST_OUTPUT),)359 $(TEST_OUTPUT): $(LINKER_SCRIPT) $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS)360 $(LD) -n $(LFLAGS) -T $(LINKER_SCRIPT) -M -Map $(TEST_OUTPUT).map -o $@ $(TEST_OBJECTS) $(TEST_OUTPUT_LIBS) $(LIBS) $(BASE_LIBS)361 ifeq ($(CONFIG_STRIP_BINARIES),y)362 $(STRIP) $(TEST_OUTPUT)363 endif364 endif365 366 341 %.o: %.S $(DEPEND) 367 342 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@ … … 382 357 endif 383 358 384 %.test.o: %.c $(DEPEND)385 $(CC) $(DEFS) $(CFLAGS) $(TEST_CFLAGS) -c $< -o $@386 ifeq ($(PRECHECK),y)387 $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS)388 endif389 390 359 %.lo: %.S $(DEPEND) 391 360 $(CC) $(DEFS) $(LIB_CFLAGS) -D__ASM__ -c $< -o $@ … … 407 376 408 377 $(DEPEND): $(PRE_DEPEND) 409 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) $(TEST_SOURCES)> $@ 2> /dev/null378 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null 410 379 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@ 411 380 -
uspace/app/bdsh/Makefile
r18cc83c r6609050 65 65 tok.c 66 66 67 TEST_SOURCES = \68 tok.c \69 test/toktest.c70 71 67 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/c/Makefile
r18cc83c r6609050 165 165 $(ARCH_SOURCES) 166 166 167 TEST_SOURCES = \168 test/main.c \169 test/sprintf.c170 171 167 include $(USPACE_PREFIX)/Makefile.common 172 168 -
uspace/lib/posix/Makefile
r18cc83c r6609050 79 79 source/unistd.c 80 80 81 TEST_SOURCES = \82 test/main.c \83 test/scanf.c84 85 81 include $(USPACE_PREFIX)/Makefile.common 86 82 -
uspace/lib/posix/source/stdio/scanf.c
r18cc83c r6609050 1220 1220 } 1221 1221 1222 // FIXME: put the testcases to the app/tester after scanf is included into libc 1223 1224 #if 0 1225 1226 //#include <stdio.h> 1227 //#include <malloc.h> 1228 //#include <string.h> 1229 1230 #define test_val(fmt, exp_val, act_val) \ 1231 if (exp_val == act_val) { \ 1232 printf("succ, expected "fmt", actual "fmt"\n", exp_val, act_val); \ 1233 } else { \ 1234 printf("fail, expected "fmt", actual "fmt"\n", exp_val, act_val); \ 1235 ++fail; \ 1236 } 1237 1238 #define test_str(fmt, exp_str, act_str) \ 1239 if (posix_strcmp(exp_str, act_str) == 0) { \ 1240 printf("succ, expected "fmt", actual "fmt"\n", exp_str, act_str); \ 1241 } else { \ 1242 printf("fail, expected "fmt", actual "fmt"\n", exp_str, act_str); \ 1243 ++fail; \ 1244 } 1245 1246 void __posix_scanf_test(void); 1247 void __posix_scanf_test(void) 1248 { 1249 int fail = 0; 1250 1251 int ret; 1252 1253 unsigned char uhh; 1254 signed char shh; 1255 unsigned short uh; 1256 short sh; 1257 unsigned udef; 1258 int sdef; 1259 unsigned long ul; 1260 long sl; 1261 unsigned long long ull; 1262 long long sll; 1263 void *p; 1264 1265 float f; 1266 double d; 1267 long double ld; 1268 1269 char str[20]; 1270 char seq[20]; 1271 char scanset[20]; 1272 1273 char *pstr; 1274 char *pseq; 1275 char *pscanset; 1276 1277 ret = posix_sscanf( 1278 "\n j tt % \t -121314 98765 aqw 0765 0x77 0xABCDEF88 -99 884", 1279 " j tt %%%3hhd%1hhu%3hd %3hu%u aqw%n %lo%llx %p %li %lld", 1280 &shh, &uhh, &sh, &uh, &udef, &sdef, &ul, &ull, &p, &sl, &sll); 1281 test_val("%d", -12, shh); 1282 test_val("%u", 1, uhh); 1283 test_val("%d", 314, sh); 1284 test_val("%u", 987, uh); 1285 test_val("%u", 65, udef); 1286 test_val("%d", 28, sdef); 1287 test_val("%lo", (unsigned long) 0765, ul); 1288 test_val("%llx", (unsigned long long) 0x77, ull); 1289 test_val("%p", (void *) 0xABCDEF88, p); 1290 test_val("%ld", (long) -99, sl); 1291 test_val("%lld", (long long) 884, sll); 1292 test_val("%d", 10, ret); 1293 1294 ret = posix_sscanf( 1295 "\n \t\t1.0 -0x555.AP10 1234.5678e12", 1296 "%f %lf %Lf", 1297 &f, &d, &ld); 1298 test_val("%f", 1.0, f); 1299 test_val("%lf", (double) -0x555.AP10, d); 1300 test_val("%Lf", (long double) 1234.5678e12, ld); 1301 test_val("%d", 3, ret); 1302 1303 ret = posix_sscanf( 1304 "\n\n\thello world \n", 1305 "%5s %ms", 1306 str, &pstr); 1307 test_str("%s", "hello", str); 1308 test_str("%s", "world", pstr); 1309 test_val("%d", 2, ret); 1310 free(pstr); 1311 1312 ret = posix_sscanf( 1313 "\n\n\thello world \n", 1314 " %5c %mc", 1315 seq, &pseq); 1316 seq[5] = '\0'; 1317 pseq[1] = '\0'; 1318 test_str("%s", "hello", seq); 1319 test_str("%s", "w", pseq); 1320 test_val("%d", 2, ret); 1321 free(pseq); 1322 1323 ret = posix_sscanf( 1324 "\n\n\th-e-l-l-o world-] \n", 1325 " %9[-eh-o] %m[^]-]", 1326 scanset, &pscanset); 1327 test_str("%s", "h-e-l-l-o", scanset); 1328 test_str("%s", "world", pscanset); 1329 test_val("%d", 2, ret); 1330 free(pscanset); 1331 1332 printf("Failed: %d\n", fail); 1333 } 1334 1335 #endif 1336 1222 1337 /** @} 1223 1338 */ -
uspace/lib/uri/Makefile
r18cc83c r6609050 36 36 uri.c 37 37 38 TEST_SOURCES = \39 test/main.c \40 test/parser.c41 42 38 include $(USPACE_PREFIX)/Makefile.common
Note:
See TracChangeset
for help on using the changeset viewer.