Home | History | Annotate | Download | only in binary_search_tool
      1 This file explains how to set up and run the various kinds of bisection tests.
      2 
      3 The bisection tool comes with several sets of tests which you should
      4 run after updating any of the bisection tool scripts OR after updating
      5 the Android compiler wrapper (to make sure the wrapper will still work
      6 correctly with bisection).
      7 
      8 Before you start.
      9 ----------------
     10 
     11 Before you can run the tests, your PYTHONPATH environment variable
     12 must be correct.  This means that it must include both the
     13 toolchain-utils directory and the binary_search_tool directory.  The
     14 easiest way to set it is:
     15 
     16 $ cd toolchain-utils
     17 $ export PYTHONPATH=`pwd`:${PYTHONPATH}
     18 $ cd binary_search_tool
     19 $ export PYTHONPATH=`pwd`:${PYTHONPATH}
     20 
     21 
     22 Running the unittests.
     23 ----------------------
     24 
     25 To run the basic unit tests:
     26 
     27 $ cd toolchain-utils/binary_search_tool/test
     28 $ ./binary_search_tool_tester.py
     29 
     30 Running the bisection tests, testing the compiler wrapper.
     31 ----------------------------------------------------------
     32 
     33 If you want to run the bisection tests, and test the compiler wrapper
     34 (to make sure the POPULATE_GOOD and POPULATE_BAD stages are still
     35 working properly) you can do the following.
     36 
     37 If you are testing with the ANDROID COMPILER WRAPPER, you need to to some
     38 preliminary setup:
     39 
     40 Set up the compiler wrapper to replace GCC:
     41 
     42     $ cd <android-root/prebuilts/clang/host/linux-x86/clang-368880/bin
     43     $ cp clang gcc
     44     $ whereis gcc
     45     gcc: /usr/bin/gcc /usr/lib/gcc /usr/bin/X11/gcc /usr/share/man/man1/gcc.1.gz
     46     $ cd /usr/bin
     47     $ ls -l gcc
     48     lrwxrwxrwx 1 root root 7 Feb  3 17:00 gcc -> gcc-4.8*
     49     $ sudo mv gcc gcc.real
     50     $ sudo ln -s <android-root>/prebuilts/clang/host/linux-x86/clang-3688880/bin/gcc gcc
     51 
     52 Move to the correct directory, then run the test script:
     53 
     54     $ cd toolchain-utils/binary_search_tool
     55     $ ./run_bisect_test.py
     56 
     57 
     58 If you are testing with the CHROMEOS COMPILER WRAPPER, you MUST run the
     59 tests from INSIDE your CHROOT (but you don't need to do any special setup):
     60 
     61     $ cd <path-to-chromeos-root>
     62     $ cros_sdk
     63     $ cd ~/trunk/src/third_party/toolchain-utils
     64 
     65     Set up your PYTHONPATH:
     66 
     67     $ export PYTHONPATH=`pwd`:${PYTHONPATH}
     68     $ cd binary_search_tool
     69     $ export PYTHONPATH=`pwd`:${PYTHONPATH}
     70 
     71     Run the test script:
     72 
     73     $ ./run_bisect_test.py
     74 
     75 
     76 Running the bisection tests, without testing the compiler wrapper.
     77 ------------------------------------------------------------------
     78 
     79 $ cd toolchain-utils/binary_search_tool
     80 $ ./full_bisect_test/run-test-nowrapper.sh
     81