• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3if [[ "$0" = *"/Codegen/runTest.sh" ]]; then
4	#running in subshell - print code to eval and exit
5	echo "source $0"
6else
7    function header_and_eval() {
8        printf "\n[ $* ]\n" 1>&2
9        eval "$@"
10        return $?
11    }
12
13    header_and_eval m -j16 codegen_cli && \
14        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/SampleDataClass.java && \
15        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/SampleWithCustomBuilder.java && \
16        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/ParcelAllTheThingsDataClass.java && \
17        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/HierrarchicalDataClassBase.java && \
18        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/HierrarchicalDataClassChild.java && \
19        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/StaleDataclassDetectorFalsePositivesTest.java && \
20        header_and_eval codegen $ANDROID_BUILD_TOP/frameworks/base/tests/Codegen/src/com/android/codegentest/SampleWithNestedDataClasses.java && \
21        (
22            cd $ANDROID_BUILD_TOP &&
23            header_and_eval mmma -j16 frameworks/base/tests/Codegen && \
24            header_and_eval adb install -r -t "$(find $ANDROID_TARGET_OUT_TESTCASES -name 'CodegenTests.apk')" && \
25            # header_and_eval adb shell am set-debug-app -w com.android.codegentest && \
26            header_and_eval adb shell am instrument -w -e package com.android.codegentest com.android.codegentest/androidx.test.runner.AndroidJUnitRunner
27        )
28
29        exitCode=$?
30
31        # header_and_eval adb shell am clear-debug-app
32
33        return $exitCode
34fi