kayws426 / embox

Automatically exported from code.google.com/p/embox
0 stars 1 forks source link

order of tests within a file with -O2 build #647

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.r10868, x86/nonvga_debug
2.build with -O2
3.

What is the expected output? What do you see instead?
QEMU:
    unit: initializing embox.fs.driver.tmpfs: done
    test: running embox.test.fs.tmpfs_test ......... done
    test: running embox.test.fs.InitFsTest ....... done
    test: running embox.test.block_dev.ramdisk_test 
    failure at src/tests/block_dev/ramdisk_test.c : 28, in function __test_case_at_line_27
        test_assert_zero(ramdisk_delete(FS_DEV))
       case at src/tests/block_dev/ramdisk_test.c : 27
        "Delete ramdisk"
    QEMU: Terminated
ioctl(TUNSETIFF): Device or resource busy

GDB:
(gdb) tar remote :1234
Remote debugging using :1234
0x0000fff0 in ?? ()
(gdb) b ramdisk_test.c :24
Breakpoint 1 at 0x10f7cb: file src/tests/block_dev/ramdisk_test.c, line 24.
(gdb) b ramdisk_test.c :28
Breakpoint 2 at 0x10f79f: file src/tests/block_dev/ramdisk_test.c, line 28.
(gdb) c
Continuing.

Breakpoint 2, __test_case_at_line_27 ()
    at src/tests/block_dev/ramdisk_test.c:28
28      test_assert_zero(ramdisk_delete(FS_DEV));
(gdb) c
Continuing.

Breakpoint 1, __test_case_at_line_23 ()
    at src/tests/block_dev/ramdisk_test.c:24
24      test_assert_zero(err(ramdisk_create(FS_DEV, FS_BLOCKS * PAGE_SIZE())));
(gdb) 

Please use labels and text to provide additional information.

Original issue reported on code.google.com by ki.stfu on 16 Sep 2013 at 4:46

GoogleCodeExporter commented 9 years ago
Well, generally speaking, the order of executing test cases within a suite is 
undefined. If a test case is unable to run alone it is a bad case, IMO. One can 
use case/suite fixtures that run automatically before and after every 
case/suite.

Original comment by Eldar.Abusalimov on 16 Sep 2013 at 4:53

GoogleCodeExporter commented 9 years ago
That is the tests which rely to serial running (inside a file) should be 
rewritten?

Original comment by ki.stfu on 16 Sep 2013 at 5:12

GoogleCodeExporter commented 9 years ago
I think, yes.

Original comment by Eldar.Abusalimov on 16 Sep 2013 at 5:13

GoogleCodeExporter commented 9 years ago

Original comment by ki.stfu on 8 Oct 2013 at 8:12