made it so that ipc_stress_test doesn't get run with `build.sh tests`
diff --git a/aos/atom_code/ipc_lib/ipc_lib.gyp b/aos/atom_code/ipc_lib/ipc_lib.gyp
index f947d5e..617b203 100644
--- a/aos/atom_code/ipc_lib/ipc_lib.gyp
+++ b/aos/atom_code/ipc_lib/ipc_lib.gyp
@@ -77,6 +77,9 @@
'core_lib',
'<(AOS)/common/common.gyp:die',
],
+ 'variables': {
+ 'is_special_test': 1,
+ },
},
],
}
diff --git a/aos/atom_code/ipc_lib/ipc_stress_test.cc b/aos/atom_code/ipc_lib/ipc_stress_test.cc
index 38c425f..6c40926 100644
--- a/aos/atom_code/ipc_lib/ipc_stress_test.cc
+++ b/aos/atom_code/ipc_lib/ipc_stress_test.cc
@@ -212,7 +212,10 @@
new (shared) Shared(time::Time::Now() + kTestTime);
char *temp = strdup(argv[0]);
- shared->path = strdup(dirname(temp));
+ if (asprintf(const_cast<char **>(&shared->path),
+ "%s/../tests", dirname(temp)) == -1) {
+ Die("asprintf failed with %d: %s\n", errno, strerror(errno));
+ }
free(temp);
for (int i = 0; i < kTesters; ++i) {
diff --git a/aos/build/aos.gypi b/aos/build/aos.gypi
index 6f3364f..afbe6de 100644
--- a/aos/build/aos.gypi
+++ b/aos/build/aos.gypi
@@ -150,7 +150,11 @@
],
}, {
'variables': {
+ # Set this to 1 to disable rsyncing the file to the target.
'no_rsync%': 0,
+ # Set this to 1 if this file isn't a test that should get run by
+ # `build.sh tests`.
+ 'is_special_test%': 0,
},
'target_conditions': [
# default to putting outputs into rsync_dir
diff --git a/aos/build/build.sh b/aos/build/build.sh
index eb639de..2bf6982 100755
--- a/aos/build/build.sh
+++ b/aos/build/build.sh
@@ -84,6 +84,6 @@
END
fi
if [[ ${ACTION} == tests ]]; then
- find ${OUTDIR}/Default/tests -executable -exec {} \;
+ find ${OUTDIR}/Default/tests -executable -exec ${AOS}/build/run_test.sh {} \;
fi
fi
diff --git a/aos/build/externals.gyp b/aos/build/externals.gyp
index 2bfee69..ac81553 100644
--- a/aos/build/externals.gyp
+++ b/aos/build/externals.gyp
@@ -170,9 +170,12 @@
'direct_dependent_settings': {
'include_dirs': ['<(externals)/gtest-<(gtest_version)/include'],
'target_conditions': [
- ['_type=="executable"', {
+ ['_type=="executable" and is_special_test==0', {
'product_dir': '<(test_dir)',
},
+ ], ['_type=="executable" and is_special_test==1', {
+ 'product_dir': '<(test_dir)-special',
+ },
],
],
},
diff --git a/aos/build/run_test.sh b/aos/build/run_test.sh
new file mode 100755
index 0000000..9da830b
--- /dev/null
+++ b/aos/build/run_test.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# This gets called by build.sh to run a test.
+
+EXECUTABLE=$1
+
+echo "Running $(basename ${EXECUTABLE})."
+${EXECUTABLE}
+exit $?