File: check_performance

package info (click to toggle)
gcc-h8300-hms 1%3A3.4.6%2Bdfsg2-4
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 94,508 kB
  • ctags: 79,901
  • sloc: ansic: 627,399; cpp: 89,017; makefile: 24,796; asm: 21,058; sh: 16,616; yacc: 3,740; perl: 718; xml: 692; lex: 587; exp: 298; awk: 223; pascal: 86; lisp: 59; sed: 37
file content (73 lines) | stat: -rwxr-xr-x 1,830 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash

# Script to do performance testing.

# Invocation 
# check_performance SRC_DIR BUILD_DIR

# 1: variables
#
SRC_DIR=$1
BUILD_DIR=$2

# Now that we've successfully translated the numerical option into
# a symbolic one, we can safely ignore it.
shift

# This has been true all along.  Found out about it the hard way...
case $BASH_VERSION in
    1*)  
	echo 'You need bash 2.x to run check_performance.  Exiting.'; 
	exit 1 ;;
    *)   ;;  
esac

flags_script=$BUILD_DIR/scripts/testsuite_flags
INCLUDES="`$flags_script --build-includes` -include bits/stdc++.h"
FLAGS=`$flags_script --cxxflags`
THREAD_FLAG='-pthread'
COMPILER=`$flags_script --build-cxx`
SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
         -Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
ST_FLAG="-static"
LINK=$SH_FLAG
CXX="$COMPILER $INCLUDES $FLAGS -DNOTHREAD $LINK"
CXX_THREAD="$COMPILER $INCLUDES $FLAGS $THREAD_FLAG $LINK"


TESTS_FILE="testsuite_files_performance"

for NAME in `cat $TESTS_FILE`
do
  RUN=true
  for CYCLE in `sed -n 's,.*\(TEST_[SB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
  do
    RUN=false
    echo $NAME $CYCLE
    FILE_NAME="`basename $NAME`"
    EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
    $CXX -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
    ./$EXE_NAME
    echo ""
  done
  for CYCLE in `sed -n 's,.*\(TEST_[TB][0-9]*\)$,\1,p' $SRC_DIR/testsuite/$NAME`
  do
    RUN=false
    echo $NAME $CYCLE THREAD
    FILE_NAME="`basename $NAME`"
    EXE_NAME="`echo $FILE_NAME-$CYCLE | sed 's/cc$/exe/'`"
    $CXX_THREAD -D$CYCLE $SRC_DIR/testsuite/$NAME -o $EXE_NAME
    ./$EXE_NAME
    echo ""
  done
  if $RUN; then
    echo $NAME
    FILE_NAME="`basename $NAME`"
    EXE_NAME="`echo $FILE_NAME | sed 's/cc$/exe/'`"
    $CXX $SRC_DIR/testsuite/$NAME -o $EXE_NAME
    ./$EXE_NAME
    echo ""
  fi
done

exit 0